Just a few error message improvements.
--
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 /.)
* disk/raid.c (grub_raid_open, grub_raid_scan_device): Add a few
grub_dprintf() calls.
* kern/disk.c (grub_disk_read): Include grub_errmsg in out of range
error message.
diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../grub2/disk/raid.c ./disk/raid.c
--- ../grub2/disk/raid.c 2007-12-30 09:52:03.000000000 +0100
+++ ./disk/raid.c 2008-02-06 17:25:19.000000000 +0100
@@ -86,6 +86,8 @@ grub_raid_open (const char *name, grub_d
disk->id = array->number;
disk->data = array;
+ grub_dprintf ("raid", "%s: total_devs=%d, disk_size=%d\n", name, array->total_devs, array->disk_size);
+
switch (array->level)
{
case 0:
@@ -101,6 +103,8 @@ grub_raid_open (const char *name, grub_d
disk->total_sectors = (array->total_devs - 1) * array->disk_size;
break;
}
+
+ grub_dprintf ("raid", "%s: level=%d, total_sectors=%d\n", name, array->level, disk->total_sectors);
return 0;
}
@@ -332,6 +336,8 @@ grub_raid_scan_device (const char *name)
struct grub_raid_super_09 sb;
struct grub_raid_array *p, *array = NULL;
+ grub_dprintf ("raid", "Scanning for RAID devices\n");
+
disk = grub_disk_open (name);
if (!disk)
return 0;
@@ -485,6 +491,8 @@ grub_raid_scan_device (const char *name)
grub_sprintf (array->name, "md%d", array->number);
+ grub_dprintf ("raid", "Found array: %s\n", array->name);
+
/* Add our new array to the list. */
array->next = array_list;
array_list = array;
diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../grub2/kern/disk.c ./kern/disk.c
--- ../grub2/kern/disk.c 2008-02-01 01:49:39.000000000 +0100
+++ ./kern/disk.c 2008-02-06 17:25:19.000000000 +0100
@@ -367,8 +367,8 @@ grub_disk_read (grub_disk_t disk, grub_d
if (grub_disk_check_range (disk, §or, &offset, size) != GRUB_ERR_NONE)
{
grub_error_push ();
- grub_dprintf ("disk", "Read out of range: sector 0x%llx.\n",
- (unsigned long long) sector);
+ grub_dprintf ("disk", "Read out of range: 0x%llx (%s).\n",
+ (unsigned long long) sector, grub_errmsg);
grub_error_pop ();
return grub_errno;
}
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel