I'm trying to automate a way to set the next boot to be the stock ubuntu kernel. Using a script called list_kernels.sh
which I found on stackoverflow, I can get the number of the menu including the submenu. However, when I run grub-reboot *number*
I get the following:
root@prod150:~# /tmp/list_kernels.sh
0: Ubuntu
0>0 Ubuntu, with Linux 4.9.24
0>1 Ubuntu, with Linux 4.9.24 (recovery mode)
0>2 Ubuntu, with Linux 4.4.0-81-generic
0>3 Ubuntu, with Linux 4.4.0-81-generic (recovery mode)
1: Advanced options for Ubuntu
2: Memory test (memtest86+)
3: Memory test (memtest86+, serial console 115200)
root@prod150:~# grub-reboot 0>2
Menu entry not specified.
Usage: grub-reboot [OPTION] MENU_ENTRY
Set the default boot menu entry for GRUB, for the next boot only.
-h, --help print this message and exit
-v, --version print the version information and exit
--boot-directory=DIR expect GRUB images under the directory DIR/grub
instead of the /boot/grub directory
MENU_ENTRY is a number, a menu item title or a menu item identifier. Please note that menu items in
submenus or sub-submenus require specifying the submenu components and then the
menu item component. The titles should be separated using the greater-than
character (>) with no extra spaces. Depending on your shell some characters including > may need escaping. More information about this is available
in the GRUB Manual in the section about the 'default' command.
Report bugs to <[email protected]>.
Does anyone happen to know what's happening? Stackoverflow suggestion online suggest it should work.
Thanks ahead!