Project

General

Profile

Bug #20975 » grub.cfg

Kamarasu Alagarsamy, 09/18/2017 05:26 AM

 



default=2
timeout=20

regexp --set=1:m1 --set=2:m2 --set=3:m3 --set=4:m4 --set=5:m5 --set=6:m6 '^([[:xdigit:]]{1,2})\:([[:xdigit:]]{1,2})\:([[:xdigit:]]{1,2})\:([[:xdigit:]]{1,2})\:([[:xdigit:]]{1,2})\:([[:xdigit:]]{1,2})' "$net_default_mac"
mac=${m1}-${m2}-${m3}-${m4}-${m5}-${m6}
configfile=/grub2/grub.cfg-01-$mac
source "$configfile"


menuentry "Chainload Grub2 EFI from ESP" {
unset root
echo Chainloading Grub2 EFI from ESP, available devices:
ls
echo -n "Probing ESP partition ... "
search --file --no-floppy --set=root /EFI/BOOT/BOOTX64.EFI
echo found $root
sleep 2
if [ -f ($root)/EFI/BOOT/grubx64.efi ]; then
chainloader ($root)/EFI/BOOT/grubx64.efi
elif [ -f ($root)/EFI/fedora/grubx64.efi ]; then
chainloader ($root)/EFI/fedora/grubx64.efi
elif [ -f ($root)/EFI/redhat/grubx64.efi ]; then
chainloader ($root)/EFI/redhat/grubx64.efi
elif [ -f ($root)/EFI/centos/grubx64.efi ]; then
chainloader ($root)/EFI/centos/grubx64.efi
elif [ -f ($root)/EFI/debian/grubx64.efi ]; then
chainloader ($root)/EFI/debian/grubx64.efi
elif [ -f ($root)/EFI/ubuntu/grubx64.efi ]; then
chainloader ($root)/EFI/ubuntu/grubx64.efi
elif [ -f ($root)/EFI/Microsoft/grubx64.efi ]; then
chainloader ($root)/EFI/Microsoft/grubx64.efi
elif [ -f ($root)/EFI/EFI/grubx64.efi ]; then
chainloader ($root)/EFI/EFI/grubx64.efi
else
echo File grubx64.efi not found on ESP.
echo Update 'pxegrub2_chainload' paths array with:
ls ($root)/EFI
echo The system will halt in 2 minutes or
echo press ESC to halt immediately.
sleep -i 120
halt --no-apm
fi
}

menuentry "Chainload into BIOS bootloader on first disk" {
set root=(hd0,0)
chainloader +1
}


menuentry 'Foreman Discovery Image' {
linuxefi boot/fdi-image/vmlinuz0 rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nomodeset proxy.url=https://sdslv0003.gisdev proxy.type=foreman BOOTIF=01-$net_default_mac
initrdefi boot/fdi-image/initrd0.img
}



(1-1/3)