summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2023-08-31 10:51:37 -0600
committerTom Rini <trini@konsulko.com>2023-09-11 16:24:46 -0400
commitb1433affd9a9de10150c31929564f68ca338911a (patch)
treeb4248a39d38a0dfc0182071138fcc038a224681b /cmd
parenta3eb350649757efc5eac3bfe41d1fbf0e51b0690 (diff)
downloadu-boot-b1433affd9a9de10150c31929564f68ca338911a.tar.gz
u-boot-b1433affd9a9de10150c31929564f68ca338911a.tar.bz2
u-boot-b1433affd9a9de10150c31929564f68ca338911a.zip
cmd: gpt: Add gpt_partition_bootable variable
Adds an additional variable called gpt_partition_bootable that indicates if the given partition is bootable or not. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gpt.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmd/gpt.c b/cmd/gpt.c
index 3cc6436b28..ce85632377 100644
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -723,7 +723,7 @@ static int gpt_enumerate(struct blk_desc *desc)
* gpt_setenv_part_variables() - setup partition environmental variables
*
* Setup the gpt_partition_name, gpt_partition_entry, gpt_partition_addr
- * and gpt_partition_size environment variables.
+ * and gpt_partition_size, gpt_partition_bootable environment variables.
*
* @pinfo: pointer to disk partition
* @i: partition entry
@@ -750,6 +750,10 @@ static int gpt_setenv_part_variables(struct disk_partition *pinfo, int i)
if (ret)
goto fail;
+ ret = env_set_ulong("gpt_partition_bootable", !!(pinfo->bootable & PART_BOOTABLE));
+ if (ret)
+ goto fail;
+
return 0;
fail:
@@ -1055,7 +1059,8 @@ U_BOOT_CMD(gpt, CONFIG_SYS_MAXARGS, 1, do_gpt,
" gpt setenv mmc 0 $name\n"
" - setup environment variables for partition $name:\n"
" gpt_partition_addr, gpt_partition_size,\n"
- " gpt_partition_name, gpt_partition_entry\n"
+ " gpt_partition_name, gpt_partition_entry,\n"
+ " gpt_partition_bootable\n"
" gpt enumerate mmc 0\n"
" - store list of partitions to gpt_partition_list environment variable\n"
" gpt guid <interface> <dev>\n"