diff options
author | Varun Sharma <vars@google.com> | 2020-04-10 15:22:31 -0700 |
---|---|---|
committer | Varun Sharma <vars@google.com> | 2020-04-15 10:30:00 -0700 |
commit | de53827b226bccef7407e4c253b0152e8d9f8e04 (patch) | |
tree | 0d4fc1c2f78f7d4c5f0542d48b919e66ee6d9138 /libavb/avb_vbmeta_image.h | |
parent | 452992ac4d96eb2f2385edccc466a80df76537b9 (diff) | |
download | avb-de53827b226bccef7407e4c253b0152e8d9f8e04.tar.gz |
Add configuration for main rollback index location
libavb makes the assumption that the main vbmeta rollback index is
always at location 0.
This change repurposes reserved space in the vbmeta header to allow a
non-zero primary rollback index location.
This required incrementing the AVB version to 1.2.
For context, in Fuchsia, we have a `vbmeta_r` partition in addition to
`vbmeta_a/b`, but we do not want to have to update recovery with every
ota. Having a separate rollback index for recovery will make this more
straightforward.
Test: All tests pass except AvbAftlValidateTest#AftlVerifyVbmetaHash.
Disabled that test. b/154115873 tracks reenabling it.
Bug: http://fxbug.dev/46185
Change-Id: Ifa03269b822a5e532c087ec835813f5e3e0efffc
Diffstat (limited to 'libavb/avb_vbmeta_image.h')
-rw-r--r-- | libavb/avb_vbmeta_image.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavb/avb_vbmeta_image.h b/libavb/avb_vbmeta_image.h index d0c9f15..f9cbac4 100644 --- a/libavb/avb_vbmeta_image.h +++ b/libavb/avb_vbmeta_image.h @@ -176,10 +176,12 @@ typedef struct AvbVBMetaImageHeader { */ uint32_t flags; - /* 124: Reserved to ensure |release_string| start on a 16-byte - * boundary. Must be set to zeroes. + /* 124: The location of the rollback index defined in this header. + * Only valid for the main vbmeta. For chained partitions, the rollback + * index location must be specified in the AvbChainPartitionDescriptor + * and this value must be set to 0. */ - uint8_t reserved0[4]; + uint32_t rollback_index_location; /* 128: The release string from avbtool, e.g. "avbtool 1.0.0" or * "avbtool 1.0.0 xyz_board Git-234abde89". Is guaranteed to be NUL |