Add default/grub support
This commit is contained in:
parent
c49abfdd24
commit
76e6d0d767
3 changed files with 65 additions and 12 deletions
|
@ -80,6 +80,7 @@ This edition documents version @value{VERSION}.
|
||||||
* Configuration:: Writing your own configuration file
|
* Configuration:: Writing your own configuration file
|
||||||
* Network:: Downloading OS images from a network
|
* Network:: Downloading OS images from a network
|
||||||
* Serial terminal:: Using GRUB via a serial line
|
* Serial terminal:: Using GRUB via a serial line
|
||||||
|
* Vendor power-on keys:: Changing GRUB behaviour on vendor power-on keys
|
||||||
* Preset Menu:: Embedding a configuration file into GRUB
|
* Preset Menu:: Embedding a configuration file into GRUB
|
||||||
* Images:: GRUB image files
|
* Images:: GRUB image files
|
||||||
* Filesystem:: Filesystem syntax and semantics
|
* Filesystem:: Filesystem syntax and semantics
|
||||||
|
@ -747,6 +748,21 @@ implements few VT100 escape sequences. If you specify this option then
|
||||||
GRUB provides you with an alternative menu interface, because the normal
|
GRUB provides you with an alternative menu interface, because the normal
|
||||||
menu requires several fancy features of your terminal.
|
menu requires several fancy features of your terminal.
|
||||||
|
|
||||||
|
@node Vendor power-on keys
|
||||||
|
@chapter Using GRUB with vendor power-on keys
|
||||||
|
Some laptop vendor provide an additional power-on button which boots another OS.
|
||||||
|
GRUB supports such buttons with GRUB_TIMEOUT_BUTTON, GRUB_DEFAULT_BUTTON,
|
||||||
|
GRUB_HIDDEN_TIMEOUT_BUTTON and GRUB_BUTTON_CMOS_ADDRESS variables in
|
||||||
|
default/grub. GRUB_TIMEOUT_BUTTON, GRUB_DEFAULT_BUTTON and
|
||||||
|
GRUB_HIDDEN_TIMEOUT_BUTTON are used instead of corresponding variables without
|
||||||
|
_BUTTON suffix when powered using special button.
|
||||||
|
GRUB_BUTTON_CMOS_ADDRESS is vendor specific and partially model-specific.
|
||||||
|
Values known to GRUB team are:
|
||||||
|
|
||||||
|
@table @key
|
||||||
|
@item Dell XPS M1530
|
||||||
|
85:3
|
||||||
|
@end table
|
||||||
|
|
||||||
@node Filesystem
|
@node Filesystem
|
||||||
@chapter Filesystem syntax and semantics
|
@chapter Filesystem syntax and semantics
|
||||||
|
|
|
@ -246,6 +246,10 @@ export GRUB_DEFAULT \
|
||||||
GRUB_HIDDEN_TIMEOUT \
|
GRUB_HIDDEN_TIMEOUT \
|
||||||
GRUB_HIDDEN_TIMEOUT_QUIET \
|
GRUB_HIDDEN_TIMEOUT_QUIET \
|
||||||
GRUB_TIMEOUT \
|
GRUB_TIMEOUT \
|
||||||
|
GRUB_DEFAULT_BUTTON \
|
||||||
|
GRUB_HIDDEN_TIMEOUT_BUTTON \
|
||||||
|
GRUB_TIMEOUT_BUTTON \
|
||||||
|
GRUB_BUTTON_CMOS_ADDRESS \
|
||||||
GRUB_DISTRIBUTOR \
|
GRUB_DISTRIBUTOR \
|
||||||
GRUB_CMDLINE_LINUX \
|
GRUB_CMDLINE_LINUX \
|
||||||
GRUB_CMDLINE_LINUX_DEFAULT \
|
GRUB_CMDLINE_LINUX_DEFAULT \
|
||||||
|
|
|
@ -38,11 +38,29 @@ if [ "x${GRUB_DEFAULT}" = "xsaved" ] ; then GRUB_DEFAULT='${saved_entry}' ; fi
|
||||||
if [ "x${GRUB_TIMEOUT}" = "x" ] ; then GRUB_TIMEOUT=5 ; fi
|
if [ "x${GRUB_TIMEOUT}" = "x" ] ; then GRUB_TIMEOUT=5 ; fi
|
||||||
if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=640x480 ; fi
|
if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=640x480 ; fi
|
||||||
|
|
||||||
|
if [ "x${GRUB_DEFAULT_BUTTON}" = "x" ] ; then GRUB_DEFAULT_BUTTON="$GRUB_DEFAULT" ; fi
|
||||||
|
if [ "x${GRUB_DEFAULT_BUTTON}" = "xsaved" ] ; then GRUB_DEFAULT_BUTTON='${saved_entry}' ; fi
|
||||||
|
if [ "x${GRUB_TIMEOUT_BUTTON}" = "x" ] ; then GRUB_TIMEOUT_BUTTON="$GRUB_TIMEOUT" ; fi
|
||||||
|
|
||||||
cat << EOF
|
cat << EOF
|
||||||
if [ -s \$prefix/grubenv ]; then
|
if [ -s \$prefix/grubenv ]; then
|
||||||
load_env
|
load_env
|
||||||
fi
|
fi
|
||||||
|
EOF
|
||||||
|
if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then
|
||||||
|
cat <<EOF
|
||||||
|
if cmostest $GRUB_BUTTON_CMOS_ADDRESS ; then
|
||||||
|
set default="${GRUB_DEFAULT_BUTTON}"
|
||||||
|
else
|
||||||
|
set default="${GRUB_DEFAULT}"
|
||||||
|
fi
|
||||||
|
EOF
|
||||||
|
else
|
||||||
|
cat <<EOF
|
||||||
set default="${GRUB_DEFAULT}"
|
set default="${GRUB_DEFAULT}"
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
cat <<EOF
|
||||||
if [ \${prev_saved_entry} ]; then
|
if [ \${prev_saved_entry} ]; then
|
||||||
set saved_entry=\${prev_saved_entry}
|
set saved_entry=\${prev_saved_entry}
|
||||||
save_env saved_entry
|
save_env saved_entry
|
||||||
|
@ -186,21 +204,36 @@ insmod gettext
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "x${GRUB_HIDDEN_TIMEOUT}" != "x" ] ; then
|
make_timeout ()
|
||||||
|
{
|
||||||
|
if [ "x${1}" != "x" ] ; then
|
||||||
if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
|
if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
|
||||||
verbose=
|
verbose=
|
||||||
else
|
else
|
||||||
verbose=" --verbose"
|
verbose=" --verbose"
|
||||||
fi
|
fi
|
||||||
cat << EOF
|
cat << EOF
|
||||||
if sleep$verbose --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then
|
if sleep$verbose --interruptible ${1} ; then
|
||||||
set timeout=${GRUB_TIMEOUT}
|
set timeout=${2}
|
||||||
fi
|
fi
|
||||||
EOF
|
EOF
|
||||||
else
|
else
|
||||||
cat << EOF
|
cat << EOF
|
||||||
set timeout=${GRUB_TIMEOUT}
|
set timeout=${2}
|
||||||
EOF
|
EOF
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then
|
||||||
|
cat <<EOF
|
||||||
|
if cmostest $GRUB_BUTTON_CMOS_ADDRESS ; then
|
||||||
|
EOF
|
||||||
|
make_timeout "${GRUB_HIDDEN_TIMEOUT_BUTTON}" "${GRUB_TIMEOUT_BUTTON}"
|
||||||
|
echo else
|
||||||
|
make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}"
|
||||||
|
echo fi
|
||||||
|
else
|
||||||
|
make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Play an initial tune
|
# Play an initial tune
|
||||||
|
|
Loading…
Reference in a new issue