Commit cbcdb4f7 authored by Monika Singh's avatar Monika Singh
Browse files

Fix the identification of vbmeta partition

After dynamic partition, vbmeta_system and vbemta_vendor partitions
are added. Therefore, partitions with 'vbmeta' prefix should be treated
as vbmeta partition.

This makes libavb avoid locating avb footer from the end of vbmeta_*
partitions. And will not emit the following error message, which could
be confusing even if the following read of vbmeta succeeds from the
beginning of the partition.

Run the following test case will show different results after this
change.

$ ./out/host/linux-x86/nativetest64/libavb_host_unittest/libavb_host_unittest
--gtest_filter=AvbSlotVerifyTest.HashDescriptorInOtherVBMetaPartition

Before this change
-------------------------------------------------------------------------------
[ RUN      ] AvbSlotVerifyTest.HashDescriptorInOtherVBMetaPartition
avb_slot_verify.c:678: DEBUG: Loading vbmeta struct from partition 'vbmeta'.
avb_footer.c:41: ERROR: Footer magic is incorrect.
avb_slot_verify.c:650: DEBUG: vbmeta_google: No footer detected.
avb_slot_verify.c:678: DEBUG: Loading vbmeta struct from partition
'vbmeta_google'.
[       OK ] AvbSlotVerifyTest.HashDescriptorInOtherVBMetaPartition (960 ms)

After this change
-------------------------------------------------------------------------------
[ RUN      ] AvbSlotVerifyTest.HashDescriptorInOtherVBMetaPartition
avb_slot_verify.c:683: DEBUG: Loading vbmeta struct from partition 'vbmeta'.
avb_slot_verify.c:683: DEBUG: Loading vbmeta struct from partition 'vbmeta_google'.
[       OK ] AvbSlotVerifyTest.HashDescriptorInOtherVBMetaPartition (961ms)

Bug: b/134989217
Test: device launch, verify vbmeta, vbmeta_system, vbmeta_vendor.
Test: m libavb_host_unittest -j8 && \
      ./out/host/linux-x86/nativetest64/libavb_host_unittest/libavb_host_unittest
Change-Id: Ib0c2cd56197508fef8c12985e8cc0cd79469556c
parent dd8ff497
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment