diff --git a/ChangeLog b/ChangeLog index 2c1b5e3f2..b35a5be2b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-05-30 Robert Millan + + * 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 * commands/search.c (options): Add --fs_uuid option. diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index ab13939f2..9087b0003 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -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} diff --git a/util/update-grub.in b/util/update-grub.in index 164396581..887ef19bc 100644 --- a/util/update-grub.in +++ b/util/update-grub.in @@ -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 diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in index 2d7092b1b..d7be39d5e 100644 --- a/util/update-grub_lib.in +++ b/util/update-grub_lib.in @@ -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