* Configuration:: Writing your own configuration file
* Network:: Downloading OS images from a network
* 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
* Images:: GRUB image files
* Filesystem:: Filesystem syntax and semantics
GRUB provides you with an alternative menu interface, because the normal
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
@chapter Filesystem syntax and semantics
if [ "x${GRUB_TIMEOUT}" = "x" ] ; then GRUB_TIMEOUT=5 ; 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
if [ -s \$prefix/grubenv ]; then
load_env
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}"
+EOF
+fi
+cat <<EOF
if [ \${prev_saved_entry} ]; then
set saved_entry=\${prev_saved_entry}
save_env saved_entry
EOF
fi
-if [ "x${GRUB_HIDDEN_TIMEOUT}" != "x" ] ; then
- if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
- verbose=
- else
- verbose=" --verbose"
- fi
- cat << EOF
-if sleep$verbose --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then
- set timeout=${GRUB_TIMEOUT}
+make_timeout ()
+{
+ if [ "x${1}" != "x" ] ; then
+ if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
+ verbose=
+ else
+ verbose=" --verbose"
+ fi
+ cat << EOF
+if sleep$verbose --interruptible ${1} ; then
+ set timeout=${2}
fi
EOF
-else
- cat << EOF
-set timeout=${GRUB_TIMEOUT}
+ else
+ cat << EOF
+set timeout=${2}
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
# Play an initial tune