* 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:
parent
75d959ea7c
commit
c8c069533f
2 changed files with 58 additions and 51 deletions
|
@ -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.
|
||||||
|
|
|
@ -127,57 +127,6 @@ 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
|
||||||
EOF
|
|
||||||
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/^/ /"
|
|
||||||
cat << EOF
|
|
||||||
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`
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
if [ x"`echo "$themedir"/*.jpg`" != x"$themedir/*.jpg" ] || [ x"`echo "$themedir"/*.jpeg`" != x"$themedir/*.jpeg" ]; then
|
|
||||||
cat << EOF
|
|
||||||
insmod jpeg
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
if [ x"`echo "$themedir"/*.png`" != x"$themedir/*.png" ]; then
|
|
||||||
cat << EOF
|
|
||||||
insmod png
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
if [ x"`echo "$themedir"/*.tga`" != x"$themedir/*.tga" ]; then
|
|
||||||
cat << EOF
|
|
||||||
insmod tga
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat << EOF
|
|
||||||
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
|
|
||||||
echo "Found background: $GRUB_BACKGROUND" >&2
|
|
||||||
case "$GRUB_BACKGROUND" in
|
|
||||||
*.png) reader=png ;;
|
|
||||||
*.tga) reader=tga ;;
|
|
||||||
*.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/^/ /"
|
|
||||||
cat << EOF
|
|
||||||
insmod $reader
|
|
||||||
background_image -m stretch `make_system_path_relative_to_its_root "$GRUB_BACKGROUND"`
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
cat << EOF
|
|
||||||
fi
|
fi
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
@ -212,6 +161,58 @@ EOF
|
||||||
;;
|
;;
|
||||||
esac
|
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"`
|
||||||
|
cat << EOF
|
||||||
|
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`
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ x"`echo "$themedir"/*.jpg`" != x"$themedir/*.jpg" ] || [ x"`echo "$themedir"/*.jpeg`" != x"$themedir/*.jpeg" ]; then
|
||||||
|
cat << EOF
|
||||||
|
insmod jpeg
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
if [ x"`echo "$themedir"/*.png`" != x"$themedir/*.png" ]; then
|
||||||
|
cat << EOF
|
||||||
|
insmod png
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
if [ x"`echo "$themedir"/*.tga`" != x"$themedir/*.tga" ]; then
|
||||||
|
cat << EOF
|
||||||
|
insmod tga
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat << EOF
|
||||||
|
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
|
||||||
|
echo "Found background: $GRUB_BACKGROUND" >&2
|
||||||
|
case "$GRUB_BACKGROUND" in
|
||||||
|
*.png) reader=png ;;
|
||||||
|
*.tga) reader=tga ;;
|
||||||
|
*.jpg|*.jpeg) reader=jpeg ;;
|
||||||
|
*) echo "Unsupported image format" >&2; exit 1 ;;
|
||||||
|
esac
|
||||||
|
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"`
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Gettext variables and module
|
# Gettext variables and module
|
||||||
if [ "x${LANG}" != "xC" ] && [ -d "${locale_dir}" ] ; then
|
if [ "x${LANG}" != "xC" ] && [ -d "${locale_dir}" ] ; then
|
||||||
prepare_grub_to_access_device $(${grub_probe} --target=device ${locale_dir})
|
prepare_grub_to_access_device $(${grub_probe} --target=device ${locale_dir})
|
||||||
|
|
Loading…
Reference in a new issue