~ubuntu-branches/debian/stretch/grub2/stretch

« back to all changes in this revision

Viewing changes to util/grub-mkconfig.in

Tags: upstream-1.98+20100705
ImportĀ upstreamĀ versionĀ 1.98+20100705

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh -e
 
1
#! /bin/sh
 
2
set -e
2
3
 
3
4
# Generate grub.cfg by inspecting /boot contents.
4
 
# Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc.
 
5
# Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc.
5
6
#
6
7
# GRUB is free software: you can redistribute it and/or modify
7
8
# it under the terms of the GNU General Public License as published by
86
87
        usage
87
88
        exit 1
88
89
        ;;
89
 
    *)
90
 
        echo "Invalid parameter, $option" 1>&2
91
 
        exit 1
92
 
        ;;
 
90
    # Explicitly ignore non-option arguments, for compatibility.
93
91
    esac
94
92
done
95
93
 
99
97
netbsd* | openbsd*)
100
98
    # Because /boot is used for the boot block in NetBSD and OpenBSD, use /grub
101
99
    # instead of /boot/grub.
102
 
    grub_prefix=`echo /grub | sed ${transform}`
 
100
    GRUB_PREFIX=`echo /grub | sed ${transform}`
103
101
    ;;
104
102
*)
105
103
    # Use /boot/grub by default.
106
 
    grub_prefix=`echo /boot/grub | sed ${transform}`
 
104
    GRUB_PREFIX=`echo /boot/grub | sed ${transform}`
107
105
    ;;
108
106
esac
109
107
 
144
142
    exit 1
145
143
fi
146
144
 
147
 
mkdir -p ${grub_prefix}
 
145
mkdir -p ${GRUB_PREFIX}
148
146
 
149
 
if test -e ${grub_prefix}/device.map ; then : ; else
 
147
if test -e ${GRUB_PREFIX}/device.map ; then : ; else
150
148
  ${grub_mkdevicemap}
151
149
fi
152
150
 
181
179
for x in ${GRUB_TERMINAL_OUTPUT}; do
182
180
    if [ "x${x}" = "xgfxterm" ]; then
183
181
        # If this platform supports gfxterm, try to use it.
184
 
        if ! test -e ${grub_prefix}/gfxterm.mod ; then
 
182
        if ! test -e ${GRUB_PREFIX}/gfxterm.mod ; then
185
183
            if [ "x$termoutdefault" != "x1" ]; then
186
184
                echo "gfxterm isn't available on your platform" >&2 ; exit 1
187
185
            fi
188
186
            GRUB_TERMINAL_OUTPUT=
189
187
            break;
190
188
        fi
191
 
        # FIXME: this should do something smarter than just loading first
192
 
        # video backend.
193
 
        GRUB_VIDEO_BACKEND=$(head -n 1 ${grub_prefix}/video.lst || true)
194
 
        if [ -z "${GRUB_VIDEO_BACKEND}" ] ; then
 
189
        if [ ! -s "${GRUB_PREFIX}/video.lst" ] ; then
195
190
            if [ "x$termoutdefault" != "x1" ]; then
196
191
                echo "No suitable backend could be found for gfxterm." >&2 ; exit 1
197
192
            fi
249
244
  GRUB_FS \
250
245
  GRUB_FONT_PATH \
251
246
  GRUB_PRELOAD_MODULES \
252
 
  GRUB_VIDEO_BACKEND
 
247
  GRUB_PREFIX
253
248
 
254
249
# These are optional, user-defined variables.
255
250
export GRUB_DEFAULT \
263
258
  GRUB_DISTRIBUTOR \
264
259
  GRUB_CMDLINE_LINUX \
265
260
  GRUB_CMDLINE_LINUX_DEFAULT \
 
261
  GRUB_CMDLINE_XEN \
 
262
  GRUB_CMDLINE_XEN_DEFAULT \
266
263
  GRUB_CMDLINE_NETBSD \
267
264
  GRUB_CMDLINE_NETBSD_DEFAULT \
268
265
  GRUB_TERMINAL_INPUT \
271
268
  GRUB_DISABLE_LINUX_UUID \
272
269
  GRUB_DISABLE_LINUX_RECOVERY \
273
270
  GRUB_DISABLE_NETBSD_RECOVERY \
 
271
  GRUB_VIDEO_BACKEND \
274
272
  GRUB_GFXMODE \
275
273
  GRUB_BACKGROUND \
276
274
  GRUB_THEME \
277
275
  GRUB_GFXPAYLOAD_LINUX \
278
276
  GRUB_DISABLE_OS_PROBER \
279
277
  GRUB_INIT_TUNE \
280
 
  GRUB_SAVEDEFAULT
 
278
  GRUB_SAVEDEFAULT \
 
279
  GRUB_BADRAM
281
280
 
282
281
if test "x${grub_cfg}" != "x"; then
283
282
  rm -f ${grub_cfg}.new