[PATCH 2/2] partitions/efi: Add partuuid to partition description

Trent Piepho tpiepho at kymetacorp.com
Wed Dec 9 14:04:31 PST 2015


In commit bc31d85c6e23d724664e76bcfc3b2eda778012a3 the partition UUID
was added to the partition struct and thence to the cdev(s) for the
partition.  But just for DOS partitions.  Do this for GPT aka EFI
partitions too.

Signed-off-by: Trent Piepho <tpiepho at kymetacorp.com>
---
 common/partitions/Kconfig | 1 +
 common/partitions/efi.c   | 1 +
 2 files changed, 2 insertions(+)

diff --git a/common/partitions/Kconfig b/common/partitions/Kconfig
index 90238ad..be9405a 100644
--- a/common/partitions/Kconfig
+++ b/common/partitions/Kconfig
@@ -16,6 +16,7 @@ config PARTITION_DISK_DOS
 config PARTITION_DISK_EFI
 	depends on PARTITION_DISK
 	select CRC32
+	select PRINTF_UUID
 	bool "EFI: GPT partition support"
 	help
 	  Add support to handle partitions in GUID Partition Table style.
diff --git a/common/partitions/efi.c b/common/partitions/efi.c
index 61abf00..061f7b4 100644
--- a/common/partitions/efi.c
+++ b/common/partitions/efi.c
@@ -457,6 +457,7 @@ static void efi_partition(void *buf, struct block_device *blk,
 		pentry->size = le64_to_cpu(ptes[i].ending_lba) - pentry->first_sec;
 		pentry->size++;
 		part_set_efi_name(&ptes[i], pentry->name);
+		snprintf(pentry->partuuid, sizeof(pentry->partuuid), "%pU", &ptes[i].unique_partition_guid);
 		pd->used_entries++;
 	}
 
-- 
1.8.3.1




More information about the barebox mailing list