Why does GRUB show the menu by default for EFI devices?
- Login o registrati per inviare commenti
After installing Trisquel 11 on a work computer (Wi-Fi adapters came in!), I noticed the GRUB menu is shown before booting. An option is selected automatically after some time, but I don't understand why the menu would be shown be default. I noticed these lines in /etc/grub.d/00_header :
```
if [ \$grub_platform = efi ]; then
set timeout=${GRUB_RECORDFAIL_TIMEOUT:-30}
if [ x\$feature_timeout_style = xy ] ; then
set timeout_style=menu
fi
fi
```
I am not sure I am understanding these lines properly, but it looks like this forces the menu to display on EFI devices specifically, though I suppose I could have missed it being set for other kinds of devices elsewhere. Does anyone know why the menu is shown by default in this case? Is there a good way to make it so the menu doesn't display unless Esc or Shift or some other specific key is pressed?
I would have expected the default to be a quick splash screen that doesn't present any options but does say which key to press for options.
I did find this older forum post from 2021: https://trisquel.info/en/forum/grub-insists-displaying-grub-menu
It suggests a workaround of setting the timeout to 1.
Setting GRUB_TIMEOUT_STYLE to "hidden" should work. In a terminal (here using Pluma; choose your favorite text editor):
$ sudo sed -i 's/GRUB_TIMEOUT_STYLE=.*/GRUB_TIMEOUT_STYLE=hidden/' /etc/default/grub
$ sudo update-grub
I think the value was already set to "hidden", so running that sed command had no effect.
"An option is selected automatically after some time, but I don't understand why the menu would be shown be default"
The GRUB menu appears by default so you can adjust boot options if needed, especially for troubleshooting. In some cases changes must made before the booting occurs. Having it visible avoids the hassle of the whole recovery USB just to turn the menu back on again or change the delay that was made impossibly short to do anything.
My understanding is that if the menu was hidden then I would still be able to press or hold a particular button in order to get, and I think a message could be shown indicating which button to press.
Though, I suppose that could lead to confusion if the button is accidentally pressed, whereas if the menu appears every time then people expect it.
It probably doesn't really matter much either way I guess, since mostly the laptops will be suspended rather than powered-down.