mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-25 08:39:28 +00:00
2010-09-08 Robert Millan <rmh@gnu.org>
* util/grub-mkconfig_lib.in (is_path_readable_by_grub): Improve with (optional) parameters to specify device and relative path. * util/grub-install.in: Use is_path_readable_by_grub() to verify readability of a few critical files. * util/grub-mkconfig.in: Use is_path_readable_by_grub() to verify readability of grub.cfg.new.
This commit is contained in:
1 parent
27f21a8bb6
commit
6b8e78aee3
4 files changed
+34
-5
No files matched your search
@@ -53,16 +53,23 @@ make_system_path_relative_to_its_root ()
|
||||
is_path_readable_by_grub ()
|
||||
{
|
||||
path=$1
|
||||
device=$2
|
||||
relpath=$3
|
||||
|
||||
# abort if path doesn't exist
|
||||
if test -e $path ; then : ;else
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ "${device}" = "" ] ; then
|
||||
device=$(${grub_probe} --target=device $path)
|
||||
fi
|
||||
if [ "${relpath}" = "" ] ; then
|
||||
relpath=$(${grub_mkrelpath} $path)
|
||||
fi
|
||||
|
||||
# abort if file read through GRUB doesn't match file read through system
|
||||
# facilities
|
||||
device=$(${grub_probe} --target=device $path)
|
||||
relpath=$(${grub_mkrelpath} $path)
|
||||
if ${grub_fstest} $device cmp $relpath $path > /dev/null 2>&1 ; then : ; else
|
||||
return 1
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user