]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2010-09-08 Robert Millan <rmh@gnu.org>
authorRobert Millan <rmh@aybabtu.com>
Wed, 8 Sep 2010 12:37:19 +0000 (14:37 +0200)
committerRobert Millan <rmh@aybabtu.com>
Wed, 8 Sep 2010 12:37:19 +0000 (14:37 +0200)
* configure.ac: Remove `--enable-grub-fstest' option.
* Makefile.util.def (grub-fstest): Remove COND_GRUB_FSTEST condition.

* util/grub-mkconfig_lib.in (is_path_readable_by_grub): Use
`grub-fstest' instead of `grub-probe' for readability verification.
* util/grub-probe.c (probe): Remove readability verification kludge.

ChangeLog
Makefile.util.def
configure.ac
util/grub-mkconfig_lib.in
util/grub-probe.c

index 0e1285c6f52cc74c3f7cea35ba2b7dd6fe4cfd3d..7e2420c641b48a4d475e6599d9a898c0ebf85a5d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-09-08  Robert Millan  <rmh@gnu.org>
+
+       * configure.ac: Remove `--enable-grub-fstest' option.
+       * Makefile.util.def (grub-fstest): Remove COND_GRUB_FSTEST condition.
+
+       * util/grub-mkconfig_lib.in (is_path_readable_by_grub): Use
+       `grub-fstest' instead of `grub-probe' for readability verification.
+       * util/grub-probe.c (probe): Remove readability verification kludge.
+
 2010-09-08  Robert Millan  <rmh@gnu.org>
 
        * util/grub-mkconfig.in: Pass `--device ${GRUB_DEVICE}' when
index e0900c73fee2baaadd400c3673df87ee84e0a792..c4872c7c3840d3e5d2a86dc8f41a82206edacf58 100644 (file)
@@ -183,7 +183,6 @@ program = {
 
   ldadd = libgrub.a;
   ldadd = '$(LIBINTL) $(LIBDEVMAPPER)';
-  condition = COND_GRUB_FSTEST;
 };
 
 program = {
index d362f68a54c7412f8938c6a72a1ceed4b287d630..3a1a6da638ba6748fdb6470e720457d745178aa9 100644 (file)
@@ -762,19 +762,6 @@ AC_SUBST([enable_grub_emu_usb])
 AC_SUBST([enable_grub_emu_pci])
 fi
 
-AC_ARG_ENABLE([grub-fstest],
-             [AS_HELP_STRING([--enable-grub-fstest],
-                             [build and install the `grub-fstest' debugging utility (default=guessed)])])
-if test x"$enable_grub_fstest" = xno ; then
-  grub_fstest_excuse="explicitly disabled"
-fi
-if test x"$grub_fstest_excuse" = x ; then
-enable_grub_fstest=yes
-else
-enable_grub_fstest=no
-fi
-AC_SUBST([enable_grub_fstest])
-
 AC_ARG_ENABLE([grub-mkfont],
              [AS_HELP_STRING([--enable-grub-mkfont],
                              [build and install the `grub-mkfont' utility (default=guessed)])])
@@ -905,7 +892,6 @@ AM_CONDITIONAL([COND_GRUB_EMU_SDL], [test x$enable_grub_emu_sdl = xyes])
 AM_CONDITIONAL([COND_GRUB_EMU_PCI], [test x$enable_grub_emu_pci = xyes])
 AM_CONDITIONAL([COND_GRUB_MKFONT], [test x$enable_grub_mkfont = xyes])
 AM_CONDITIONAL([COND_HAVE_FONT_SOURCE], [test x$FONT_SOURCE != x])
-AM_CONDITIONAL([COND_GRUB_FSTEST], [test x$enable_grub_fstest = xyes])
 AM_CONDITIONAL([COND_GRUB_PE2ELF], [test x$TARGET_OBJ2ELF != x])
 AM_CONDITIONAL([COND_APPLE_CC], [test x$TARGET_APPLE_CC = x1])
 AM_CONDITIONAL([COND_ENABLE_EFIEMU], [test x$enable_efiemu = xyes])
@@ -970,11 +956,6 @@ echo efiemu runtime: Yes
 else
 echo efiemu runtime: No "($efiemu_excuse)"
 fi
-if [ x"$grub_fstest_excuse" = x ]; then
-echo grub-fstest: Yes
-else
-echo grub-fstest: No "($grub_fstest_excuse)"
-fi
 if [ x"$grub_mkfont_excuse" = x ]; then
 echo grub-mkfont: Yes
 else
index 9a77d1bdf749bc9c880c3f885cfa6b2aac782079..c6f79fb4924ff81014df2d1ccd63f1a65ba2d0ec 100644 (file)
@@ -30,6 +30,9 @@ fi
 if test "x$grub_mkrelpath" = x; then
   grub_mkrelpath=${bindir}/`echo grub-mkrelpath | sed ${transform}`
 fi
+if test "x$grub_fstest" = x; then
+  grub_fstest=${bindir}/`echo grub-fstest | sed ${transform}`
+fi
 
 if $(which gettext >/dev/null 2>/dev/null) ; then
   gettext="gettext"
@@ -56,8 +59,11 @@ is_path_readable_by_grub ()
     return 1
   fi
 
-  # abort if file is in a filesystem we can't read
-  if ${grub_probe} -t fs $path > /dev/null 2>&1 ; then : ; else
+  # 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
 
index f02d985897f2fd9eb77bb1a0dc9f52ff3815bf02..4ee1227137850a28e79fe208f90debebdc6812b1 100644 (file)
@@ -226,43 +226,9 @@ probe (const char *path, char *device_name)
 
   if (print == PRINT_FS)
     {
-      if (path)
-        {
-         struct stat st;
-
-         stat (path, &st);
-
-         if (S_ISREG (st.st_mode))
-           {
-             /* Regular file.  Verify that we can read it properly.  */
-
-             grub_file_t file;
-             char *rel_path;
-             grub_util_info ("reading %s via OS facilities", path);
-             filebuf_via_sys = grub_util_read_image (path);
-
-             rel_path = grub_make_system_path_relative_to_its_root (path);
-             grub_path = xasprintf ("(%s)%s", drive_name, rel_path);
-             free (rel_path);
-             grub_util_info ("reading %s via GRUB facilities", grub_path);
-             grub_file_filter_disable_compression ();
-             file = grub_file_open (grub_path);
-             if (! file)
-               grub_util_error ("cannot open %s via GRUB facilities", grub_path);
-             filebuf_via_grub = xmalloc (file->size);
-             grub_file_read (file, filebuf_via_grub, file->size);
-
-             grub_util_info ("comparing");
-
-             if (memcmp (filebuf_via_grub, filebuf_via_sys, file->size))
-               grub_util_error ("files differ");
-           }
-       }
-
       printf ("%s\n", fs->name);
     }
-
-  if (print == PRINT_FS_UUID)
+  else if (print == PRINT_FS_UUID)
     {
       char *uuid;
       if (! fs->uuid)