From 2fc8ccb97fbfae43301a36b17d48c7560f18e537 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sun, 12 Sep 2010 20:18:50 +0200 Subject: [PATCH] * grub-core/normal/misc.c (grub_normal_print_device_info): Show partition size and offset. --- ChangeLog | 5 +++++ grub-core/normal/misc.c | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2eaee5571..7d957c5cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-09-12 Vladimir Serbinenko + + * grub-core/normal/misc.c (grub_normal_print_device_info): Show + partition size and offset. + 2010-09-12 Vladimir Serbinenko * grub-core/commands/wildcard.c (make_regex): Escape brackets. diff --git a/grub-core/normal/misc.c b/grub-core/normal/misc.c index 2b84b1c82..ad408074b 100644 --- a/grub-core/normal/misc.c +++ b/grub-core/normal/misc.c @@ -26,6 +26,7 @@ #include #include #include +#include /* Print the information on the device NAME. */ grub_err_t @@ -112,6 +113,16 @@ grub_normal_print_device_info (const char *name) else grub_printf ("%s", _("Partition table")); + if (dev->disk->partition) + grub_printf (_(" - Partition start at %u"), + grub_partition_get_start (dev->disk->partition)); + if (grub_disk_get_size (dev->disk) == GRUB_DISK_SIZE_UNKNOWN) + grub_printf (_(" - Total size unknown"), + grub_disk_get_size (dev->disk)); + else + grub_printf (_(" - Total size %u sectors"), + grub_disk_get_size (dev->disk)); + grub_device_close (dev); }