Bug#506707: patch

Jeff Clark dude at zaplabs.com
Sat Feb 20 01:46:21 UTC 2010


Package: grub-common
Version: 1.98~20100128-1.2
Severity: normal

patches attached to support multiple terminals (simultaneous serial and console) configuration.  Correctly adds 'terminal console serial' to grub.cfg when GRUB_TERMINAL is set to 'serial console' in /etc/defaults/grub.


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-trunk-686-bigmem (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages grub-common depends on:
ii  base-files              5.1              Debian base system miscellaneous f
ii  dpkg                    1.15.5.6         Debian package management system
ii  gettext-base            0.17-9           GNU Internationalization utilities
ii  install-info            4.13a.dfsg.1-5   Manage installed documentation in 
ii  libc6                   2.10.2-5         Embedded GNU C Library: Shared lib
ii  libfreetype6            2.3.11-1         FreeType 2 font engine, shared lib
ii  zlib1g                  1:1.2.3.4.dfsg-3 compression library - runtime

Versions of packages grub-common recommends:
ii  os-prober                     1.35       utility to detect other OSes on a 

Versions of packages grub-common suggests:
pn  grub-emu                      <none>     (no description available)
pn  multiboot-doc                 <none>     (no description available)

-- no debconf information
-------------- next part --------------
--- /etc/grub.d/00_header.old	2010-02-14 13:56:02.000000000 -0600
+++ /etc/grub.d/00_header	2010-02-19 18:51:39.000000000 -0600
@@ -59,19 +59,21 @@
 }
 EOF
 
-case ${GRUB_TERMINAL_INPUT}:${GRUB_TERMINAL_OUTPUT} in
-  serial:* | *:serial)
-    if ! test -e ${grub_prefix}/serial.mod ; then
-      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
-    fi
-    echo "${GRUB_SERIAL_COMMAND}"
-  ;;
-esac
+for GRUB_TERMINAL in ${GRUB_TERMINAL_INPUT} ${GRUB_SERIAL_OUTPUT}; do
+  case ${GRUB_TERMINAL} in
+    serial)
+      if ! test -e ${grub_prefix}/serial.mod ; then
+        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
+      fi
+      echo "${GRUB_SERIAL_COMMAND}"
+    ;;
+  esac
+done
 
 case x${GRUB_TERMINAL_INPUT} in
   x)
-------------- next part --------------
--- /usr/sbin/grub-mkconfig.old	2010-02-14 13:56:02.000000000 -0600
+++ /usr/sbin/grub-mkconfig	2010-02-19 18:57:00.000000000 -0600
@@ -140,60 +140,62 @@
   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
+for GRUB_TERMINAL in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do
+  case x${GRUB_TERMINAL} 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}" = "gfxterm" ] ; then
+          echo "No suitable backend could be found for gfxterm." >&2 ; exit 1
+        fi
       fi
-    fi
-  ;;
-  xconsole | xserial | xofconsole) ;;
-  *) echo "Invalid output terminal \"${GRUB_TERMINAL_OUTPUT}\"" >&2 ; exit 1 ;;
-esac
-
-# 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}
-	else
-	  echo "No such font or not readable by grub: ${GRUB_FONT}" >&2
-	  exit 1
-	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
+    ;;
+    xconsole | xserial | xofconsole) ;;
+    *) echo "Invalid input terminal \"${GRUB_TERMINAL}\"" >&2 ; exit 1 ;;
+  esac
+
+  # check for terminals that require fonts
+  case ${GRUB_TERMINAL} in
+    gfxterm)
+      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
+        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
-      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
+      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
 
 # These are defined in this script, export them here so that user can
 # override them.


More information about the Pkg-grub-devel mailing list