Sample Header Ad - 728x90

Passing a boot menu option to GRUB on a Live USB drive?

1 vote
1 answer
1138 views
I have an ubuntu system, and I want to have a semi-automated way of running a clonezilla unattended image / re-image from a USB drive. To that end, I've modified the GRUB menu items to be along these lines: (One for Restore, one for image): menuentry "RESTORE IMAGE" --id live-default { $linux_cmd /live/vmlinuz boot=live union=overlay username=user config components noswap edd=on nomodeset enforcing=0 noprompt ocs_prerun="mount -L Images /mnt" ocs_prerun1="mount --bind /mnt/images /home/partimag/" ocs_live_run="ocs-sr -g auto -e1 auto -e2 -r -j2 -c -k0 -scr -icds -p reboot restoredisk ask_user ask_user" keyboard-layouts=en-us ocs_live_batch="yes" locales=en_US.UTF-8 vga=788 ip= nosplash net.ifnames=0 i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1 $initrd_cmd /live/initrd.img } What I want to be able to do from the running machine is something like the following: 1. Set next boot (using efibootmgr?) to USB drive 2. touch or set *something* to choose either the RESTORE or IMAGE option on the USB drive GRUB menu item. 3. Reboot into USB drive, run the selected boot path The dumb way I can think of this is modifying the USB grub.conf each time to set the default menu item. There has to be a better way, right?
Asked by hex4def6 (111 rep)
Mar 15, 2023, 10:59 PM
Last activity: Mar 24, 2023, 04:22 PM