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 <li.zhou@windriver.com>
Change-Id: Ica9fb15e4ecde597275e6f19fa300f7ebfde35f0
This commit is contained in:
Li Zhou 2023-06-19 20:17:14 -07:00
parent 453e43cece
commit 2fc8352c89

View File

@ -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