[PATCH v2 0/8] cmd: gpt: GPT manipulation improvements

Joshua Watt
2023-08-23T16:48:09Z

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

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 | 159 ++++++++++++++++++++++++++++++++--
doc/usage/cmd/gpt.rst | 174 ++++++++++++++++++++++++++++++++++++++
test/py/tests/test_gpt.py | 151 ++++++++++++++++++++++++++++++---
3 files changed, 466 insertions(+), 18 deletions(-)
create mode 100644 doc/usage/cmd/gpt.rst

--
2.33.0