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.
This commit is contained in:
robertmh 2008-05-30 14:39:44 +00:00
parent 6219127445
commit 972e2f7a66
4 changed files with 34 additions and 12 deletions

View file

@ -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.

View 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}

View 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

View 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