]> git.proxmox.com Git - grub2.git/commitdiff
2008-05-30 Robert Millan <rmh@aybabtu.com>
authorrobertmh <robertmh@localhost>
Fri, 30 May 2008 14:39:44 +0000 (14:39 +0000)
committerrobertmh <robertmh@localhost>
Fri, 30 May 2008 14:39:44 +0000 (14:39 +0000)
        * util/update-grub_lib.in (prepare_grub_to_access_device): New function.
        * util/update-grub.in: Set `GRUB_FONT_PATH' to the system path, without
        converting it first.
        * util/grub.d/00_header.in: Use prepare_grub_to_access_device() to setup
        grub.cfg for access to font file, and afterwards call it again to set
        the root device.

ChangeLog
util/grub.d/00_header.in
util/update-grub.in
util/update-grub_lib.in

index 2c1b5e3f24a9058a4c9e14cecf7690e32c2d434f..b35a5be2bca4c6c3a649f097061f31c75bf782ec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-05-30  Robert Millan  <rmh@aybabtu.com>
+
+       * util/update-grub_lib.in (prepare_grub_to_access_device): New function.
+       * util/update-grub.in: Set `GRUB_FONT_PATH' to the system path, without
+       converting it first.
+       * util/grub.d/00_header.in: Use prepare_grub_to_access_device() to setup
+       grub.cfg for access to font file, and afterwards call it again to set
+       the root device.
+
 2008-05-30  Robert Millan  <rmh@aybabtu.com>
 
        * commands/search.c (options): Add --fs_uuid option.
index ab13939f236f78265be1307fbbd0f7e5e4d6365e..9087b000394b2163c8651fced74182dbd45d8d3a 100644 (file)
@@ -38,17 +38,12 @@ set default=${GRUB_DEFAULT}
 set timeout=${GRUB_TIMEOUT}
 EOF
 
-# If there's a filesystem UUID that GRUB is capable of identifiing, use it;
-# otherwise set root as per value in device.map.
-if [ "x${GRUB_DEVICE_BOOT_UUID}" = "x" ] ; then
-  echo "set root=`grub-probe --device ${GRUB_DEVICE_BOOT} --target=drive`"
-else
-  echo "search --fs_uuid ${GRUB_DEVICE_BOOT_UUID} --set"
-fi
-
 case ${platform}:${GRUB_TERMINAL} in
-  pc:gfxterm) cat << EOF
-if font ${GRUB_FONT_PATH} ; then
+  pc:gfxterm)
+    # Make the font accessible
+    prepare_grub_to_access_device `${grub_probe} --target=device ${GRUB_FONT_PATH}`
+    cat << EOF
+if font `make_system_path_relative_to_its_root ${GRUB_FONT_PATH}` ; then
   set gfxmode=640x480
   insmod gfxterm
   insmod vbe
@@ -68,3 +63,6 @@ EOF
     echo "terminal ${GRUB_TERMINAL}"
   ;;
 esac
+
+# Set the root device.
+prepare_grub_to_access_device ${GRUB_DEVICE_BOOT}
index 164396581d911aa0cd338fa75df9fe084d75aece..887ef19bce9a2504470e6c00986903ef671d8aa0 100644 (file)
@@ -131,8 +131,7 @@ esac
 case ${GRUB_TERMINAL} in
   gfxterm)
     if path=`font_path` ; then
-      GRUB_FONT_PATH="`convert_system_path_to_grub_path ${path}`"
-      GRUB_PRELOAD_MODULES="${GRUB_PRELOAD_MODULES} `${grub_probe} -t abstraction ${path}`"
+      GRUB_FONT_PATH="${path}"
     else
       # fallback to console
       GRUB_TERMINAL=console
index 2d7092b1bc7f8c49357dd84a6ab2a0b5e7feef94..d7be39d5e89b59dd9e8314155bcb21120b7235f5 100644 (file)
@@ -96,6 +96,22 @@ convert_system_path_to_grub_path ()
   echo ${drive}${relative_path}
 }
 
+prepare_grub_to_access_device ()
+{
+  device=$1
+
+  # If there's a filesystem UUID that GRUB is capable of identifiing, use it;
+  # otherwise set root as per value in device.map.
+  if fs_uuid="`grub-probe --device ${device} --target=fs_uuid 2> /dev/null`" ; then
+    echo "search --fs_uuid --set ${fs_uuid}"
+  else
+    echo "set root=`${grub_probe} --device ${device} --target=drive`"
+  fi
+
+  # Abstraction modules aren't auto-loaded.
+  GRUB_PRELOAD_MODULES="${GRUB_PRELOAD_MODULES} `${grub_probe} --device ${device} --target=abstraction`"
+}
+
 font_path ()
 {
   # Prefer system path for space reasons (/boot/grub might be a very small