summaryrefslogtreecommitdiff
path: root/com32/hdt/hdt-dump-disks.c
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2012-11-29 11:58:47 +0000
committerJonathan Maw <jonathan.maw@codethink.co.uk>2012-11-29 11:58:47 +0000
commit0846de0e1795a30512f5575388d163ea548125de (patch)
treee1bc03fa83c61165f48ffe3f528ac5496332872a /com32/hdt/hdt-dump-disks.c
parentede8500d7c710e4ddf650f1a1ef3ccf2a89e5313 (diff)
parent7307d60063ee4303da4de45f9d984fdc8df92146 (diff)
downloadsyslinux-0846de0e1795a30512f5575388d163ea548125de.tar.gz
Merge the latest changes from upstreambaserock/genivi/morph
Diffstat (limited to 'com32/hdt/hdt-dump-disks.c')
-rw-r--r--com32/hdt/hdt-dump-disks.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/com32/hdt/hdt-dump-disks.c b/com32/hdt/hdt-dump-disks.c
index dcbcaa9e..ff744b30 100644
--- a/com32/hdt/hdt-dump-disks.c
+++ b/com32/hdt/hdt-dump-disks.c
@@ -42,6 +42,7 @@ static void show_partition_information(struct driveinfo *drive_info,
char ostype[64]={0};
char *parttype;
unsigned int start, end;
+ char bootable[6] = {0};
int i = nb_partitions_seen;
start = partition_offset;
@@ -52,6 +53,10 @@ static void show_partition_information(struct driveinfo *drive_info,
get_label(ptab->ostype, &parttype);
get_bootloader_string(drive_info, ptab, bootloader_name, 9);
+ if (ptab->active_flag == 0x80)
+ snprintf(bootable,sizeof(bootable),"%s","true");
+ else
+ snprintf(bootable,sizeof(bootable),"%s","false");
snprintf(ostype,sizeof(ostype),"%02X",ptab->ostype);
@@ -62,6 +67,7 @@ static void show_partition_information(struct driveinfo *drive_info,
add_as("partition->size",size)
add_as("partition->type",parttype)
add_as("partition->os_type",ostype)
+ add_as("partition->boot_flag",bootable)
END_OF_APPEND;
free(parttype);
}
@@ -117,7 +123,9 @@ void show_disk(struct s_hardware *hardware, ZZJSON_CONFIG *conf, ZZJSON **it, in
void dump_disks(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **item) {
bool found=false;
- for (int drive = 0x80; drive < 0xff; drive++) {
+
+ if (hardware->disks_count > 0)
+ for (int drive = 0x80; drive < 0xff; drive++) {
if (hardware->disk_info[drive - 0x80].cbios) {
if (found==false) {
CREATE_NEW_OBJECT;
@@ -131,7 +139,7 @@ void dump_disks(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **ite
if (found==false) {
CREATE_NEW_OBJECT;
add_b("disks->is_valid",false);
- FLUSH_OBJECT;
}
+ FLUSH_OBJECT;
to_cpio("disks");
}