Summary of changes:
- Rename extract_items args to be more generic.
- For many other functions, replace large argument lists with
the OPTIONS shared object.
- Rename process_* functions to merge_* to be more clear about
the purpose of the function.
- Remove verbose code in merge_ab_partitions_txt().
- Extract certain logic from merge_misc_info_txt() and place it
into other existing functions: dynamic partition and selinux
keys are now processed in their own functions.
- Remove verbose code in merge_package_keys_txt().
- Remove verbose code in create_file_contexts_copies().
- Handle extracting from META directly in merge_meta_files(),
rather than doing this extraction in create_merged_package()
- Storing the set of framework and vendor partitions in OPTIONS
so it can be reused by multiple functions without needing to
be parsed again.
Bug: 221858722
Test: atest test_merge_target_files
Test: Use merge_target_files to merge some builds
Change-Id: I8aa429c8fbb05223127b116aab84b2678ac264a8
Includes more folks to increase "bus factor" for these files,
as well as including the merge test.
Change-Id: I8a5e8d1600fd4e03f75338193609f496a964f790
Companion change of I143680b1cab50a6915df56c8273f8741beaf1180.
Basically does the same thing as the other change.
Bug: 211741246
Test: m dist
Test: ./boot_signature_info.sh boot-5.10.img
Change-Id: I40c4d5866c74a9a2d525f9455969b8a71f22bdbb
The virt APEX payload public key needs to be embedded in pvmfw so that
is verifies the right set of images. As things are being resigned,
update that embedded key so that it matches the APEX.
Bug: 220018566
Test: sign_target_files_apks
Change-Id: I09be91275ec1d1aa6f921c54a96c5159571ddead
Add recovery-from-boot.p for device with
BOARD_USES_FULL_RECOVERY_IMAGE disabled
Bug: 219871887
Change-Id: Id4bafaa44afe28f57e0a35846012073307965940
Test: Used to merge non-AB VF device
For vendor freeze, vendor.img/odm.img is rebuilt and moved to
the merged target files dir in a special build flow:
https://android-review.googlesource.com/c/platform/build/+/1752968
But considering non-AB case, some more files are generated by
MakeRecoveryPatch() along with vendor.img, such as:
IMAGES/vendor.map
VENDOR/etc/recovery.img
VENDOR/bin/install-recovery.sh
They should be copied to the merged target files dir as well,
in order to pass the check in HasRecoveryPatch() and
GetSparseImage().
Bug: 219871887
Test: Used to merge non-AB VF device
Change-Id: I003186b30e700413d54ee1b7521bd03ba83ad3f5
The protobuf addition is present only in S+
while the legacy metadata is always present
Test: tools/gen_update_config.py with ota from R
Change-Id: I482c75b6b3b2b1ade139e59dc9dc57dbf9731d45
This is bad, python already prints exceptino message and exit with
non-zero code when an exception is raised, no need to catch the
exception just to print it. In addition, printing an exception does not
print stacktrace, so catch + sys.exit provide less information than
python's default behavior.
Test: th
Change-Id: If6cf2e34d4ebc9f7d172063b4396bf4377dad447
This function is already called by add_img_to_target_files, when needed.
Bug: 187432243
Test: Create a merged build with ab partitions and OTA package
Change-Id: I1d1ec878f4dcf16c8fcbbea10e787a78d1478328
Some mountpoints are only available at device runtime, so ignore import
failures in release tools.
Bug: 214322896
Test: th
Change-Id: I1e8c4fb08c6b825fa19c0f0e019dfaf2b03f2927
boot.img and init_boot.img get their build properties from the platform
ramdisk properties.
Test: "m dist" then drop the OTA zip file into
android.github.io/analyseOTA to verify init_boot is present.
Bug: 211823573
Change-Id: I411e62bf0fc3cb49d4b12dadb52d9820fca041fa
zip -d doesn't work when no entry names specified. So if the list of
entry is empty, just skip calling zip -d.
Bug: 218438888
Test: th
Change-Id: Ie4419b9d6fdc2780255c6f12f9f4d35e5c0a7b26
Otatools archive can be unpacked to an arbitrary directory together
with bundled external/avb/test/data keys. Calling add_img_to_target_files
from a different directory fails to build an image which has
avb_{}_key_path pointing to the bundled key since add_hash_footer
can't find the key file.
Fix this by applying the same logic as in common.AppendAVBSigningArgs.
Steps to reproduce:
$ . build/envsetup.sh && lunch aosp_cf_arm64_phone-userdebug && make dist
$ cd out/dist && rm -rf otatools && unzip otatools.zip -d otatools
$ zip -d aosp_cf_arm64_phone-*target_files*.zip IMAGES/system_other.img
$ otatools/bin/add_img_to_target_files -a -v -p otatools \
aosp_cf_arm64_phone-target_files-*.zip
Bug: 218531463
Test: manual, see "steps to reproduce" above
Change-Id: Id3f7cf2678e998ef1beda2b6741944c6455c2404
The intention is to skip current iteration of for loop, so 'continue'
should be used instead of 'pass'
Test: th
Change-Id: Ic955beeaef74100981b351e2e7807c7fde538783
apex_utils.SignApex() has `signing_args` argument which is supposed to
be passed to avbtool to set `--signing_helper` or
`--signing_helper_with_files`.
A custom APEX signing tool which relies on avbtool's signing should pass
the same arguments when signing_args is set.
This change passes signing_args verbatim to the custom APEX signing tool
via --signing_args argument.
Bug: 216971834
Test: tbd
Change-Id: I8aaec9440c4536e11e1e4a1dd4ae5f4fe32d4f23