--- /etc/grub.d/00_header.orig 2010-11-23 15:38:26.000000000 -0600 +++ /etc/grub.d/00_header 2011-02-04 01:23:02.000000000 -0600 @@ -64,37 +64,30 @@ function recordfail { } EOF -case ${GRUB_TERMINAL_INPUT}:${GRUB_TERMINAL_OUTPUT} in - serial:* | *:serial) +serial=0; +gfxterm=0; +for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do + if [ xserial = "x$x" ]; then + serial=1; + fi + if [ xgfxterm = "x$x" ]; then + gfxterm=1; + fi +done + +if [ "x$serial" = x1 ]; then if ! test -e ${grub_prefix}/serial.mod ; then - echo "Serial terminal not available on this platform." >&2 ; exit 1 + echo "Serial terminal not available on this platform." >&2 ; exit 1 fi if [ "x${GRUB_SERIAL_COMMAND}" = "x" ] ; then - grub_warn "Requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used." - GRUB_SERIAL_COMMAND=serial + grub_warn "Requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used." + GRUB_SERIAL_COMMAND=serial fi echo "${GRUB_SERIAL_COMMAND}" - ;; -esac - -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 - xgfxterm) +if [ "x$gfxterm" = x1 ]; then # Make the font accessible prepare_grub_to_access_device `${grub_probe} --target=device ${GRUB_FONT_PATH}` @@ -103,26 +96,37 @@ if loadfont `make_system_path_relative_t set gfxmode=${GRUB_GFXMODE} insmod gfxterm insmod ${GRUB_VIDEO_BACKEND} - if terminal_output gfxterm ; then true ; else - # For backward compatibility with versions of terminal.mod that don't - # understand terminal_output - terminal gfxterm - fi EOF -if [ x$GRUB_THEME != x ] && [ -f $GRUB_THEME ] \ + 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 + echo "Found theme: $GRUB_THEME" >&2 + prepare_grub_to_access_device `${grub_probe} --target=device $GRUB_THEME` | sed -e "s/^/ /" + cat << EOF insmod gfxmenu set theme=(\$root)`make_system_path_relative_to_its_root $GRUB_THEME` - set menuviewer=gfxmenu 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 ;;