143
139
case x${GRUB_TERMINAL_OUTPUT} in
145
141
# If this platform supports gfxterm, try to use it.
146
142
if test -e ${grub_prefix}/gfxterm.mod ; then
149
if test -e ${grub_prefix}/$i.mod ; then
150
GRUB_VIDEO_BACKEND=$i
154
if [ -n "${GRUB_VIDEO_BACKEND}" ] ; then
155
GRUB_TERMINAL_OUTPUT=gfxterm
156
elif [ "${GRUB_TERMINAL_OUTPUT}" = "gfxterm" ] ; then
157
echo "No suitable backend could be found for gfxterm." >&2 ; exit 1
143
GRUB_TERMINAL_OUTPUT=gfxterm
161
xconsole | xserial | xofconsole) ;;
146
xconsole | xserial | xofconsole | xgfxterm) ;;
162
147
*) echo "Invalid output terminal \"${GRUB_TERMINAL_OUTPUT}\"" >&2 ; exit 1 ;;
165
150
# check for terminals that require fonts
166
151
case ${GRUB_TERMINAL_OUTPUT} in
168
if [ -n "$GRUB_FONT" ] ; then
169
if is_path_readable_by_grub ${GRUB_FONT} > /dev/null ; then
170
GRUB_FONT_PATH=${GRUB_FONT}
172
echo "No such font or not readable by grub: ${GRUB_FONT}" >&2
153
if path=`font_path` ; then
154
GRUB_FONT_PATH="${path}"
176
for dir in ${pkgdatadir} /boot/grub /usr/share/grub ; do
177
for basename in unicode unifont ascii; do
178
path="${dir}/${basename}.pf2"
179
if is_path_readable_by_grub ${path} > /dev/null ; then
180
GRUB_FONT_PATH=${path}
184
if [ "${basename}" = "ascii" ] ; then
185
# make sure all our children behave in conformance with ascii..
192
if [ -z "${GRUB_FONT_PATH}" ] ; then
193
156
# fallback to the native terminal for this platform
194
157
unset GRUB_TERMINAL_OUTPUT
162
# does our terminal support utf-8 ?
163
case ${GRUB_TERMINAL_OUTPUT} in
198
166
# make sure all our children behave in conformance with ascii..
202
171
# These are defined in this script, export them here so that user can
207
GRUB_DEVICE_BOOT_UUID \
210
GRUB_PRELOAD_MODULES \
173
export GRUB_DEVICE GRUB_DEVICE_UUID GRUB_DEVICE_BOOT GRUB_DEVICE_BOOT_UUID GRUB_FS GRUB_FONT_PATH GRUB_PRELOAD_MODULES
213
175
# These are optional, user-defined variables.
214
export GRUB_DEFAULT \
215
GRUB_HIDDEN_TIMEOUT \
216
GRUB_HIDDEN_TIMEOUT_QUIET \
220
GRUB_CMDLINE_LINUX_DEFAULT \
221
GRUB_TERMINAL_INPUT \
222
GRUB_TERMINAL_OUTPUT \
223
GRUB_SERIAL_COMMAND \
224
GRUB_DISABLE_LINUX_UUID \
225
GRUB_DISABLE_LINUX_RECOVERY \
227
GRUB_DISABLE_OS_PROBER
176
export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL_INPUT GRUB_TERMINAL_OUTPUT GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID GRUB_DISABLE_LINUX_RECOVERY GRUB_GFXMODE
229
178
if test "x${grub_cfg}" != "x"; then
230
179
rm -f ${grub_cfg}.new
233
182
# Allow this to fail, since /boot/grub/ might need to be fatfs to support some
234
183
# firmware implementations (e.g. OFW or EFI).
235
chmod 400 ${grub_cfg}.new || grub_warn "Could not make ${grub_cfg}.new readable by only root.\
236
This means that if the generated config contains a password it is readable by everyone"
184
chmod 444 ${grub_cfg}.new || true
238
186
echo "Generating grub.cfg ..." >&2