Commit graph

2557 commits

Author SHA1 Message Date
Treehugger Robot
0b6921be2b Merge "Add SPL downgrade option help text" 2022-03-03 17:56:41 +00:00
Treehugger Robot
5b48aeccb2 Merge "Clean up merge_target_files" 2022-03-02 23:51:31 +00:00
Kelvin Zhang
e174c323e1 Add SPL downgrade option help text
Test: th
Change-Id: I71f916642f6327acad1d0c163a204718002f876d
2022-03-01 15:59:08 -08:00
Daniel Norman
5177fcb28d Fix releasetools OWNERS for merge.
My extra _ meant that OWNERS was removed for merge_target_files.

Change-Id: I15f89b9edf31d126df19b66998520e8545cdfbd0
2022-03-01 17:58:34 +00:00
Yi-yo Chiang
9d164b6300 Merge changes from topic "gki-avb-vts"
* changes:
  releasetools: Update T GKI certification scheme
  Update T GKI certification scheme
2022-03-01 04:47:47 +00:00
Daniel Norman
0374741b7b Clean up merge_target_files
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
2022-02-28 16:48:27 -08:00
Daniel Norman
4cf1e03c1c Add to OWNERS for merge tooling.
Includes more folks to increase "bus factor" for these files,
as well as including the merge test.

Change-Id: I8a5e8d1600fd4e03f75338193609f496a964f790
2022-02-28 22:30:49 +00:00
Baligh Uddin
be2d7d0ce1 Ignore cleanup errors.
Certain binaries may have restrictive permissions.

BUG: 221492085
Test: TH
Change-Id: I56f3c172d9e2c3947e513bdf0b2072457061c547
2022-02-26 02:35:25 +00:00
Tianjie Xu
45714a047e Update owner
Change-Id: I11931bcc51408db3ea8d75db67691ee3eb6e0194
Test: N/A
2022-02-25 19:21:48 +00:00
Jooyung Han
4d0af554ce Merge "Replace pvmfw embedded public key" 2022-02-25 06:39:20 +00:00
Treehugger Robot
bc5a49b504 Merge "Fix ota_from_target_files error in non-AB VF" 2022-02-25 03:03:17 +00:00
Treehugger Robot
14ec6f4157 Merge "Remove catch + sys.exit idiom" 2022-02-25 00:35:45 +00:00
Yi-Yo Chiang
24da1a43bb releasetools: Update T GKI certification scheme
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
2022-02-24 21:50:18 +08:00
Melisa Carranza Zúñiga
77c1dfa6d9 Merge "Adding flags and logic to sign updateable SEPolicy in APEX" 2022-02-23 16:36:16 +00:00
Andrew Scull
bbc930b008 Replace pvmfw embedded public key
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
2022-02-23 16:27:57 +00:00
Po Hu
760de672c7 Fix ota_from_target_files error in non-AB VF
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
2022-02-23 07:29:24 +00:00
David Anderson
c25bd3c8a0 Merge "Revise partition size for system_other.img" 2022-02-19 01:28:24 +00:00
Treehugger Robot
68f7e84519 Merge "Fix ota_from_target_files error in non-AB VF" 2022-02-19 01:19:24 +00:00
Melisa Carranza Zuniga
46930d7a85 Adding flags and logic to sign updateable SEPolicy in APEX
Verify with command:
sign_apex --container_key=testdata/testkey
--payload_key=testdata/testkey_RSA4096.key
--sepolicy_key=testdata/testkey_RSA4096.key
--sepolicy_cert=testdata/testkey.x509.pem
$OUT/system/apex/com.android.sepolicy.apex
$OUT/test/sepolicy.apex

Test: mma and run sign_apex
Change-Id: I8cc5bbc09058b57e463b1d40d4953d62e0438389
2022-02-19 00:01:09 +01:00
Po Hu
a6c5912e4d Fix ota_from_target_files error in non-AB VF
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
2022-02-18 13:25:51 -08:00
Daniel Norman
27cbdd9809 Merge changes I1d1ec878,I25c1dc20
* changes:
  Remove unnecessary AddCareMapForAbOta() in merge_target_files.
  Run pyformat on merge_target_files.py
2022-02-18 21:23:19 +00:00
Treehugger Robot
07491322c3 Merge "ota_utils: Don't fail if metadata proto doesn't exist" 2022-02-18 21:20:07 +00:00
Luca Stefani
b6075c581b ota_utils: Don't fail if metadata proto doesn't exist
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
2022-02-18 11:37:43 +00:00
Treehugger Robot
3e77f44587 Merge "check_target_vintf: Properly glob Vintf file list" 2022-02-18 09:22:16 +00:00
Po Hu
1c48b59aa1 Revise partition size for system_other.img
system_other may be dynamic partition.
Do not fix its partition size as system's.

Bug: 220258352
Change-Id: Iacd14769ec14f43e3871d3c50a6627e6471284b1
2022-02-18 09:11:40 +00:00
Treehugger Robot
52f1acbd93 Merge "Emit warning when build.prop import can't be resolved" 2022-02-18 05:58:27 +00:00
Treehugger Robot
a88313f60b Merge "Improve error message for GetMinSdkVersion" 2022-02-18 05:58:23 +00:00
Kelvin Zhang
07c71ac1b9 Remove catch + sys.exit idiom
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
2022-02-17 21:46:21 -08:00
Daniel Norman
a84d13bc6e Remove unnecessary AddCareMapForAbOta() in merge_target_files.
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
2022-02-17 14:16:40 -08:00
Daniel Norman
e292f5f105 Run pyformat on merge_target_files.py
Test: n/a
Change-Id: I25c1dc20c367e6b733e9fa4ea77d1873f5ba9a9b
2022-02-17 14:16:10 -08:00
Daniel Norman
f14e8caca7 Merge "Fix build break for vendor freeze" 2022-02-17 22:01:22 +00:00
Kelvin Zhang
42ab828754 Emit warning when build.prop import can't be resolved
Some mountpoints are only available at device runtime, so ignore import
failures in release tools.

Bug: 214322896
Test: th
Change-Id: I1e8c4fb08c6b825fa19c0f0e019dfaf2b03f2927
2022-02-17 13:07:55 -08:00
Inseob Kim
293112d59a Fix warning when running fsverity tools
Bug: 219777071
Test: m fsverity_manifest_generator; fsverity_manifest_generator
Change-Id: Ib5dd55b24a81438b9d536bf29c7ff2b4a91faf3f
2022-02-16 11:22:03 +09:00
Kelvin Zhang
21118bba67 Improve error message for GetMinSdkVersion
Bug: 219148978
Test: th
Change-Id: I72c653b6e7e159abf0b7aca394cf465869542483
2022-02-12 09:41:18 -08:00
Devin Moore
b5195ff5fe Get build.prop for init_boot.img from the ramdisk props
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
2022-02-11 18:44:26 +00:00
Treehugger Robot
ea586a8d71 Merge "Fix signing failure when no entry to convert to store" 2022-02-10 12:53:00 +00:00
Kelvin Zhang
b69bcdec29 Merge "Support relative key path in VerifiedBootVersion2VerityImageBuilder" 2022-02-10 04:42:35 +00:00
Kelvin Zhang
70876143b5 Fix signing failure when no entry to convert to store
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
2022-02-09 16:07:29 -08:00
Oleksiy Avramchenko
166d819fe4 Support relative key path in VerifiedBootVersion2VerityImageBuilder
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
2022-02-09 19:47:18 +01:00
Iavor-Valentin Iftime
756b56125a Fix python3 errors: "TypeError: write() argument must be str, not bytes"
Bug: 186097910

Change-Id: I191c3230596026ee327c1403a6c72fbfa6fdb2d9
2022-02-09 16:02:33 +00:00
Treehugger Robot
6daac9c78d Merge "system_dlkm: add to the non AB ota" 2022-02-09 06:18:43 +00:00
Ramji Jiyani
7ecb0ec9f8 system_dlkm: add to the non AB ota
Test: TH
Bug: 200082547
Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
Change-Id: Ib43ff411c17a96656a677e3a437e834884a0372f
2022-02-09 02:53:07 +00:00
Jooyung Han
3a61599999 Merge "A custom APEX signing tool with --signing_args" 2022-02-08 11:23:24 +00:00
Kelvin Zhang
846f285d55 Update APK parser to be compatible with new signer output
Test: th
Bug: 218304082
Change-Id: If79ffdb1e4cec192ef796a39dd0ed5b38bc430e0
2022-02-07 16:38:09 -08:00
Kelvin Zhang
9d021e996b Fix small misuse of pass
The intention is to skip current iteration of for loop, so 'continue'
should be used instead of 'pass'

Test: th
Change-Id: Ic955beeaef74100981b351e2e7807c7fde538783
2022-02-07 16:38:09 -08:00
Jooyung Han
39259ec1a4 A custom APEX signing tool with --signing_args
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
2022-02-07 15:56:53 +09:00
Kelvin Zhang
834f5d458f Store EROFS images uncompressed
Test: th
Change-Id: I53005bee139079afe25da231ca1d42f03fa010a5
2022-02-02 12:52:34 -08:00
Kelvin Zhang
4f8f972a5b Add zhangkelvin@ as owner for release tools scripts
Change-Id: Ic861bc11d6a7d80c0d22a05ce35998753bb60752
2022-02-02 12:52:34 -08:00
Ramji Jiyani
13a4137929 core & tools: system_dlkm: add dynamic partition
Converts existing static partition support to a
dynamic partition.

Bug: 200082547
Test: TH
Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
Change-Id: Ifd6d0c2a04e947b16f8b241e99cca594a1d315ae
2022-01-30 08:43:08 +00:00
Treehugger Robot
766c5343e2 Merge "Add a version code and version name to fsverity manifest APK" 2022-01-27 23:48:24 +00:00