gpt_fill_pte() writes the full 64-bit GPT partition attributes field
when CONFIG_PARTITION_ATTR is enabled. However, part_get_info_efi(),
the counterpart function used to read a partition's info back from an
existing GPT never populated gpt_attr/gpt_attr_valid.

Populate gpt_attr from the on-disk GPT entry's raw attributes field,
and set gpt_attr_valid to true mirroring the write path in
gpt_fill_pte().

Signed-off-by: Sumit Singh Dhami <[email protected]>
---
 disk/part_efi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/disk/part_efi.c b/disk/part_efi.c
index 89cc36d9f0d..8f209f31ece 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -307,6 +307,8 @@ static int __maybe_unused part_get_info_efi(struct blk_desc 
*desc, int part,
        strcpy((char *)info->type, "U-Boot");
        info->bootable = get_bootable(&gpt_pte);
        info->type_flags = gpt_pte.attributes.fields.type_guid_specific;
+       if (CONFIG_IS_ENABLED(PARTITION_ATTR))
+               disk_partition_set_gpt_attr(info, gpt_pte.attributes.raw);
        if (CONFIG_IS_ENABLED(PARTITION_UUIDS)) {
                uuid_bin_to_str(gpt_pte.unique_partition_guid.b,
                                (char *)disk_partition_uuid(info),
-- 
2.55.0

Reply via email to