* 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>
+
+ * 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.
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
echo "terminal ${GRUB_TERMINAL}"
;;
esac
+
+# Set the root device.
+prepare_grub_to_access_device ${GRUB_DEVICE_BOOT}
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
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