From 73d6d18b7147c90d6f8a60acb8dad663a225e63d Mon Sep 17 00:00:00 2001 From: Alison Chaiken Date: Sun, 25 Jun 2017 16:43:23 -0700 Subject: GPT: add accessor function for disk GUID In order to read the GPT, modify the partition name strings, and then write out a new GPT, the disk GUID is needed. While there is an existing accessor for the partition UUIDs, there is none yet for the disk GUID. Changes since v6: none. Signed-off-by: Alison Chaiken --- include/part.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include') diff --git a/include/part.h b/include/part.h index 22da6044823..c41aa6adc2a 100644 --- a/include/part.h +++ b/include/part.h @@ -372,6 +372,21 @@ int gpt_verify_headers(struct blk_desc *dev_desc, gpt_header *gpt_head, int gpt_verify_partitions(struct blk_desc *dev_desc, disk_partition_t *partitions, int parts, gpt_header *gpt_head, gpt_entry **gpt_pte); + + +/** + * get_disk_guid() - Function to read the GUID string from a device's GPT + * + * This function reads the GUID string from a block device whose descriptor + * is provided. + * + * @param dev_desc - block device descriptor + * @param guid - pre-allocated string in which to return the GUID + * + * @return - '0' on success, otherwise error + */ +int get_disk_guid(struct blk_desc *dev_desc, char *guid); + #endif #if CONFIG_IS_ENABLED(DOS_PARTITION) -- cgit v1.2.3