]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2010-09-10 Robert Millan <rmh@gnu.org>
authorRobert Millan <rmh@aybabtu.com>
Fri, 10 Sep 2010 13:11:54 +0000 (15:11 +0200)
committerRobert Millan <rmh@aybabtu.com>
Fri, 10 Sep 2010 13:11:54 +0000 (15:11 +0200)
* util/grub.d/10_hurd.in: Add misc readability checks.
* util/grub.d/10_kfreebsd.in: Likewise.
* util/grub.d/10_linux.in: Likewise.

ChangeLog
util/grub.d/10_hurd.in
util/grub.d/10_kfreebsd.in
util/grub.d/10_linux.in

index 3a7a75e20a6f0bfef76c4322fea0b3df28794cce..9f6c66e816704f24401f4a2cd96c7c473e457af7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-09-10  Robert Millan  <rmh@gnu.org>
+
+       * util/grub.d/10_hurd.in: Add misc readability checks.
+       * util/grub.d/10_kfreebsd.in: Likewise.
+       * util/grub.d/10_linux.in: Likewise.
+
 2010-09-10  Colin Watson  <cjwatson@ubuntu.com>
 
        * util/grub-install.in: ${imgext} won't be defined here until the
index 350eb30a8a0057b5b1c8bf9f524381a325a05a3e..d8cc7aea43bfcc83bab79f5b40468c4c3aa002ae 100644 (file)
@@ -41,6 +41,14 @@ for i in /boot/gnumach* ; do
     basename=`basename $i`
     dirname=`dirname $i`
     rel_dirname=`make_system_path_relative_to_its_root $dirname`
+
+    if ! is_path_readable_by_grub ${dirname}/${basename} \
+        ${GRUB_DEVICE_BOOT} \
+        ${rel_dirname}/${basename} ; then
+      echo "${dirname}/${basename} is not readable by GRUB" >&2
+      exit 1
+    fi
+
     echo "Found GNU Mach: $i" >&2
     kernels="${kernels} ${rel_dirname}/${basename}"
     at_least_one=true
index e39423999d4b75fb473c4656035b9bbaf597e18a..bf1632bd6e779737ca3d09e4700ab2f6423667fe 100644 (file)
@@ -44,7 +44,7 @@ load_kfreebsd_module ()
   mod="$1"
   allow_fail="$2"
 
-  if ! test -e "${module_dir}/${mod}.ko" ; then
+  if ! is_path_readable_by_grub "${module_dir}/${mod}.ko" ; then
     if [ "${allow_fail}" = "true" ] ; then
       # Return silently
       return
@@ -77,6 +77,13 @@ kfreebsd_entry ()
     prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
   fi
 
+  if ! is_path_readable_by_grub ${dirname}/${basename} \
+      ${GRUB_DEVICE_BOOT} \
+      ${rel_dirname}/${basename} ; then
+    echo "${dirname}/${basename} is not readable by GRUB" >&2
+    exit 1
+  fi
+
   printf '%s\n' "${prepare_boot_cache}"
   cat << EOF
        echo                    '$(printf "$(gettext_quoted "Loading kernel of FreeBSD %s ...")" ${version})'
@@ -95,7 +102,13 @@ EOF
     zfs)
       load_kfreebsd_module opensolaris false
 
-      ls "${dirname}/zfs/zpool.cache" > /dev/null
+      if ! is_path_readable_by_grub ${dirname}/zfs/zpool.cache \
+          ${GRUB_DEVICE_BOOT} \
+          ${rel_dirname}/zfs/zpool.cache ; then
+        echo "${dirname}/zfs/zpool.cache is not readable by GRUB" >&2
+        exit 1
+      fi
+
       printf '%s\n' "${prepare_boot_cache}"
   cat << EOF
        kfreebsd_module         ${rel_dirname}/zfs/zpool.cache type=/boot/zfs/zpool.cache
index 14b85c7f131ef3b513154a0d7fe3b125de26c0ef..765a7fab6d6b848eeb300cf3a35da028e4b52fad 100644 (file)
@@ -83,6 +83,15 @@ EOF
 EOF
   fi
 
+  for i in ${basename} ${initrd} ; do
+    if ! is_path_readable_by_grub ${dirname}/${i} \
+        ${GRUB_DEVICE_BOOT} \
+        ${rel_dirname}/${i} ; then
+      echo "${dirname}/${i} is not readable by GRUB" >&2
+      exit 1
+    fi
+  done
+
   if [ -z "${prepare_boot_cache}" ]; then
     prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
   fi