summaryrefslogtreecommitdiff
path: root/cmd/gpt.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-08-26 11:25:08 -0400
committerTom Rini <trini@konsulko.com>2023-08-26 11:25:08 -0400
commit11cf91f755c7b1f1c8e7865743ac589bd23b7099 (patch)
treeac16ffe5e84057ffa0d1c7e93d47c00d5c3ed532 /cmd/gpt.c
parent05763b71d2fcfe9729bf5ef0b14bd00c3af0c985 (diff)
parent453c3fb48141f60eb9b7ab5545d94c88dc5af40c (diff)
Merge branch '2023-08-26-bootstd-chromeos-impreovements-and-move-to-gcc-13.2' into next
First, update CI to using gcc-13.2 from 13.1, and rebuild the CI containers. This is needed because the second part adds utilities for tests and provides, to quote the author: This updates the ChromiumOS bootmeth to detect multiple kernel partitions on a disk. It also includes minor code improvements to the partition drivers, including accessors for the optional fields. This series also includes some other related tweaks in testing.
Diffstat (limited to 'cmd/gpt.c')
-rw-r--r--cmd/gpt.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/cmd/gpt.c b/cmd/gpt.c
index 007a68eaa72..8969efba8c8 100644
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -211,12 +211,10 @@ static struct disk_part *allocate_disk_part(struct disk_partition *info,
PART_TYPE_LEN);
newpart->gpt_part_info.type[PART_TYPE_LEN - 1] = '\0';
newpart->gpt_part_info.bootable = info->bootable;
-#ifdef CONFIG_PARTITION_UUIDS
- strncpy(newpart->gpt_part_info.uuid, (const char *)info->uuid,
- UUID_STR_LEN);
- /* UUID_STR_LEN is correct, as uuid[]'s length is UUID_STR_LEN+1 chars */
- newpart->gpt_part_info.uuid[UUID_STR_LEN] = '\0';
-#endif
+ if (IS_ENABLED(CONFIG_PARTITION_UUIDS)) {
+ strlcpy(newpart->gpt_part_info.uuid, disk_partition_uuid(info),
+ UUID_STR_LEN + 1);
+ }
newpart->partnum = partnum;
return newpart;