diff -urNpd grub2-1.98/debian/changelog grub2-1.98.new/debian/changelog --- grub2-1.98/debian/changelog 2011-02-05 06:21:26.000000000 +0000 +++ grub2-1.98.new/debian/changelog 2011-02-05 06:13:46.000000000 +0000 @@ -1,3 +1,10 @@ +grub2 (1.98-1ubuntu10.1) lucid-proposed; urgency=low + + * Allow GRUB_TERMINAL="console serial" without grub-mkconfig returning + Invalid output terminal "console serial" (LP: #490451). + + -- Corey Wright Sat, 05 Feb 2011 00:03:37 -0600 + grub2 (1.98-1ubuntu10) lucid-proposed; urgency=low * If we're upgrading and /boot/grub/core.img doesn't exist, then don't ask diff -urNpd grub2-1.98/debian/patches/978_serial_and_console.diff grub2-1.98.new/debian/patches/978_serial_and_console.diff --- grub2-1.98/debian/patches/978_serial_and_console.diff 1970-01-01 00:00:00.000000000 +0000 +++ grub2-1.98.new/debian/patches/978_serial_and_console.diff 2011-02-05 06:12:34.000000000 +0000 @@ -0,0 +1,236 @@ +keyphrase: Invalid output terminal "serial console" +bug: https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/490451 +patch: http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/2298 + +diff -urNpd grub2-1.98.orig/util/grub-mkconfig.in grub2-1.98/util/grub-mkconfig.in +--- grub2-1.98.orig/util/grub-mkconfig.in 2010-03-06 20:51:37.000000000 +0000 ++++ grub2-1.98/util/grub-mkconfig.in 2011-02-05 05:58:26.000000000 +0000 +@@ -140,60 +140,73 @@ if [ "x${GRUB_TERMINAL}" != "x" ] ; then + GRUB_TERMINAL_OUTPUT="${GRUB_TERMINAL}" + fi + +-case x${GRUB_TERMINAL_OUTPUT} in +- x | xgfxterm) +- # If this platform supports gfxterm, try to use it. +- if test -e ${grub_prefix}/gfxterm.mod ; then +- # FIXME: this should do something smarter than just loading first +- # video backend. +- GRUB_VIDEO_BACKEND=$(head -n 1 ${grub_prefix}/video.lst || true) +- if [ -n "${GRUB_VIDEO_BACKEND}" ] ; then +- GRUB_TERMINAL_OUTPUT=gfxterm +- elif [ "${GRUB_TERMINAL_OUTPUT}" = "gfxterm" ] ; then +- echo "No suitable backend could be found for gfxterm." >&2 ; exit 1 +- fi +- fi +- ;; +- xconsole | xserial | xofconsole) ;; +- *) echo "Invalid output terminal \"${GRUB_TERMINAL_OUTPUT}\"" >&2 ; exit 1 ;; +-esac ++termoutdefault=0 ++if [ "x${GRUB_TERMINAL_OUTPUT}" = "x" ]; then ++ GRUB_TERMINAL_OUTPUT=gfxterm; ++ termoutdefault=1; ++fi + +-# check for terminals that require fonts +-case ${GRUB_TERMINAL_OUTPUT} in +- gfxterm) +- if [ -n "$GRUB_FONT" ] ; then +- if is_path_readable_by_grub ${GRUB_FONT} > /dev/null ; then +- GRUB_FONT_PATH=${GRUB_FONT} ++for x in ${GRUB_TERMINAL_OUTPUT}; do ++ if [ "x${x}" = "xgfxterm" ]; then ++ # If this platform supports gfxterm, try to use it. ++ if ! test -e ${grub_prefix}/gfxterm.mod ; then ++ if [ "x$termoutdefault" != "x1" ]; then ++ echo "gfxterm isn't available on your platform" >&2 ; exit 1 ++ fi ++ GRUB_TERMINAL_OUTPUT= ++ break; ++ fi ++ # FIXME: this should do something smarter than just loading first ++ # video backend. ++ GRUB_VIDEO_BACKEND=$(head -n 1 ${grub_prefix}/video.lst || true) ++ if [ -z "${GRUB_VIDEO_BACKEND}" ] ; then ++ if [ "x$termoutdefault" != "x1" ]; then ++ echo "No suitable backend could be found for gfxterm." >&2 ; exit 1 ++ fi ++ GRUB_TERMINAL_OUTPUT= ++ fi ++ if [ -n "$GRUB_FONT" ] ; then ++ if is_path_readable_by_grub ${GRUB_FONT} > /dev/null ; then ++ GRUB_FONT_PATH=${GRUB_FONT} ++ else ++ echo "No such font or not readable by grub: ${GRUB_FONT}" >&2 ++ exit 1 ++ fi + else +- echo "No such font or not readable by grub: ${GRUB_FONT}" >&2 +- exit 1 ++ for dir in ${pkgdatadir} /boot/grub /usr/share/grub ; do ++ for basename in unicode unifont ascii; do ++ path="${dir}/${basename}.pf2" ++ if is_path_readable_by_grub ${path} > /dev/null ; then ++ GRUB_FONT_PATH=${path} ++ else ++ continue ++ fi ++ if [ "${basename}" = "ascii" ] ; then ++ # make sure all our children behave in conformance with ascii.. ++ export LANG=C ++ fi ++ break 2 ++ done ++ done ++ fi ++ if [ -z "${GRUB_FONT_PATH}" ] ; then ++ if [ "x$termoutdefault" != "x1" ]; then ++ echo "No font for gfxterm found." >&2 ; exit 1 ++ fi ++ GRUB_TERMINAL_OUTPUT= + fi +- else +- for dir in ${pkgdatadir} /boot/grub /usr/share/grub ; do +- for basename in unicode unifont ascii; do +- path="${dir}/${basename}.pf2" +- if is_path_readable_by_grub ${path} > /dev/null ; then +- GRUB_FONT_PATH=${path} +- else +- continue +- fi +- if [ "${basename}" = "ascii" ] ; then +- # make sure all our children behave in conformance with ascii.. +- export LANG=C +- fi +- break 2 +- done +- done +- fi +- if [ -z "${GRUB_FONT_PATH}" ] ; then +- # fallback to the native terminal for this platform +- unset GRUB_TERMINAL_OUTPUT + fi +- ;; +- *) +- # make sure all our children behave in conformance with ascii.. +- export LANG=C +-esac ++done ++ ++for x in ${GRUB_TERMINAL_OUTPUT}; do ++ case "x${x}" in ++ xgfxterm) ;; ++ xconsole | xserial | xofconsole) ++ # make sure all our children behave in conformance with ascii.. ++ export LANG=C;; ++ *) echo "Invalid output terminal \"${GRUB_TERMINAL_OUTPUT}\"" >&2 ; exit 1 ;; ++ esac ++done + + # These are defined in this script, export them here so that user can + # override them. +diff -urNpd grub2-1.98.orig/util/grub.d/00_header.in grub2-1.98/util/grub.d/00_header.in +--- grub2-1.98.orig/util/grub.d/00_header.in 2010-03-06 20:51:37.000000000 +0000 ++++ grub2-1.98/util/grub.d/00_header.in 2011-02-05 05:58:13.000000000 +0000 +@@ -59,37 +59,30 @@ function savedefault { + } + 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}` + +@@ -98,26 +91,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 + ;;