+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'
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;
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;
}
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);
/* First of all, check if the region is within the disk. */
if (grub_disk_check_range (disk, §or, &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;
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);
{
/* 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;
}
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <grub/misc.h>
#include <grub/partition.h>
#include <grub/disk.h>
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;
}