It seems grub2.efi for a boot manager is not popular on reboot.pro forums, and I'm having problems getting what should be a simple question answered. I don't have linux installed and am booting various other stuff, using grub2 efi, since it works well and boots all the stuffs.
With grub4dos it is easy you simply need a few files on the root partition so you can remember the last booted item and boot from it eg
grldr
menu.lst
default
menu.lst
timeout 3 default /default title Boot - XP-1.vhd (7GB) savedefault hide (hd0,0) hide (hd0,1) find --set-root --ignore-floppies /XP-1.vhd map /XP-1.vhd (hd0) map --hook root (hd0,0) chainloader /ntldr title Boot - OSX savedefault hide (hd0,1) unhide (hd0,0) parttype (hd0,0) 0xAF rootnoverify (hd0,0) makeactive chainloader --force +1 title Boot - NT6 savedefault hide (hd0,0) unhide (hd0,1) parttype (hd0,1) 0x07 rootnoverify (hd0,1) makeactive chainloader /bootmgr
Which seems fairly simple and straight forward, however with grub2 efi it seems that everyone has in their mind you have to recompile and rebuild it everytime under your linux OS, however I do not have a linux OS or desire having one, I simple want to modify the text file grub.cfg and have an option to savedefault
this is my current grub.cfg which is working great with only the 3 files required but I want to be able to boot the last booted option everytime
/EFI/Boot/BOOTX64.efi
/EFI/Boot/grubx64.efi
/EFI/Boot/grub.cfg
set default="0" function load_video { insmod efi_gop insmod efi_uga insmod video_bochs insmod video_cirrus insmod all_video } load_video set gfxpayload=keep insmod gzio insmod part_gpt set timeout=4 menuentry "Windows 7 UEFI" { insmod chain search --file --no-floppy --set=root /efi/Microsoft/win7/bootmgfw.efi chainloader (${root})/efi/Microsoft/win7/bootmgfw.efi } menuentry "OSX Clover" { # Clover insists that bootx64.efi sits in /efi/boot and looks for /efi/clover/cloverx64.efi insmod chain search --file --no-floppy --set=root /efi/Boot/BOOTX64.clover.efi chainloader (${root})/efi/Boot/BOOTX64.clover.efi } # clonezilla live partition #search --file --set=CLZDRV --no-floppy /clonezilla/live/vmlinuz #echo $(CLZDRV) # will show hd0,gpt1 - not useful for clonezilla # hint: cat /proc/cmdline - check clonezilla parameters # hint: user:user pass:live menuentry 'Clonezilla Restore' --class gnu-linux --class gnu --class os { set CLZDRV=sda1 set CLZDIR=/clonezilla/live set BUPDRV=sda2 set BUPDIR=/clonezilla/images set BOPT="boot=live quiet union=overlay keyboard-layouts=NONE locales=en_US.UTF-8" set RUN="ocs_live_run=\"ocs-live-general\" live-media-path=$CLZDIR bootfrom=/dev/$CLZDRV toram=filesystem.squashfs ocs_live_batch=yes" set PRERUN="ocs_prerun=\"mount /dev/$BUPDRV /mnt\" ocs_prerun1=\"mount --bind /mnt/$BUPDIR /home/partimag/\"" set RUN1="ocs_live_run=\"ocs-sr --batch -scr -t -k -p reboot restoreparts ask_user ask_user\"" linuxefi /clonezilla/live/vmlinuz $BOPT $RUN $PRERUN $RUN1 initrdefi /clonezilla/live/initrd.img } menuentry 'Clonezilla Create' --class gnu-linux --class gnu --class os { set CLZDRV=sda1 set CLZDIR=/clonezilla/live set BUPDRV=sda2 set BUPDIR=/clonezilla/images set BOPT="boot=live union=overlay keyboard-layouts=NONE locales=en_US.UTF-8" set RUN="ocs_live_run=\"ocs-live-general\" live-media-path=$CLZDIR bootfrom=/dev/$CLZDRV toram=filesystem.squashfs ocs_live_batch=yes" set PRERUN="ocs_prerun=\"mount /dev/$BUPDRV /mnt\" ocs_prerun1=\"mount --bind /mnt/$BUPDIR /home/partimag/\"" set RUN1="ocs_live_run=\"ocs-sr --batch -q -nogui -z2p -i 2048 -fsck -scs -senc -rm-win-swap-hib -p choose saveparts ask_user ask_user\"" linuxefi /clonezilla/live/vmlinuz $BOPT $RUN $PRERUN $RUN1 initrdefi /clonezilla/live/initrd.img } menuentry 'Wimboot test' { insmod chain search --file --set=root --no-floppy /wimboot/bootmgr set cmdline="initrdfile=/wimboot/bootmgr,/wimboot/BCD,/wimboot/boot.sdi,/wimboot/snip/boot.wim pause" chainloader (${root})/wimboot/wimboot $cmdline } ### http://forum.ipxe.org/showthread.php?tid=8112 ### http://forum.ipxe.org/showthread.php?tid=8193&pid=13354#pid13354 menuentry "iPXE"{ search --no-floppy --set=root -f /clonezilla/live/ipxe.efi chainloader (${root})/clonezilla/live/ipxe.efi + 1 }
Anyway I have tried searching and googling, and trying a few different things, it seems all the searches involve recompiling grub in ubuntu which I obviously do not have. Hopefully someone knows a quick and easy way to make this happen. Fingers crossed.
Eg
which file to save where
the command under grub2 to load the default
the command under grub2 to save the default
and a working example would be awesome