Skip to content

cmd: gpt: GPT manipulation improvements

Joshua Watt u-boot 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest8 patches 1 replyIn review
  2. v48 patches 6 repliesSuperseded
  3. v38 patches 11 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v28 patches9 repliesSuperseded
v16 patches4 repliesSuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8cmd: gpt: Remove confusing help textcmd/gpt.c+0 -20 replies
2/8doc: Add gpt command documentationdoc/usage/cmd/gpt.rst doc/usage/index.rst+185 -00 replies
3/8tests: gpt: Remove test order dependencytest/py/tests/test_gpt.py+8 -121 reply
4/8cmd: gpt: Add gpt_partition_bootable variablecmd/gpt.c doc/usage/cmd/gpt.rst test/py/tests/test_gpt.py+45 -20 replies
5/8cmd: gpt: Add command to set bootable flagscmd/gpt.c doc/usage/cmd/gpt.rst test/py/tests/test_gpt.py+114 -00 replies
6/8cmd: gpt: Preserve type GUID if enabledcmd/gpt.c test/py/tests/test_gpt.py+81 -00 replies
7/8cmd: gpt: Preserve bootable flagcmd/gpt.c test/py/tests/test_gpt.py+4 -00 replies
8/8cmd: gpt: Add command to swap partition ordercmd/gpt.c doc/usage/cmd/gpt.rst test/py/tests/test_gpt.py+87 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH v5 0/8] cmd: gpt: GPT manipulation improvements

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.

V2: Add documentation and tests
V3: Review Feedback
V4: More review feedback. Fixed 'gpt swap-position' to work with
missing partition indexes.
V5: Rename 'gpt swap-position' -> 'gpt transpose', taking inspiration

    from `sgdisk --transpose`

Joshua Watt (8):
cmd: gpt: Remove confusing help text
doc: Add gpt command documentation
tests: gpt: Remove test order dependency
cmd: gpt: Add gpt_partition_bootable variable
cmd: gpt: Add command to set bootable flags
cmd: gpt: Preserve type GUID if enabled
cmd: gpt: Preserve bootable flag
cmd: gpt: Add command to swap partition order

 cmd/gpt.c                 | 156 ++++++++++++++++++++++++--
 doc/usage/cmd/gpt.rst     | 226 ++++++++++++++++++++++++++++++++++++++
 doc/usage/index.rst       |   1 +
 test/py/tests/test_gpt.py | 160 +++++++++++++++++++++++++--
 4 files changed, 524 insertions(+), 19 deletions(-)
 create mode 100644 doc/usage/cmd/gpt.rst
Signature · 1 line
2.34.1