a2c1332b70
* commands/i386/pc/drivemap.c: Remove all trailing whitespace. * commands/lspci.c: Likewise. * commands/probe.c: Likewise. * commands/xnu_uuid.c: Likewise. * conf/i386-coreboot.rmk: Likewise. * conf/i386-efi.rmk: Likewise. * conf/i386-ieee1275.rmk: Likewise. * conf/i386-pc.rmk: Likewise. * conf/powerpc-ieee1275.rmk: Likewise. * conf/sparc64-ieee1275.rmk: Likewise. * conf/x86_64-efi.rmk: Likewise. * fs/i386/pc/pxe.c: Likewise. * gettext/gettext.c: Likewise. * include/grub/efi/graphics_output.h: Likewise. * include/grub/i386/pc/memory.h: Likewise. * kern/env.c: Likewise. * kern/i386/qemu/startup.S: Likewise. * lib/i386/pc/biosnum.c: Likewise. * lib/i386/relocator.c: Likewise. * lib/i386/relocator_asm.S: Likewise. * lib/relocator.c: Likewise. * loader/i386/bsd.c: Likewise. * loader/i386/multiboot.c: Likewise. * loader/i386/pc/chainloader.c: Likewise. * loader/i386/xnu.c: Likewise. * loader/xnu.c: Likewise. * normal/main.c: Likewise. * normal/menu_text.c: Likewise. * util/getroot.c: Likewise. * util/grub-mkconfig_lib.in: Likewise. * util/grub.d/00_header.in: Likewise. * util/i386/pc/grub-mkimage.c: Likewise. * util/mkisofs/eltorito.c: Likewise. * util/mkisofs/exclude.h: Likewise. * util/mkisofs/hash.c: Likewise. * util/mkisofs/iso9660.h: Likewise. * util/mkisofs/joliet.c: Likewise. * util/mkisofs/mkisofs.c: Likewise. * util/mkisofs/mkisofs.h: Likewise. * util/mkisofs/multi.c: Likewise. * util/mkisofs/name.c: Likewise. * util/mkisofs/rock.c: Likewise. * util/mkisofs/tree.c: Likewise. * util/mkisofs/write.c: Likewise. * video/efi_gop.c: Likewise.
129 lines
3.4 KiB
Bash
129 lines
3.4 KiB
Bash
#! /bin/sh -e
|
|
|
|
# grub-mkconfig helper script.
|
|
# Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc.
|
|
#
|
|
# GRUB is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# GRUB is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
transform="@program_transform_name@"
|
|
|
|
prefix=@prefix@
|
|
exec_prefix=@exec_prefix@
|
|
libdir=@libdir@
|
|
grub_prefix=`echo /boot/grub | sed ${transform}`
|
|
locale_dir=`echo /boot/grub/locale | sed ${transform}`
|
|
grub_lang=`echo $LANG | cut -d _ -f 1`
|
|
|
|
. ${libdir}/grub/grub-mkconfig_lib
|
|
|
|
# Do this as early as possible, since other commands might depend on it.
|
|
# (e.g. the `loadfont' command might need lvm or raid modules)
|
|
for i in ${GRUB_PRELOAD_MODULES} ; do
|
|
echo "insmod $i"
|
|
done
|
|
|
|
if [ "x${GRUB_DEFAULT}" = "x" ] ; then GRUB_DEFAULT=0 ; fi
|
|
if [ "x${GRUB_TIMEOUT}" = "x" ] ; then GRUB_TIMEOUT=5 ; fi
|
|
if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=640x480 ; fi
|
|
|
|
cat << EOF
|
|
set default=${GRUB_DEFAULT}
|
|
EOF
|
|
|
|
case ${GRUB_TERMINAL_INPUT}:${GRUB_TERMINAL_OUTPUT} in
|
|
serial:* | *:serial)
|
|
if ! test -e ${grub_prefix}/serial.mod ; then
|
|
echo "Serial terminal not available on this platform." >&2 ; exit 1
|
|
fi
|
|
|
|
if [ "x${GRUB_SERIAL_COMMAND}" = "x" ] ; then
|
|
grub_warn "Requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used."
|
|
GRUB_SERIAL_COMMAND=serial
|
|
fi
|
|
echo "${GRUB_SERIAL_COMMAND}"
|
|
;;
|
|
esac
|
|
|
|
case x${GRUB_TERMINAL_INPUT} in
|
|
x)
|
|
# Just use the native terminal
|
|
;;
|
|
x*)
|
|
cat << EOF
|
|
if terminal_input ${GRUB_TERMINAL_INPUT} ; then true ; else
|
|
# For backward compatibility with versions of terminal.mod that don't
|
|
# understand terminal_input
|
|
terminal ${GRUB_TERMINAL_INPUT}
|
|
fi
|
|
EOF
|
|
;;
|
|
esac
|
|
|
|
case x${GRUB_TERMINAL_OUTPUT} in
|
|
xgfxterm)
|
|
# Make the font accessible
|
|
prepare_grub_to_access_device `${grub_probe} --target=device ${GRUB_FONT_PATH}`
|
|
|
|
cat << EOF
|
|
if loadfont `make_system_path_relative_to_its_root ${GRUB_FONT_PATH}` ; then
|
|
set gfxmode=${GRUB_GFXMODE}
|
|
insmod gfxterm
|
|
insmod ${GRUB_VIDEO_BACKEND}
|
|
if terminal_output gfxterm ; then true ; else
|
|
# For backward compatibility with versions of terminal.mod that don't
|
|
# understand terminal_output
|
|
terminal gfxterm
|
|
fi
|
|
fi
|
|
EOF
|
|
;;
|
|
x)
|
|
# Just use the native terminal
|
|
;;
|
|
x*)
|
|
cat << EOF
|
|
if terminal_output ${GRUB_TERMINAL_OUTPUT} ; then true ; else
|
|
# For backward compatibility with versions of terminal.mod that don't
|
|
# understand terminal_output
|
|
terminal ${GRUB_TERMINAL_OUTPUT}
|
|
fi
|
|
EOF
|
|
;;
|
|
esac
|
|
|
|
# Gettext variables and module
|
|
if [ "x${LANG}" != "xC" ] ; then
|
|
cat << EOF
|
|
set locale_dir=${locale_dir}
|
|
set lang=${grub_lang}
|
|
insmod gettext
|
|
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}
|
|
fi
|
|
EOF
|
|
else
|
|
cat << EOF
|
|
set timeout=${GRUB_TIMEOUT}
|
|
EOF
|
|
fi
|