-menuentry "Boot OS of first partition on first disk" --unrestricted {
- if [ -d (cd) ]; then
- chainloader (hd0)+1
- fi
-
- if [ "$root" = "hd1" ]; then
- chainloader (hd0)+1
- fi
-
- if [ "$root" = "hd0" ]; then
+menuentry "Boot OS from first partition on first disk" {
+ if [ "$grub_platform" = "efi" ]; then
+ if [ -f (hd0,gpt1)/efi/debian/grub.cfg ]; then
+ configfile (hd0,gpt1)/efi/debian/grub.cfg
+ elif [ -f (hd1,gpt1)/efi/debian/grub.cfg ]; then
+ configfile (hd1,gpt1)/efi/debian/grub.cfg
+ elif [ -f (hd0,gpt2)/boot/grub/grub.cfg ]; then
+ configfile (hd0,gpt2)/boot/grub/grub.cfg
+ elif [ -f (hd1,gpt2)/boot/grub/grub.cfg ]; then
+ configfile (hd1,gpt2)/boot/grub/grub.cfg
+ else
+ echo "cannot find grub.cfg"
+ sleep 7
+ fi
+ # legacy BIOS booting
+ elif [ -d (cd) ]; then
+ set root=(hd0)
+ chainloader +1
+ else