diff options
author | Joshua Watt <jpewhacker@gmail.com> | 2023-08-31 10:51:40 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-09-11 16:27:49 -0400 |
commit | 648140f77aff55d3bab072166a88ef179c474524 (patch) | |
tree | 0539a471cd84a6c956c2c52572aeea92fe741a5e /cmd/gpt.c | |
parent | 368beaf7bb609b1daede46e3b31f5788d52e44e5 (diff) | |
download | u-boot-648140f77aff55d3bab072166a88ef179c474524.tar.gz u-boot-648140f77aff55d3bab072166a88ef179c474524.tar.bz2 u-boot-648140f77aff55d3bab072166a88ef179c474524.zip |
cmd: gpt: Preserve bootable flag
Sets the bootable flag when constructing the partition string from the
current partition configuration. This ensures that when the partitions
are written back (for example, when renaming a partition), the flag is
preserved.
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Diffstat (limited to 'cmd/gpt.c')
-rw-r--r-- | cmd/gpt.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -176,6 +176,7 @@ static int calc_parts_list_len(int numparts) #ifdef CONFIG_PARTITION_TYPE_GUID partlistlen += numparts * (strlen("type=,") + UUID_STR_LEN + 1); #endif + partlistlen += numparts * strlen("bootable,"); partlistlen += numparts * (strlen("uuid=;") + UUID_STR_LEN + 1); /* for the terminating null */ partlistlen++; @@ -316,6 +317,8 @@ static int create_gpt_partitions_list(int numparts, const char *guid, strcat(partitions_list, ",uuid="); strncat(partitions_list, curr->gpt_part_info.uuid, UUID_STR_LEN + 1); + if (curr->gpt_part_info.bootable & PART_BOOTABLE) + strcat(partitions_list, ",bootable"); strcat(partitions_list, ";"); } return 0; |