* grub-core/normal/misc.c (grub_normal_print_device_info): Use KiB to display

sizes and display sector size.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2013-02-25 10:45:19 +01:00
parent d55ffb0249
commit 28d468d6f2
2 changed files with 13 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2013-02-25 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/normal/misc.c (grub_normal_print_device_info): Use KiB to display
sizes and display sector size.
2013-02-24 Vladimir Serbinenko <phcoder@gmail.com> 2013-02-24 Vladimir Serbinenko <phcoder@gmail.com>
Implement new command cmosdump. Implement new command cmosdump.

View file

@ -117,13 +117,17 @@ grub_normal_print_device_info (const char *name)
grub_printf ("%s", _("No known filesystem detected")); grub_printf ("%s", _("No known filesystem detected"));
if (dev->disk->partition) if (dev->disk->partition)
grub_printf (_(" - Partition start at %llu"), grub_printf (_(" - Partition start at %llu%sKiB"),
(unsigned long long) grub_partition_get_start (dev->disk->partition)); (unsigned long long) (grub_partition_get_start (dev->disk->partition) >> 1),
(grub_partition_get_start (dev->disk->partition) & 1) ? ".5" : "" );
else
grub_printf_ (N_(" - Sector size %uB"), 1 << dev->disk->log_sector_size);
if (grub_disk_get_size (dev->disk) == GRUB_DISK_SIZE_UNKNOWN) if (grub_disk_get_size (dev->disk) == GRUB_DISK_SIZE_UNKNOWN)
grub_puts_ (N_(" - Total size unknown")); grub_puts_ (N_(" - Total size unknown"));
else else
grub_printf (_(" - Total size %llu sectors"), grub_printf (_(" - Total size %llu%sKiB"),
(unsigned long long) grub_disk_get_size (dev->disk)); (unsigned long long) (grub_disk_get_size (dev->disk) >> 1),
(grub_disk_get_size (dev->disk) & 1) ? ".5" : "");
grub_device_close (dev); grub_device_close (dev);
} }