New patch after IRC discussion with Marco.  code + ChangeLog should be
self-explanatory.

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)
2007-10-14  Robert Millan  <[EMAIL PROTECTED]>

	* normal/misc.c (grub_normal_print_device_info): Do not probe for
	filesystem when dev->disk is unset.
	Do probe for filesystem even when dev->disk->has_partitions is set.
	In case a filesystem is found, always report it.
	In case it isn't, if dev->disk->has_partitions is set, report that
	a partition table was found instead of reporting that no filesystem
	could be identified.

diff -pur grub2/normal/misc.c grub2.disk/normal/misc.c
--- grub2/normal/misc.c	2007-07-22 01:32:29.000000000 +0200
+++ grub2.disk/normal/misc.c	2007-10-14 17:41:57.000000000 +0200
@@ -40,7 +40,7 @@ grub_normal_print_device_info (const cha
   dev = grub_device_open (name);
   if (! dev)
     grub_printf ("Filesystem cannot be accessed");
-  else if (! dev->disk || ! dev->disk->has_partitions || dev->disk->partition)
+  else if (dev->disk)
     {
       char *label;
       grub_fs_t fs;
@@ -49,7 +49,12 @@ grub_normal_print_device_info (const cha
       /* Ignore all errors.  */
       grub_errno = 0;
 
-      grub_printf ("Filesystem type %s", fs ? fs->name : "unknown");
+      if (fs)
+	grub_printf ("Filesystem type %s", fs->name);
+      else if (! dev->disk->has_partitions || dev->disk->partition)
+	grub_printf ("Unknown filesystem");
+      else
+	grub_printf ("Partition table");
 	  
       if (fs && fs->label)
 	{
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to