* util/grub.d/00_header.in: Process GRUB_THEME and GRUB_BACKGROUND

after setting gfxterm as the active terminal.  GRUB_BACKGROUND
doesn't work otherwise.
This commit is contained in:
Colin Watson 2010-07-06 09:42:37 +01:00
parent 75d959ea7c
commit c8c069533f
2 changed files with 58 additions and 51 deletions

View file

@ -1,3 +1,9 @@
2010-07-06 Colin Watson <cjwatson@ubuntu.com>
* util/grub.d/00_header.in: Process GRUB_THEME and GRUB_BACKGROUND
after setting gfxterm as the active terminal. GRUB_BACKGROUND
doesn't work otherwise.
2010-07-05 Colin Watson <cjwatson@ubuntu.com> 2010-07-05 Colin Watson <cjwatson@ubuntu.com>
* docs/grub.texi (Features): Update list of supported file systems. * docs/grub.texi (Features): Update list of supported file systems.

View file

@ -127,11 +127,45 @@ if loadfont `make_system_path_relative_to_its_root "${GRUB_FONT_PATH}"` ; then
set gfxmode=${GRUB_GFXMODE} set gfxmode=${GRUB_GFXMODE}
load_video load_video
insmod gfxterm insmod gfxterm
fi
EOF EOF
fi
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
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
if [ "x$gfxterm" = x1 ]; then
if [ "x$GRUB_THEME" != x ] && [ -f "$GRUB_THEME" ] \ if [ "x$GRUB_THEME" != x ] && [ -f "$GRUB_THEME" ] \
&& is_path_readable_by_grub "$GRUB_THEME"; then && is_path_readable_by_grub "$GRUB_THEME"; then
echo "Found theme: $GRUB_THEME" >&2 echo "Found theme: $GRUB_THEME" >&2
prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_THEME"` | sed -e "s/^/ /" prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_THEME"`
cat << EOF cat << EOF
insmod gfxmenu insmod gfxmenu
EOF EOF
@ -171,46 +205,13 @@ EOF
*.jpg|*.jpeg) reader=jpeg ;; *.jpg|*.jpeg) reader=jpeg ;;
*) echo "Unsupported image format" >&2; exit 1 ;; *) echo "Unsupported image format" >&2; exit 1 ;;
esac esac
prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_BACKGROUND"` | sed -e "s/^/ /" prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_BACKGROUND"`
cat << EOF cat << EOF
insmod $reader insmod $reader
background_image -m stretch `make_system_path_relative_to_its_root "$GRUB_BACKGROUND"` background_image -m stretch `make_system_path_relative_to_its_root "$GRUB_BACKGROUND"`
EOF EOF
fi fi
cat << EOF
fi fi
EOF
fi
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
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 # Gettext variables and module
if [ "x${LANG}" != "xC" ] && [ -d "${locale_dir}" ] ; then if [ "x${LANG}" != "xC" ] && [ -d "${locale_dir}" ] ; then