# # file: efi-grub.cfg # # This file gets copied from /boot/grub/config/efi-grub.cfg on the # main ext4 partition to /boot/grub/grub.cfg on the fat32 partition # on a live-usb made by live-usb-maker. The UUID of the main # partition replaces %UUID% in the code. These steps allow us to # use grub.cfg on the main parition when booting via UEFI. main_uuid="%UUID%" id_file="%ID_FILE%" if ! search --no-floppy --set root --fs-uuid ${main_uuid} hd0,1; then echo "" echo " UUID Error!" echo "Cannot find partiton with uuid: ${main_uuid}" echo "" echo "Searching partitions for fallback file ${id_file}" echo "" sleep -i -v 5 echo "" if ! search --no-floppy --set root --file ${id_file} hd0,1; then echo "" echo " ID_FILE Error!" echo "" echo "Cannot find partiton with file: ${id_file}" echo "" echo "Giving up. Press to reboot." sleep -i -v 100 reboot fi fi set prefix=($root)/boot/grub if [ -e $prefix/${grub_cpu}-efi/grub.cfg ]; then source $prefix/${grub_cpu}-efi/grub.cfg else source $prefix/grub.cfg fi