Commit 49936b4c authored by David Zeuthen's avatar David Zeuthen Committed by Tao Bao
Browse files

libavb: Support vbmeta blobs in beginning of partition.

If we don't find a AvbFooter when resolving a chain descriptor, also
check if there's a vbmeta struct in the beginning. If there is, use
it.

This is to support the use-case where a single vbmeta_<orgname>
partition can hold metadata for several other partitions which may not
be easily readable by the bootloader (e.g. they are "logical"
partitions using a proprietary partitioning format). For example, this
supports the following setup

 vbmeta         # chain desc for vbmeta_google
 vbmeta_google  # hash desc for boot, dtbo and hashtree desc for system, vendor
 boot
 dtbo
 super          # container for system and vendor logical partitions
   system       # logical partition (not readable by bootloader)
   vendor       # logical partition (not readable by bootloader)

where vbmeta_google has the vbmeta struct in the beginning just as if
it were the main vbmeta partition.

Additional change: Previously it was optional to support the
get_size_of_partition() operation. Starting with this commit, this
operation is mandatory and must be implemented such that
AVB_IO_RESULT_ERROR_NO_SUCH_PARTITION is returned for partitions that
don't exist.

Also introduce a new 'extract_vbmeta_image' sub-command to avbtool
that can be used to extract the vbmeta blob from a footer.

Bug: 80195851
Test: New unit tests and all unit tests pass.
Change-Id: I92190259ff5c62894fc54081ff9e8bb5205e2786
parent 6f4de318
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment