cmd: part: Add partition-related type command
This implements the following command:
part type mmc 0:1
-> print partition type UUID
part type mmc 0:1 uuid
-> set environment variable to partition type UUID
"part type" can be useful when writing a bootcmd which searches for a
specific partition type to enable automatic discovery of partitions and
their intended usage or mount point.
Signed-off-by: Enric Balletbo i Serra <eballetbo@redhat.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix when CONFIG_PARTITION_TYPE_GUID is disabled and have the
command check for "types" before "type"]
Signed-off-by: Tom Rini <trini@konsulko.com>
diff --git a/doc/usage/cmd/part.rst b/doc/usage/cmd/part.rst
index ed464b1..8d2a280 100644
--- a/doc/usage/cmd/part.rst
+++ b/doc/usage/cmd/part.rst
@@ -13,6 +13,7 @@
part start <interface> <dev> <part> <varname>
part size <interface> <dev> <part> <varname>
part number <interface> <dev> <part> <varname>
+ part type <interface> <dev>:<part> [varname]
part types
Description
@@ -81,6 +82,17 @@
varname
a variable to store the current partition number value into
+The 'part type' command prints or sets an environment variable to the partition type UUID.
+
+ interface
+ interface for accessing the block device (mmc, sata, scsi, usb, ....)
+ dev
+ device number
+ part
+ partition number
+ varname
+ a variable to store the current partition type UUID value into
+
The 'part types' command list supported partition table types.
Examples
@@ -126,6 +138,12 @@
=> env print varname
varname=0x2
=>
+ => part type host 0:1
+ ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
+ => part type host 0:1 varname
+ => env print varname
+ varname=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
+ =>
=> part types
Supported partition tables: EFI, AMIGA, DOS, ISO, MAC