aboutsummaryrefslogtreecommitdiffstats
path: root/com32/hdt/hdt-cli-disk.c
diff options
context:
space:
mode:
authorPierre-Alexandre Meyer <pierre@mouraf.org>2009-08-26 21:27:18 -0700
committerPierre-Alexandre Meyer <pierre@mouraf.org>2009-08-26 21:27:18 -0700
commitfa0b7fbee68bcc8f496210f540a231b8b5a19455 (patch)
tree4efd0ab181fbed3bae4e02dc80dde5f350ce8871 /com32/hdt/hdt-cli-disk.c
parentd7076627ee03a2945dc6c6a217a24cc943f2abe2 (diff)
downloadhdt-fa0b7fbee68bcc8f496210f540a231b8b5a19455.tar.gz
hdt-fa0b7fbee68bcc8f496210f540a231b8b5a19455.tar.xz
hdt-fa0b7fbee68bcc8f496210f540a231b8b5a19455.zip
hdt: add bootloader detection (CLI)
When iterating through all partitions (e.g. `show disks'), print the bootloader ID if we recognize it. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Diffstat (limited to 'com32/hdt/hdt-cli-disk.c')
-rw-r--r--com32/hdt/hdt-cli-disk.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/com32/hdt/hdt-cli-disk.c b/com32/hdt/hdt-cli-disk.c
index 995bfd0c..b974110a 100644
--- a/com32/hdt/hdt-cli-disk.c
+++ b/com32/hdt/hdt-cli-disk.c
@@ -32,6 +32,7 @@
#include <errno.h>
#include <disk/mbrs.h>
+#include <disk/bootloaders.h>
#include <disk/errno_disk.h>
#include <disk/geom.h>
#include <disk/read.h>
@@ -64,6 +65,7 @@ static void show_partition_information(struct driveinfo *drive_info,
int nb_partitions_seen)
{
char size[9];
+ char bootloader_name[9];
char *parttype;
unsigned int start, end;
@@ -78,10 +80,10 @@ static void show_partition_information(struct driveinfo *drive_info,
memset(size, 0, sizeof size);
if (i == 1)
- more_printf(" # B Start End Size Id Type\n");
+ more_printf(" # B Start End Size Id Type\n");
get_label(ptab->ostype, &parttype);
- more_printf(" %2d %s %11d %11d %s %02X %s",
+ more_printf("%2d %s %11d %11d %s %02X %s",
i, (ptab->active_flag == 0x80) ? "x" : " ",
start,
end,
@@ -92,6 +94,9 @@ static void show_partition_information(struct driveinfo *drive_info,
if (ptab->ostype == 0x82 && swsusp_check(drive_info, ptab))
more_printf("%s", " (Swsusp sig. detected)");
+ if (get_bootloader_string(drive_info, ptab, bootloader_name, 9) == 0)
+ more_printf("%-46s %s %s", " ", "Bootloader:", bootloader_name);
+
more_printf("\n");
free(parttype);