summaryrefslogtreecommitdiffstats
path: root/doc/README.gpt
diff options
context:
space:
mode:
authorFarhan Ali <farhan.ali@broadcom.com>2021-02-26 10:17:33 -0800
committerTom Rini <trini@konsulko.com>2021-05-04 12:52:46 -0400
commit653cd92d66771cf1fbd1b7612b06a0874d316654 (patch)
tree660a3ba2c59d39c3115a229be57e780d50294212 /doc/README.gpt
parent8c72842af5f81826b344c26b1c28c3122edb909e (diff)
downloadu-boot-653cd92d66771cf1fbd1b7612b06a0874d316654.tar.gz
u-boot-653cd92d66771cf1fbd1b7612b06a0874d316654.tar.xz
u-boot-653cd92d66771cf1fbd1b7612b06a0874d316654.zip
cmd: gpt: Add option to write GPT partitions to environment variable
This change would enhance the existing 'gpt read' command to allow (optionally) writing of the read GPT partitions to an environment variable in the UBOOT partitions layout format. This would allow users to easily change the overall partition settings by editing said variable and then using the variable in the 'gpt write' and 'gpt verify' commands. Signed-off-by: Farhan Ali <farhan.ali@broadcom.com> Cc: Simon Glass <sjg@chromium.org> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Corneliu Doban <cdoban@broadcom.com> Cc: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com> Cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'doc/README.gpt')
-rw-r--r--doc/README.gpt17
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/README.gpt b/doc/README.gpt
index ac975f66b8..91e397d06f 100644
--- a/doc/README.gpt
+++ b/doc/README.gpt
@@ -237,6 +237,23 @@ doc/arch/index.rst:
=> gpt swap host 0 name othername
[ . . . ]
+Modifying GPT partition layout from U-Boot:
+===========================================
+
+The entire GPT partition layout can be exported to an environment
+variable and then modified enmasse. Users can change the partition
+numbers, offsets, names and sizes. The resulting variable can used to
+reformat the device. Here is an example of reading the GPT partitions
+into a variable and then modifying them:
+
+U-BOOT> gpt read mmc 0 current_partitions
+U-BOOT> env edit current_partitions
+edit: uuid_disk=[...];name=part1,start=0x4000,size=0x4000,uuid=[...];
+name=part2,start=0xc000,size=0xc000,uuid=[...];[ . . . ]
+
+U-BOOT> gpt write mmc 0 $current_partitions
+U-BOOT> gpt verify mmc 0 $current_partitions
+
Partition type GUID:
====================