diff --git a/scripts/build/binary_grub-efi b/scripts/build/binary_grub-efi index bad4dc82c..aea42a693 100755 --- a/scripts/build/binary_grub-efi +++ b/scripts/build/binary_grub-efi @@ -133,6 +133,21 @@ case "${LB_ARCHITECTURES}" in esac +# On some platforms the EFI grub image will be loaded, so grub's root +# variable will be set to the EFI partition. This means that grub will +# look in that partition for a grub.cfg file, and even if it finds it +# it will not be able to find the vmlinuz and initrd. +# Drop a minimal grub.cfg in the EFI partition that sets the root and prefix +# to whatever partition holds the /live/vmlinuz image, and load the grub +# config from that same partition. +# This is what the Ubuntu livecd already does. +mkdir -p ${_CHROOT_DIR}/grub-efi-temp-cfg +cat >${_CHROOT_DIR}/grub-efi-temp-cfg/grub.cfg <