2007-06-06 Robert Millan <rmh@aybabtu.com>
* util/update-grub_lib.in (convert_system_path_to_grub_path): Abort if file doesn't exist, or if it is in a filesystem grub can't read. * util/update-grub.in: Set fallback for GRUB_FS check to "unknown". Do not abort if GRUB_DRIVE could not be defined. Rearrange generated header comment to fit in 80 columns when the variables are resolved. * util/grub.d/00_header.in: Only set root variable when GRUB_DRIVE could be identified by update-grub. Remove redundant check for unifont.pff existance (since convert_system_path_to_grub_path now handles that).
This commit is contained in:
parent
fb36dc2693
commit
c0f90770b8
4 changed files with 30 additions and 6 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
||||||
|
2007-06-06 Robert Millan <rmh@aybabtu.com>
|
||||||
|
|
||||||
|
* util/update-grub_lib.in (convert_system_path_to_grub_path): Abort if
|
||||||
|
file doesn't exist, or if it is in a filesystem grub can't read.
|
||||||
|
|
||||||
|
* util/update-grub.in: Set fallback for GRUB_FS check to "unknown". Do
|
||||||
|
not abort if GRUB_DRIVE could not be defined. Rearrange generated
|
||||||
|
header comment to fit in 80 columns when the variables are resolved.
|
||||||
|
|
||||||
|
* util/grub.d/00_header.in: Only set root variable when GRUB_DRIVE
|
||||||
|
could be identified by update-grub. Remove redundant check for
|
||||||
|
unifont.pff existance (since convert_system_path_to_grub_path now
|
||||||
|
handles that).
|
||||||
|
|
||||||
2007-06-04 Robert Millan <rmh@aybabtu.com>
|
2007-06-04 Robert Millan <rmh@aybabtu.com>
|
||||||
|
|
||||||
* conf/i386-efi.rmk (grub_probe_SOURCES): Add partmap/apple.c.
|
* conf/i386-efi.rmk (grub_probe_SOURCES): Add partmap/apple.c.
|
||||||
|
|
|
@ -30,13 +30,18 @@ if [ "x${GRUB_TIMEOUT}" = "x" ] ; then GRUB_TIMEOUT=5 ; fi
|
||||||
cat << EOF
|
cat << EOF
|
||||||
set default=${GRUB_DEFAULT}
|
set default=${GRUB_DEFAULT}
|
||||||
set timeout=${GRUB_TIMEOUT}
|
set timeout=${GRUB_TIMEOUT}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
if [ "x${GRUB_DRIVE}" = "x" ] ; then : ; else
|
||||||
|
cat << EOF
|
||||||
set root=${GRUB_DRIVE}
|
set root=${GRUB_DRIVE}
|
||||||
EOF
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
# Prefer system path for space reasons (/boot/grub might be a very small
|
# Prefer system path for space reasons (/boot/grub might be a very small
|
||||||
# partition in case of OpenFirmware, etc).
|
# partition in case of OpenFirmware, etc).
|
||||||
for i in /usr/share/grub/unifont.pff /boot/grub/unifont.pff ; do
|
for i in /usr/share/grub/unifont.pff /boot/grub/unifont.pff ; do
|
||||||
if test -e $i && grub_path=`convert_system_path_to_grub_path $i` ; then
|
if grub_path=`convert_system_path_to_grub_path $i` ; then
|
||||||
cat << EOF
|
cat << EOF
|
||||||
|
|
||||||
font ${grub_path}
|
font ${grub_path}
|
||||||
|
|
|
@ -74,10 +74,10 @@ GRUB_DEVICE="`grub-probe --target=device /`"
|
||||||
|
|
||||||
# Filesystem for the device containing our userland. Used for stuff like
|
# Filesystem for the device containing our userland. Used for stuff like
|
||||||
# choosing Hurd filesystem module.
|
# choosing Hurd filesystem module.
|
||||||
GRUB_FS="`grub-probe --target=fs /`"
|
GRUB_FS="`grub-probe --target=fs / 2> /dev/null || echo unknown`"
|
||||||
|
|
||||||
# GRUB path to /
|
# GRUB path to /. Only used for "set root=". Not critical.
|
||||||
GRUB_DRIVE="`grub-probe --target=drive /`"
|
GRUB_DRIVE="`grub-probe --target=drive /`" || true
|
||||||
|
|
||||||
# GRUB path to /boot
|
# GRUB path to /boot
|
||||||
GRUB_DRIVE_BOOT="`convert_system_path_to_grub_path /boot`"
|
GRUB_DRIVE_BOOT="`convert_system_path_to_grub_path /boot`"
|
||||||
|
@ -105,8 +105,8 @@ cat << EOF
|
||||||
#
|
#
|
||||||
# DO NOT EDIT THIS FILE
|
# DO NOT EDIT THIS FILE
|
||||||
#
|
#
|
||||||
# It is automaticaly generated by $0 using templates from ${update_grub_dir}
|
# It is automaticaly generated by $0 using templates
|
||||||
# and settings from ${sysconfdir}/default/grub
|
# from ${update_grub_dir} and settings from ${sysconfdir}/default/grub
|
||||||
#
|
#
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,8 @@ grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
|
||||||
convert_system_path_to_grub_path ()
|
convert_system_path_to_grub_path ()
|
||||||
{
|
{
|
||||||
dir=$1
|
dir=$1
|
||||||
|
# Abort if file doesn't exist
|
||||||
|
test -e $dir
|
||||||
dir=`readlink -f $dir`
|
dir=`readlink -f $dir`
|
||||||
|
|
||||||
drive=`${grub_probe} -t drive $dir`
|
drive=`${grub_probe} -t drive $dir`
|
||||||
|
@ -31,6 +33,9 @@ convert_system_path_to_grub_path ()
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Abort if file is in a filesystem we can't read
|
||||||
|
${grub_probe} -t fs $dir > /dev/null 2>&1
|
||||||
|
|
||||||
num=`stat -c %d $dir`
|
num=`stat -c %d $dir`
|
||||||
relative_path=""
|
relative_path=""
|
||||||
while : ; do
|
while : ; do
|
||||||
|
|
Loading…
Reference in a new issue