]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2006-10-27 Hollis Blanchard <hollis@penguinppc.org>
authorhollisb <hollisb@localhost>
Fri, 27 Oct 2006 18:14:00 +0000 (18:14 +0000)
committerhollisb <hollisb@localhost>
Fri, 27 Oct 2006 18:14:00 +0000 (18:14 +0000)
* kern/disk.c (grub_disk_open): Print debug messages when opening a
disk.
(grub_disk_close): Print debug messages when closing a disk.
(grub_disk_read): Print debug messages when disk read fails.
* kern/fs.c (grub_fs_probe): Print debug messages when detecting
filesystem type.
* kern/partition.c: Include misc.h.
(grub_partition_iterate): Print debug messages when detecting
partition type.

ChangeLog
kern/disk.c
kern/fs.c
kern/partition.c

index 5b42899d87ff98b983ee97512457c33453d3e5f1..566a54d788f4065d7ae75b9852ce76d91bba4d10 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2006-10-27  Hollis Blanchard  <hollis@penguinppc.org>
+
+       * kern/disk.c (grub_disk_open): Print debug messages when opening a
+       disk.
+       (grub_disk_close): Print debug messages when closing a disk.
+       (grub_disk_read): Print debug messages when disk read fails.
+       * kern/fs.c (grub_fs_probe): Print debug messages when detecting
+       filesystem type.
+       * kern/partition.c: Include misc.h.
+       (grub_partition_iterate): Print debug messages when detecting
+       partition type.
+
 2006-10-27  Hollis Blanchard  <hollis@penguinppc.org>
 
        * disk/ieee1275/ofdisk.c (grub_ofdisk_read): Return error if `status'
index 114d3ae495de076ff2b4a5368690c8b0151f79e2..7f8c44020415162d6247ef5810149acab0fe8431 100644 (file)
@@ -214,7 +214,9 @@ grub_disk_open (const char *name)
   grub_disk_dev_t dev;
   char *raw = (char *) name;
   unsigned long current_time;
-  
+
+  grub_dprintf ("disk", "Opening `%s'...\n", name);
+
   disk = (grub_disk_t) grub_malloc (sizeof (*disk));
   if (! disk)
     return 0;
@@ -291,6 +293,10 @@ grub_disk_open (const char *name)
 
   if (grub_errno != GRUB_ERR_NONE)
     {
+      grub_error_push ();
+      grub_dprintf ("disk", "Opening `%s' failed.\n", name);
+      grub_error_pop ();
+
       grub_disk_close (disk);
       return 0;
     }
@@ -301,6 +307,8 @@ grub_disk_open (const char *name)
 void
 grub_disk_close (grub_disk_t disk)
 {
+  grub_dprintf ("disk", "Closing `%s'.\n", disk->name);
+
   if (disk->dev && disk->dev->close)
     (disk->dev->close) (disk);
 
@@ -353,7 +361,12 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector,
   
   /* First of all, check if the region is within the disk.  */
   if (grub_disk_check_range (disk, &sector, &offset, size) != GRUB_ERR_NONE)
-    return grub_errno;
+    {
+      grub_error_push ();
+      grub_dprintf ("disk", "Read out of range: sector 0x%lx.\n", sector);
+      grub_error_pop ();
+      return grub_errno;
+    }
 
   real_offset = offset;
   
@@ -406,7 +419,12 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector,
              num = ((size + GRUB_DISK_SECTOR_SIZE - 1)
                     >> GRUB_DISK_SECTOR_BITS);
              if ((disk->dev->read) (disk, sector, num, tmp_buf))
-               goto finish;
+               {
+                 grub_error_push ();
+                 grub_dprintf ("disk", "%s read failed\n", disk->name);
+                 grub_error_pop ();
+                 goto finish;
+               }
 
              grub_memcpy (buf, tmp_buf + real_offset, size);
 
index 2ef31451007eca37299a192664e9f4bebcfad85b..cc9c5ada8b73a95faf3a4a4b3b17ddc1d98294a1 100644 (file)
--- a/kern/fs.c
+++ b/kern/fs.c
@@ -78,16 +78,21 @@ grub_fs_probe (grub_device_t device)
     {
       /* Make it sure not to have an infinite recursive calls.  */
       static int count = 0;
-      
+
       for (p = grub_fs_list; p; p = p->next)
        {
+         grub_dprintf ("fs", "Detecting %s...\n", p->name);
          (p->dir) (device, "/", dummy_func);
          if (grub_errno == GRUB_ERR_NONE)
            return p;
-         
+
+         grub_error_push ();
+         grub_dprintf ("fs", "%s detection failed.\n", p->name);
+         grub_error_pop ();
+
          if (grub_errno != GRUB_ERR_BAD_FS)
            return 0;
-         
+
          grub_errno = GRUB_ERR_NONE;
        }
 
index af0c95de7ad7b4344568094104f9f8460cd85777..9fbf79cc583276a9cdccfdb7bd4ce0a462e8c0ae 100644 (file)
@@ -17,6 +17,7 @@
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <grub/misc.h>
 #include <grub/partition.h>
 #include <grub/disk.h>
 
@@ -103,15 +104,20 @@ grub_partition_iterate (struct grub_disk *disk,
   
   int part_map_iterate (const grub_partition_map_t p)
     {
-      grub_err_t err = p->iterate (disk, part_map_iterate_hook);
+      grub_err_t err;
+
+      grub_dprintf ("partition", "Detecting %s...\n", p->name);
+      err = p->iterate (disk, part_map_iterate_hook);
 
       if (err != GRUB_ERR_NONE)
        {
          /* Continue to next partition map type.  */
+         grub_dprintf ("partition", "%s detection failed.\n", p->name);
          grub_errno = GRUB_ERR_NONE;
          return 0;
        }
 
+      grub_dprintf ("partition", "%s detection succeeded.\n", p->name);
       partmap = p;
       return 1;
     }