+2008-05-30 Robert Millan <rmh@aybabtu.com>
+
+ * util/grub.d/00_header.in: Remove obsolete comment referencing
+ convert_system_path_to_grub_path().
+ * util/update-grub.in: Likewise.
+ * util/update-grub_lib.in (is_path_readable_by_grub): New function.
+ (convert_system_path_to_grub_path): Add a warning message explaining
+ that this function is deprecated. Rely on is_path_readable_by_grub()
+ for the readability checks.
+ (font_path): Use is_path_readable_by_grub() for the readability
+ check rather than convert_system_path_to_grub_path().
+
2008-05-30 Robert Millan <rmh@aybabtu.com>
* util/update-grub_lib.in (prepare_grub_to_access_device): New function.
libdir=@libdir@
platform=@platform@
-# for convert_system_path_to_grub_path()
. ${libdir}/grub/update-grub_lib
# Do this as early as possible, since other commands might depend on it.
esac
done
-# for convert_system_path_to_grub_path(), font_path()
. ${libdir}/grub/update-grub_lib
if [ "x$UID" = "x" ] ; then
echo $path | sed -e "s,^$dir,,g"
}
-convert_system_path_to_grub_path ()
+is_path_readable_by_grub ()
{
path=$1
- # abort if file doesn't exist
+ # abort if path doesn't exist
if test -e $path ; then : ;else
return 1
fi
return 1
fi
+ return 0
+}
+
+convert_system_path_to_grub_path ()
+{
+ path=$1
+
+ echo "Warning: convert_system_path_to_grub_path() is deprecated. Use prepare_grub_to_access_device() instead." >&2
+
+ # abort if GRUB can't access the path
+ if is_path_readable_by_grub ${path} ; then : ; else
+ return 1
+ fi
+
if drive=`${grub_probe} -t drive $path` ; then : ; else
return 1
fi
# Prefer complete fonts over incomplete ones.
for basename in unicode unifont ascii ; do
path="${dir}/${basename}.pff"
- if convert_system_path_to_grub_path ${path} > /dev/null ; then
+ if is_path_readable_by_grub ${path} > /dev/null ; then
echo "${path}"
return 0
fi