From: Colin Watson Date: Tue, 6 Jul 2010 08:42:37 +0000 (+0100) Subject: * util/grub.d/00_header.in: Process GRUB_THEME and GRUB_BACKGROUND X-Git-Tag: 1.99~748 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c8c069533f5c240855f292f7f77b3c784c5f7946;p=thirdparty%2Fgrub.git * 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. --- diff --git a/ChangeLog b/ChangeLog index 81dfc1c78..108379321 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-07-06 Colin Watson + + * 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 * docs/grub.texi (Features): Update list of supported file systems. diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index 553369e37..75c8b0fa2 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -127,40 +127,74 @@ if loadfont `make_system_path_relative_to_its_root "${GRUB_FONT_PATH}"` ; then set gfxmode=${GRUB_GFXMODE} load_video insmod gfxterm +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 + +if [ "x$gfxterm" = x1 ]; then if [ "x$GRUB_THEME" != x ] && [ -f "$GRUB_THEME" ] \ && is_path_readable_by_grub "$GRUB_THEME"; then 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 - insmod gfxmenu +insmod gfxmenu EOF themedir="`dirname "$GRUB_THEME"`" for x in "$themedir"/*.pf2 "$themedir"/f/*.pf2; do if [ -f "$x" ]; then cat << EOF - loadfont (\$root)`make_system_path_relative_to_its_root $x` +loadfont (\$root)`make_system_path_relative_to_its_root $x` EOF fi done if [ x"`echo "$themedir"/*.jpg`" != x"$themedir/*.jpg" ] || [ x"`echo "$themedir"/*.jpeg`" != x"$themedir/*.jpeg" ]; then cat << EOF - insmod jpeg +insmod jpeg EOF fi if [ x"`echo "$themedir"/*.png`" != x"$themedir/*.png" ]; then cat << EOF - insmod png +insmod png EOF fi if [ x"`echo "$themedir"/*.tga`" != x"$themedir/*.tga" ]; then cat << EOF - insmod tga +insmod tga EOF fi cat << EOF - set theme=(\$root)`make_system_path_relative_to_its_root $GRUB_THEME` +set theme=(\$root)`make_system_path_relative_to_its_root $GRUB_THEME` EOF elif [ "x$GRUB_BACKGROUND" != x ] && [ -f "$GRUB_BACKGROUND" ] \ && is_path_readable_by_grub "$GRUB_BACKGROUND"; then @@ -171,47 +205,14 @@ EOF *.jpg|*.jpeg) reader=jpeg ;; *) echo "Unsupported image format" >&2; exit 1 ;; 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 - insmod $reader - background_image -m stretch `make_system_path_relative_to_its_root "$GRUB_BACKGROUND"` +insmod $reader +background_image -m stretch `make_system_path_relative_to_its_root "$GRUB_BACKGROUND"` EOF fi - cat << EOF -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 if [ "x${LANG}" != "xC" ] && [ -d "${locale_dir}" ] ; then prepare_grub_to_access_device $(${grub_probe} --target=device ${locale_dir})