]> git.proxmox.com Git - grub2.git/blob - util/grub.d/00_header.in
2007-07-22 Yoshinori K. Okuji <okuji@enbug.org>
[grub2.git] / util / grub.d / 00_header.in
1 #! /bin/sh -e
2
3 # update-grub helper script.
4 # Copyright (C) 2006,2007 Free Software Foundation, Inc.
5 #
6 # GRUB is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # GRUB is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with GRUB. If not, see <http://www.gnu.org/licenses/>.
18
19 prefix=@prefix@
20 exec_prefix=@exec_prefix@
21 libdir=@libdir@
22 platform=@platform@
23
24 # for convert_system_path_to_grub_path()
25 . ${libdir}/grub/update-grub_lib
26
27 if [ "x${GRUB_DEFAULT}" = "x" ] ; then GRUB_DEFAULT=0 ; fi
28 if [ "x${GRUB_TIMEOUT}" = "x" ] ; then GRUB_TIMEOUT=5 ; fi
29
30 cat << EOF
31 set default=${GRUB_DEFAULT}
32 set timeout=${GRUB_TIMEOUT}
33 EOF
34
35 if [ "x${GRUB_DRIVE}" = "x" ] ; then : ; else
36 echo "set root=${GRUB_DRIVE}"
37 fi
38
39 if [ "x${GRUB_FONT_PATH}" = "x" ] ; then : ; else
40 echo "font ${GRUB_FONT_PATH}"
41 fi
42
43 case ${platform}:${GRUB_TERMINAL} in
44 pc:gfxterm) cat << EOF
45 set gfxmode=640x480
46 insmod gfxterm
47 insmod vbe
48 EOF
49 ;;
50 *:serial)
51 if [ "x${GRUB_SERIAL_COMMAND}" = "x" ] ; then
52 echo "Warning, requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used." >&2
53 GRUB_SERIAL_COMMAND=serial
54 fi
55 echo "${GRUB_SERIAL_COMMAND}"
56 ;;
57 esac
58
59 echo "terminal ${GRUB_TERMINAL}"