On Sat, Feb 17, 2018 at 3:36 PM, Grant Edwards <grant.b.edwa...@gmail.com> wrote: > > I'm trying to figure out how to configure grub 2.02 so that no menu is > displayed and it will boot immediately to the default unless shift is > held down during boot -- in which case it displays the menu and waits > indefinitely for a choice to be made. > > This is a bare-bones grub2 installation without any of the > auto-magical, config generator scripts. All I have is grub.cfg and an > editor. > > I've found many web pages that say all you have to to is edit > /etc/default/grub and set GRUB_TIMEOUT=0 and GRUB_HIDDEN_TIMEOUT=0 and > Bob's your uncle. Of course that file gets mashed about by dozens of > shell scripts comprising thousands of lines of code to product the > real grub.cfg containing hundreds of lines of code. > > [Oh God, how I hate grub2.] > > AFAICT, you end up with > > set timeout=0 > set timeout_style=hidden > > But, that doesn't seem to work. Holding down the shift key during boot > doesn't cause the menu to be displayed, and it always boots directly > to the default no matter what you do. > > Any grub2 experts care to lend a clue?
I don't have a grub2-on-Gentoo install but the below is from a test Debian VM. "90-grub" is the only executable file in "/etc/grub.d/" and pressing "shift" displays the grub menu. I've had problems with "shift" with grub1 and grub2 in the past and I'd use "set timeout=1" and press "esc" in order to display the grub menu if I were you. root@sysd ~ # grub-install --version grub-install (GRUB) 2.02-2 root@sysd ~ # cat /etc/grub.d/90-grub #!/bin/sh cat <<EOF # menu set default=0 set timeout=0 set timeout_style=hidden # kernel insmod gzio # disk/partition insmod part_msdos # filesystem insmod ext2 # /boot search --no-floppy --fs-uuid --set=root 87e976c8-1411-4dab-9c63-d5c7eec9975f # video terminal_input console terminal_output console menuentry 'systemd' { linux /boot/kernel root=UUID=87e976c8-1411-4dab-9c63-d5c7eec9975f ro initrd /boot/ramfs } menuentry 'systemd (single)' { linux /boot/kernel root=UUID=87e976c8-1411-4dab-9c63-d5c7eec9975f ro single initrd /boot/ramfs } menuentry 'systemd (emergency)' { linux /boot/kernel root=UUID=87e976c8-1411-4dab-9c63-d5c7eec9975f ro emergency initrd /boot/ramfs } EOF root@sysd ~ #