From 2fc8352c8929dec410d4b91fb7e738b2ae71bb4f Mon Sep 17 00:00:00 2001 From: Li Zhou Date: Mon, 19 Jun 2023 20:17:14 -0700 Subject: [PATCH] efi.img: update grub.cfg with custom setting USB installation failures are seen on r740 lab with UEFI. The root cause is: When we want to install from usb disk, usb disk will have 2 partitions. After the "dd" command, partition 1's content is from the iso and partition 2's content is from efi.img. Both of them can be detected by r740 BIOS as boot devices. The /EFI/BOOT/grub.cfg in iso is customized in LAT hook iso-post-script, which runs after efi.img is created. So the customization can't be in the /EFI/BOOT/grub.cfg in efi.img. This causes the installation failure when booting from partition 2. Fix this issue by updating /EFI/BOOT/grub.cfg in efi.img after the customization. Test plan: PASS: USB installation on r740 lab with UEFI succeeds when each of the usb boot devices is selected. PASS: Secure boot installations for both pxeboot and usb succeed. PASS: Legacy BIOS installation is not affected. PASS: Both pxeboot and usb installations are fine on non-DELL labs. Closes-Bug: 2024522 Signed-off-by: Li Zhou Change-Id: Ica9fb15e4ecde597275e6f19fa300f7ebfde35f0 --- debian-mirror-tools/config/debian/common/base-bullseye.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian-mirror-tools/config/debian/common/base-bullseye.yaml b/debian-mirror-tools/config/debian/common/base-bullseye.yaml index 11e0b462..144840a6 100644 --- a/debian-mirror-tools/config/debian/common/base-bullseye.yaml +++ b/debian-mirror-tools/config/debian/common/base-bullseye.yaml @@ -370,6 +370,12 @@ iso-post-script: | EFI/BOOT/grub.cfg fi + # Update the grub.cfg in efi.img according to above setting. + # Don't update grub.cfg.sig because the grub.cfg signature checking + # has been omitted. + mdel -i efi.img ::/EFI/BOOT/grub.cfg + mcopy -i efi.img EFI/BOOT/grub.cfg ::/EFI/BOOT/ + # Put the controller-0 pxeboot install grub menu samples and # setup script into a new the ISO's pxeboot/samples directory. install -v -d -m 0755 pxeboot/samples