In grub-pc how to add hiddenmenu?

Niko Cavallini Araya niko.cava at gmail.com
Sun Aug 31 22:59:20 UTC 2008


On Sun, Aug 31, 2008 at 1:04 PM, Felix Zielcke <fzielcke at z-51.de> wrote:
> Hello,
>
> Am Sonntag, den 31.08.2008, 12:08 -0600 schrieb Niko Cavallini Araya:
>> Hi, this week I made a clean debian sid install and decided to install
>> grub2 instead of -legacy.
>> It is working nicely, great job there!
>
> Great to hear.
>
>> I want to add the "hiddenmenu" functionality found in grub-legacy, to
>> this end I came across
>> http://grub.enbug.org/Hiddenmenu but I am unsure were should I use this.
>>
>> My guess is that I should add it somewhere in /etc/grub.d/00_header.
>> Is this correct?
>
> Well upstream has a help-grub list or something like that, but I'm not
> subscribed so I don't know if it would be that helpful for you.
>
> You could copy /etc/grub.d/40_custom to 08_hiddenmenu
> and then put the lines of the Wiki there instead of the `# This is an
> example file'
>
> --
> Felix Zielcke
>
>


hehe, got it working, I made a 03_hiddenmenu like this:

_________
#!/bin/sh
#exec tail -n +3 $0
# This is to provide legacy "hiddenmenu" from /etc/default/grub

if [ "x${GRUB_HIDDENMENU}" = "xtrue" ]; then
  cat << EOF
echo -n "Press ESC to enter the menu... "
if sleep --verbose --interruptible ${GRUB_TIMEOUT} ; then
  set timeout=${GRUB_TIMEOUT}
else
  set timeout=-1
fi
EOF
fi
_________


and added this to /etc/default/grub

_________
# Uncomment to hide the menu (use 'ESC' to display)
GRUB_HIDDENMENU=true
_________


and finally added GRUB_HIDDENMENU in the optional
user defined vars in update-grub


I chose to use 03 so that nothing is shown at boot time
unless there is a need for it. timeout=-1 so that there is
no timeout after the menu is shown. All this can be
added in 00_header to avoid setting timeout twice.

I tested this with and without graphical terminal.

How does this all look?

-- 
Saludos
 Niko



More information about the Pkg-grub-devel mailing list