diff options
author | Tom Rini <trini@konsulko.com> | 2023-09-12 11:13:17 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-09-12 11:13:17 -0400 |
commit | ce67ba1e30da583d03bf3cdd5b6ee75174c75f0a (patch) | |
tree | 51c12c17095b0724f2d6fee66bee932e0b2d7047 /doc/usage/cmd/gpt.rst | |
parent | d8d1fd0e89b4c46d4ddbaf4332688523117369ea (diff) | |
parent | f5e4b056c47215cdbe8d8e30a12b036b7a6afa8d (diff) |
Merge branch '2023-09-12-gpt-improvements' into next
Bring in two series to improve GPT support. For the first series from
Joshua:
Adds several improvements and additions to the gpt command processing,
specifically (although not exclusively) for the purpose of supporting
"ping-pong" booting when doing A/B boot partitions with u-boot itself.
In this mechanism, u-boot must boot up, and then check if the correct
boot partition is active, and if not switch the GPT partition table to
the other boot partition and reboot to activate the other u-boot.
In order to facilitate this, the gpt command needs to be better at
preserving entry attributes when manipulating the partition table. It
also learns two new commands, one which can swap the order of partitions
in the table, and another that lets it change which partitions have the
bootable flag.
For the second series from Heinrich:
To partition a block device the partition type GUIDs are needed but
'gpt read' does not provide these. Add the missing parts.
There is some overlap in these two series but I believe I have merged
things correctly.
Diffstat (limited to 'doc/usage/cmd/gpt.rst')
-rw-r--r-- | doc/usage/cmd/gpt.rst | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/doc/usage/cmd/gpt.rst b/doc/usage/cmd/gpt.rst index 6387c8116f..f6115ecb0e 100644 --- a/doc/usage/cmd/gpt.rst +++ b/doc/usage/cmd/gpt.rst @@ -13,8 +13,10 @@ Synopsis gpt read <interface> <dev> [<varname>] gpt rename <interface> <dev> <part> <name> gpt repair <interface> <dev> + gpt set-bootable <interface> <dev> <partition list> gpt setenv <interface> <dev> <partition name> gpt swap <interface> <dev> <name1> <name2> + gpt transpose <interface> <dev> <part1> <part2> gpt verify <interface> <dev> [<partition string>] gpt write <interface> <dev> <partition string> @@ -90,6 +92,13 @@ gpt repair Repairs the GPT partition tables if it they become corrupted. +gpt set-bootable +~~~~~~~~~~~~~~~~ + +Sets the bootable flag for all partitions in the table. If the partition name +is in 'partition list' (separated by ','), the bootable flag is set, otherwise +it is cleared. CONFIG_CMD_GPT_RENAME=y is required. + gpt setenv ~~~~~~~~~~ @@ -108,6 +117,9 @@ gpt_partition_name gpt_partition_entry the partition number in the table, e.g. 1, 2, 3, etc. +gpt_partition_bootable + 1 if the partition is marked as bootable, 0 if not + gpt swap ~~~~~~~~ @@ -115,6 +127,13 @@ Changes the names of all partitions that are named 'name1' to be 'name2', and all partitions named 'name2' to be 'name1'. CONFIG_CMD_GPT_RENAME=y is required. +gpt transpose +~~~~~~~~~~~~~ + +Swaps the order of two partition table entries with indexes 'part1' and 'part2' +in the partition table, but otherwise leaves the actual partition data +untouched. + gpt verify ~~~~~~~~~~ @@ -167,6 +186,8 @@ Get the information about the partition named 'rootfs':: rootfs => echo ${gpt_partition_entry} 2 + => echo ${gpt_partition_bootable} + 0 Get the list of partition names on the disk:: @@ -182,3 +203,24 @@ Get the GUID for a disk:: => gpt guid mmc gpt_disk_uuid => echo ${gpt_disk_uuid} bec9fc2a-86c1-483d-8a0e-0109732277d7 + +Set the bootable flag for the 'boot' partition and clear it for all others:: + + => gpt set-bootable mmc 0 boot + +Swap the order of the 'boot' and 'rootfs' partition table entries:: + => gpt setenv mmc 0 rootfs + => echo ${gpt_partition_entry} + 2 + => gpt setenv mmc 0 boot + => echo ${gpt_partition_entry} + 1 + + => gpt transpose mmc 0 1 2 + + => gpt setenv mmc 0 rootfs + => echo ${gpt_partition_entry} + 1 + => gpt setenv mmc 0 boot + => echo ${gpt_partition_entry} + 2 |