commit-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[1765] 2008-08-03 Robert Millan <address@hidden>


From: Robert Millan
Subject: [1765] 2008-08-03 Robert Millan <address@hidden>
Date: Sun, 03 Aug 2008 16:38:41 +0000

Revision: 1765
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=1765
Author:   robertmh
Date:     2008-08-03 16:38:40 +0000 (Sun, 03 Aug 2008)

Log Message:
-----------
2008-08-03  Robert Millan  <address@hidden>

        * util/grub.d/00_header.in: Be platform-agnostic.  Probe for existence
        of modules instead of assuming which platform provides what.
        * util/update-grub.in: Likewise.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/util/grub.d/00_header.in
    trunk/grub2/util/update-grub.in

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog       2008-08-02 23:24:34 UTC (rev 1764)
+++ trunk/grub2/ChangeLog       2008-08-03 16:38:40 UTC (rev 1765)
@@ -1,5 +1,11 @@
 2008-08-03  Robert Millan  <address@hidden>
 
+       * util/grub.d/00_header.in: Be platform-agnostic.  Probe for existence
+       of modules instead of assuming which platform provides what.
+       * util/update-grub.in: Likewise.
+
+2008-08-03  Robert Millan  <address@hidden>
+
        * kern/i386/pc/init.c (make_install_device): Check for `grub_prefix'
        instead of `grub_install_dos_part' to determine whether a drive needs
        to be prepended to prefix (`grub_install_dos_part' is not reliable,

Modified: trunk/grub2/util/grub.d/00_header.in
===================================================================
--- trunk/grub2/util/grub.d/00_header.in        2008-08-02 23:24:34 UTC (rev 
1764)
+++ trunk/grub2/util/grub.d/00_header.in        2008-08-03 16:38:40 UTC (rev 
1765)
@@ -16,10 +16,12 @@
 # You should have received a copy of the GNU General Public License
 # along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
 
+transform="@program_transform_name@"
+
 address@hidden@
 address@hidden@
 address@hidden@
address@hidden@
+grub_prefix=`echo /boot/grub | sed ${transform}`
 
 . ${libdir}/grub/update-grub_lib
 
@@ -37,20 +39,37 @@
 set timeout=${GRUB_TIMEOUT}
 EOF
 
-case ${platform}:${GRUB_TERMINAL} in
-  pc:gfxterm)
+case x${GRUB_TERMINAL} in
+  xgfxterm)
     # Make the font accessible
     prepare_grub_to_access_device `${grub_probe} --target=device 
${GRUB_FONT_PATH}`
+
+    # Pick a video backend
+    video_backend=
+    for i in vbe ; do
+      if test -e ${grub_prefix}/$i.mod ; then
+        video_backend=$i
+        break
+      fi
+    done
+    if ! [ "${video_backend}" ] ; then
+      echo "No suitable backend could be found for gfxterm." >&2 ; exit 1
+    fi
+
     cat << EOF
 if font `make_system_path_relative_to_its_root ${GRUB_FONT_PATH}` ; then
   set gfxmode=640x480
   insmod gfxterm
-  insmod vbe
+  insmod ${video_backend}
   terminal gfxterm
 fi
 EOF
   ;;
-  *:serial)
+  xserial)
+    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
       echo "Warning, requested serial terminal but GRUB_SERIAL_COMMAND is 
unspecified. Default parameters will be used." >&2
       GRUB_SERIAL_COMMAND=serial
@@ -58,7 +77,10 @@
     echo "${GRUB_SERIAL_COMMAND}"
     echo "terminal serial"
   ;;
-  *:*)
+  x)
+    # Just use the native terminal
+  ;;
+  x*)
     echo "terminal ${GRUB_TERMINAL}"
   ;;
 esac

Modified: trunk/grub2/util/update-grub.in
===================================================================
--- trunk/grub2/util/update-grub.in     2008-08-02 23:24:34 UTC (rev 1764)
+++ trunk/grub2/util/update-grub.in     2008-08-03 16:38:40 UTC (rev 1765)
@@ -26,7 +26,6 @@
 grub_prefix=`echo /boot/grub | sed ${transform}`
 grub_cfg=${grub_prefix}/grub.cfg
 update_grub_dir=${sysconfdir}/grub.d
address@hidden@
 
 grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`
 grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
@@ -127,15 +126,15 @@
   . ${sysconfdir}/default/grub
 fi
 
-# if ${GRUB_TERMINAL} is set, check it has a sane value.  if undefined,
-# fallback to our default
-case ${platform}:${GRUB_TERMINAL} in
-  pc:)                         GRUB_TERMINAL=gfxterm ;;
-  ieee1275:)                   GRUB_TERMINAL=ofconsole ;;
-  *:)                          GRUB_TERMINAL=console ;;
-  pc:console | pc:serial | ieee1275:ofconsole | ieee1275:console | *:gfxterm)
-                               ;;
-  *:*)                         echo "Invalid terminal \"${GRUB_TERMINAL}\"" 
>&2 ; exit 1 ;;
+case x${GRUB_TERMINAL} in
+  x)
+    # If this platform supports gfxterm, try to use it.
+    if test -e ${grub_prefix}/gfxterm.mod ; then
+      GRUB_TERMINAL=gfxterm
+    fi
+  ;;
+  xconsole | xserial | xofconsole | xgfxterm) ;;
+  *) echo "Invalid terminal \"${GRUB_TERMINAL}\"" >&2 ; exit 1 ;;
 esac
 
 # check for terminals that require fonts
@@ -144,16 +143,16 @@
     if path=`font_path` ; then
       GRUB_FONT_PATH="${path}"
     else
-      # fallback to console
-      GRUB_TERMINAL=console
+      # fallback to the native terminal for this platform
+      unset GRUB_TERMINAL
     fi
   ;;
 esac
 
 # does our terminal support utf-8 ?
-case ${platform}:${GRUB_TERMINAL} in
-  *:gfxterm) ;;
-  *:*)
+case ${GRUB_TERMINAL} in
+  gfxterm) ;;
+  *)
     # make sure all our children behave in conformance with ascii..
     export LANG=C
   ;;






reply via email to

[Prev in Thread] Current Thread [Next in Thread]