diff mbox

[U-Boot,v2,2/5] gpt: doc: README: Update README entry for gpt verify extension

Message ID 1448003177-26917-3-git-send-email-l.majewski@majess.pl
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Lukasz Majewski Nov. 20, 2015, 7:06 a.m. UTC
./doc/README.gpt entry has been updated to explain usage of "gpt verify"
command.

Signed-off-by: Lukasz Majewski <l.majewski@majess.pl>
Reviewed-by: Tom Rini <trini@konsulko.com>

---
Changes for v2:
- Adjust README.gpt changes to the newest mainline
---
 doc/README.gpt | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

Comments

Tom Rini Nov. 23, 2015, 10:44 p.m. UTC | #1
On Fri, Nov 20, 2015 at 08:06:14AM +0100, Lukasz Majewski wrote:

> ./doc/README.gpt entry has been updated to explain usage of "gpt verify"
> command.
> 
> Signed-off-by: Lukasz Majewski <l.majewski@majess.pl>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/doc/README.gpt b/doc/README.gpt
index 35902ce..db439f9 100644
--- a/doc/README.gpt
+++ b/doc/README.gpt
@@ -168,9 +168,34 @@  To restore GUID partition table one needs to:
 
 2. Define 'CONFIG_EFI_PARTITION' and 'CONFIG_CMD_GPT'
 
-2. From u-boot prompt type:
+3. From u-boot prompt type:
    gpt write mmc 0 $partitions
 
+Checking (validating) GPT partitions in U-Boot:
+===============================================
+
+Procedure is the same as above. The only change is at point 3.
+
+At u-boot prompt one needs to write:
+   gpt verify mmc 0 [$partitions]
+
+where [$partitions] is an optional parameter.
+
+When it is not provided, only basic checks based on CRC32 calculation for GPT
+header and PTEs are performed.
+When provided, additionally partition data - name, size and starting
+offset (last two in LBA) - are compared with data defined in '$partitions'
+environment variable.
+
+After running this command, return code is set to 0 if no errors found in
+on non-volatile medium stored GPT.
+
+Following line can be used to assess if GPT verification has succeed:
+
+U-BOOT> gpt verify mmc 0 $partitions
+U-BOOT> if test $? = 0; then echo "GPT OK"; else echo "GPT ERR"; fi
+
+
 Partition type GUID:
 ====================