From fbe66f6bcf68eeba8cb7f02c5b78ac07bee64626 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 18 Feb 2010 23:01:38 +0100 Subject: [PATCH] libblkid: add PART_ENTRY_{SCHEME,NUMBER} Signed-off-by: Karel Zak --- shlibs/blkid/src/blkidP.h | 2 +- shlibs/blkid/src/partitions/partitions.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/shlibs/blkid/src/blkidP.h b/shlibs/blkid/src/blkidP.h index 7dc39fc3..c9b2bcd1 100644 --- a/shlibs/blkid/src/blkidP.h +++ b/shlibs/blkid/src/blkidP.h @@ -119,7 +119,7 @@ struct blkid_chaindrv { #define BLKID_NVALS_SUBLKS 14 #define BLKID_NVALS_TOPLGY 5 -#define BLKID_NVALS_PARTS 1 +#define BLKID_NVALS_PARTS 8 /* Max number of all values in probing result */ #define BLKID_NVALS (BLKID_NVALS_SUBLKS + \ diff --git a/shlibs/blkid/src/partitions/partitions.c b/shlibs/blkid/src/partitions/partitions.c index d3ba6f29..35fd8b28 100644 --- a/shlibs/blkid/src/partitions/partitions.c +++ b/shlibs/blkid/src/partitions/partitions.c @@ -713,6 +713,14 @@ static int blkid_partitions_probe_partition(blkid_probe pr) par = blkid_partlist_devno_to_partition(ls, devno); if (par) { const char *v; + blkid_parttable tab = blkid_partition_get_table(par); + + if (tab) { + v = blkid_parttable_get_type(tab); + if (v) + blkid_probe_set_value(pr, "PART_ENTRY_SCHEME", + (unsigned char *) v, strlen(v) + 1); + } v = blkid_partition_get_name(par); if (v) @@ -736,6 +744,9 @@ static int blkid_partitions_probe_partition(blkid_probe pr) if (blkid_partition_get_flags(par)) blkid_probe_sprintf_value(pr, "PART_ENTRY_FLAGS", "0x%llx", blkid_partition_get_flags(par)); + + blkid_probe_sprintf_value(pr, "PART_ENTRY_NUMBER", + "%d", blkid_partition_get_partno(par)); } rc = 0; nothing: -- 2.39.5