diff options
author | Tom Rini <trini@konsulko.com> | 2023-09-12 11:13:17 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-09-12 11:13:17 -0400 |
commit | ce67ba1e30da583d03bf3cdd5b6ee75174c75f0a (patch) | |
tree | 51c12c17095b0724f2d6fee66bee932e0b2d7047 /include | |
parent | d8d1fd0e89b4c46d4ddbaf4332688523117369ea (diff) | |
parent | f5e4b056c47215cdbe8d8e30a12b036b7a6afa8d (diff) |
Merge branch '2023-09-12-gpt-improvements' into next
Bring in two series to improve GPT support. For the first series from
Joshua:
Adds several improvements and additions to the gpt command processing,
specifically (although not exclusively) for the purpose of supporting
"ping-pong" booting when doing A/B boot partitions with u-boot itself.
In this mechanism, u-boot must boot up, and then check if the correct
boot partition is active, and if not switch the GPT partition table to
the other boot partition and reboot to activate the other u-boot.
In order to facilitate this, the gpt command needs to be better at
preserving entry attributes when manipulating the partition table. It
also learns two new commands, one which can swap the order of partitions
in the table, and another that lets it change which partitions have the
bootable flag.
For the second series from Heinrich:
To partition a block device the partition type GUIDs are needed but
'gpt read' does not provide these. Add the missing parts.
There is some overlap in these two series but I believe I have merged
things correctly.
Diffstat (limited to 'include')
-rw-r--r-- | include/part.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/include/part.h b/include/part.h index f321479a5e..db34bc6bb7 100644 --- a/include/part.h +++ b/include/part.h @@ -108,18 +108,38 @@ static inline void disk_partition_clr_uuid(struct disk_partition *info) } /* Accessors for struct disk_partition field ->type_guid */ -extern char *__invalid_use_of_disk_partition_type_uuid; +extern char *__invalid_use_of_disk_partition_type_guid; +/** + * disk_partition_type_guid() - get partition type GUID + * + * By using this function to get the partition type GUID we can use + * 'if (IS_ENABLED(CONFIG_PARTITION_TYPE_GUID))' instead of + * '#ifdef CONFIG_PARTITION_TYPE_GUID'. + * + * @info: partition information + * Return: partition type GUID + */ static inline const -char *disk_partition_type_uuid(const struct disk_partition *info) +char *disk_partition_type_guid(const struct disk_partition *info) { #ifdef CONFIG_PARTITION_TYPE_GUID return info->type_guid; #else - return __invalid_use_of_disk_partition_type_uuid; + return __invalid_use_of_disk_partition_type_guid; #endif } +/** + * disk_partition_set_type_guid() - set partition type GUID + * + * By using this function to set the partition type GUID we can use + * 'if (IS_ENABLED(CONFIG_PARTITION_TYPE_GUID))' instead of + * '#ifdef CONFIG_PARTITION_TYPE_GUID'. + * + * @info: partition information + * @val: partition type GUID as string + */ static inline void disk_partition_set_type_guid(struct disk_partition *info, const char *val) { |