Skip to content

DRAFT: Fuse GRUB configuration into the EFI binary

Kareem Zarka requested to merge kzarka/oniro:grub-merge into kirkstone

Updating two files in a safe, transactional manner is way, way harder than updating one. By having the grub.cfg file built-into GRUB binary we can avoid a lot of complexity without limiting anything relevant. Configure GRUB to have a built-in config file identical to the one we currently build in the oniro-grub-bootconf recipe. The existing file may "stay" if it is unused and this makes things easier for wic integration. Make sure to create a cleanup task if this happens..

On my first try to fuse grub.cfg into grub-efi I fail... I've override the cfg file provided by the base recipe grub-efi_2.06.bb to the new one inside of oniro/meta-oniro-core/recipes-bsp/grub/files/cfg Then I had to expand the variables of the cfg file inside of the oniro/meta-oniro-core/recipes-bsp/grub/grub-efi_%bbappend and finally embeded the file to the binary.

After building the recipe and the image oniro-image-base the booting fails with the following error

BdsDxe: loading Boot0001 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0x4,0x0)/Scsi(0x0,0x0)
BdsDxe: starting Boot0001 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0x4,0x0)/Scsi(0x0,0x0)
Welcome to GRUB!

Unknown command `#'.
Unknown command `#'.
Unknown command `#'.
Unknown command `#'.
Unknown command `#'.
Unknown command `#'.
Unknown command `#'.
Unknown command `#'.
Unknown command `#'.
Unknown command `#'.
Unknown command `#'.
Unknown command `#'.
Unknown command `#'.
Unknown command `if'.
note: found ONIRO_BOOT_PART=
Unknown command `else'.
error: cannot find boot partition, halting
runqemu - INFO - Cleaning up
runqemu - INFO - Host uptime: 106393.93

sadly yes I'm not able to boot....

Signed-off-by: Kareem Zarka kareem.zarka@huawei.com

Edited by Kareem Zarka

Merge request reports