From: Alison Chaiken <ali...@she-devel.com> One way for userspace and the bootloader to exchange information about dynamic image selection is via the storage device partition table, as described at
https://source.android.com/devices/tech/ota/ab_updates The scheme described there relies on setting partitions' "boot" flag. When no partition on a device is bootable since the kernel and U-Boot are stored elsewhere, the name field in the GPT partition table offers another logical place to store information. These patches allow users to easily modify GPT partition names via bootscripts that can select different images based on a boot-failure counter, or when userspace installs a software update. These patches have been tested on a TI DRA7xx-based SOM with U-Boot 2015.07. The storage device is an eMMC. Significant changes since v1: -- Put the gpt_flip() function and auxiliary ones inside a new CONFIG_CMD_GPT_FLIP option that depends on CMD_GPT. -- Replace intentional overwriting of name and type string arrays with memset() instead. -- Move part.h changes earlier in the patchset. -- Add a few lines to README.gpt about the new gpt subcommands. Added a few simple patches to do the following: -- Replace remaining occurrences of '37' with UUID_STR_LEN+1; -- Introduce new macros to get rid of the similar '32'; -- fix a smaller error in doc/README.gpt. There are also some fixups of whitespace and formatting errors (plus usual inevitable addition of new ones). To do in future: -- Add support for preserving the type flag for partitions. The u-boot version on which this patchset is based did not have this feature, and it's easy to add, but I need to figure how to test it first. Alison Chaiken (6): EFI: replace number with UUID_STR_LEN macro disk_partition: introduce macros for description string lengths GPT: add accessor function for disk GUID GPT: read partition table from device into a data structure rename GPT partitions to detect boot failure GPT: fix error in partitions string doc cmd/Kconfig | 7 ++ cmd/gpt.c | 322 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- disk/part_efi.c | 33 +++++- doc/README.gpt | 24 ++++- include/part.h | 35 +++++- 5 files changed, 410 insertions(+), 11 deletions(-) -- 2.1.4 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot