From ac3ed23638cbc4b10059f9678283d08b4a082136 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 27 Feb 2018 19:23:41 +0000 Subject: UEFI: add minimal grub.cfg to fat32 partition On some UEFI implementations, like the AMI found in the Supermicro X10SDV-TP8F development board, the fat32 partition will be loaded first and so Grub will set it the root, and then drop to the console as it cannot find any config on it. Add a minimal grub.cfg that allows Grub to find the main config on the ISO 9660 partition and load it. Closes: #892406 --- scripts/build/binary_grub-efi | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) 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 <