1 Description: Bypass menu unless other OSes are installed or Shift is pressed
2 If other operating systems are installed, then automatically unhide the
3 menu. Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus if
4 available to check whether Shift is pressed. If it is, show the menu,
5 otherwise boot immediately. If keystatus is not available, then fall back
6 to a short delay interruptible with Escape.
8 This may or may not remain Ubuntu-specific, although it's not obviously
9 wanted upstream. It implements a requirement of
10 https://wiki.ubuntu.com/DesktopExperienceTeam/KarmicBootExperienceDesignSpec#Bootloader.
11 Author: Colin Watson <cjwatson@ubuntu.com>
13 Last-Update: 2011-01-05
15 Index: b/util/grub.d/00_header.in
16 ===================================================================
17 --- a/util/grub.d/00_header.in
18 +++ b/util/grub.d/00_header.in
23 - if [ "x${1}" != "x" ] ; then
24 - if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
27 - verbose=" --verbose"
30 -if sleep$verbose --interruptible ${1} ; then
42 if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then
43 Index: b/util/grub.d/30_os-prober.in
44 ===================================================================
45 --- a/util/grub.d/30_os-prober.in
46 +++ b/util/grub.d/30_os-prober.in
49 . ${libdir}/grub/grub-mkconfig_lib
54 + if [ "x${found_other_os}" = "x" ] ; then
55 + if [ "x${1}" != "x" ] ; then
56 + if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
59 + verbose=" --verbose"
62 + if [ "x${1}" = "x0" ] ; then
64 +if [ "x\${timeout}" != "x-1" ]; then
66 + if keystatus --shift; then
72 + if sleep$verbose --interruptible 3 ; then
80 +if [ "x\${timeout}" != "x-1" ]; then
81 + if sleep$verbose --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then
92 + if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then
94 +if cmostest $GRUB_BUTTON_CMOS_ADDRESS ; then
96 + make_timeout "${GRUB_HIDDEN_TIMEOUT_BUTTON}" "${GRUB_TIMEOUT_BUTTON}"
98 + make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}"
101 + make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}"
105 if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
110 if [ -z "`which os-prober 2> /dev/null`" -o -z "`which linux-boot-prober 2> /dev/null`" ] ; then
111 # missing os-prober and/or linux-boot-prober
116 OSPROBED="`os-prober | tr ' ' '^' | paste -s -d ' '`"
117 if [ -z "${OSPROBED}" ] ; then
118 # empty os-prober output, nothing doing
126 menuentry "${LONGNAME} (${2}-bit) (on ${DEVICE})" --class osx --class darwin --class os {
134 menuentry "${LONGNAME} (on ${DEVICE})" --class windows --class os {
137 LINITRD="${LINITRD#/boot}"
142 menuentry "${LLABEL} (on ${DEVICE})" --class gnu-linux --class gnu --class os {
145 osx_entry xnu_kernel64 64
150 menuentry "${LONGNAME} (on ${DEVICE})" --class hurd --class gnu --class os {