GRUB insists displaying the GRUB menu

1 risposta [Ultimo contenuto]
lutes
Offline
Iscritto: 09/04/2020

I am stuck in the trivial task of hiding the grub menu during startup.

I upgraded from T8 to T9 some time ago but never noticed any problem until I tried to hide the grub menu. These are the currently uncommented lines in /etc/default/grub :

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

It seems that editing /etc/default/grub followed by sudo update-grub has no effect. Whatever values are changed in the configuration file, grub keeps behaving the same (i.e. displaying menu and 10s countdown, in this applying the previous value of GRUB_TIMEOUT=10). It all looks like sudo update-grub is taking its cues from another file or simply not taking any cue.

lutes
Offline
Iscritto: 09/04/2020

I do not usually investigate what update-grub does but I got curious because this was the first time GRUB was not doing what it was instructed to in /etc/default/grub.

So I looked at /boot/grub.cfg and found these lines:

if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=10
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=10
fi

which seem to totally explain why my tentative changes (GRUB_TIMEOUT_STYLE=hidden instead of GRUB_TIMEOUT_STYLE=menu and any GRUB_TIMEOUT value other than 10) were never implemented and why GRUB stubbornly displayed the menu with a 10s timeout. There are also some lines further in the file which force timeout value to be 10 if it is set to 0 in the configuration file.

The uncommented lines in /etc/default/grub now read:

GRUB_DEFAULT=0
GRUB_TIMEOUT=1
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

And I am getting the almost unnoticeable menu I was looking for.