Commit graph

7438 commits

Author SHA1 Message Date
Iavor-Valentin Iftime
b837b7170b Skip generating care_map for non-AB updates
Bug: 186097910
Test: build a non-AB update merged target using Forrest,
      No errors reported and no META/care_map.pb is generated.

Change-Id: I74990b0aa7f46d4c4d40098a4b102f7e04166c39
2022-01-27 18:35:43 +00:00
Treehugger Robot
ef8f4426ef Merge "releasetools: system_dlkm: add image to dist zip" 2022-01-25 20:09:57 +00:00
Bob Badour
d2c7c08e7c Fix licenses and license texts.
Use Android-Apache-2.0 for all Apache 2.0

Remove legacy_restricted (no longer appears in code).

Remove Android.bp which did not build anything but was a placeholder
for the missing license texts.

Test: m nothing
Change-Id: Ia491a59c735ca20afda9b4bbac9d8b33dbf8874e
2022-01-24 16:19:41 -08:00
Ramji Jiyani
bdef28f2ee releasetools: system_dlkm: add image to dist zip
Bug: 200082547
Test: Manual builds:
      1. Set BOARD_USES_SYSTEM_DLKM_PARTITION
      2. Set BOARD_PREBUILT_SYSTEM_DLKM_IMAGE to external image
      - Check that "m dist" put the system_dlkm image in
      out/dist/aosp_cf_x86_64_phone-img-eng.ramjiyani.zip
Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
Change-Id: I8b7dd40e178db7fe542253bff19040095847fa57
2022-01-24 21:27:52 +00:00
Chih-Hung Hsieh
02f0df83fc Lower severity of 3 tidy warnings
* bcmp/bcopy/bzero are not insecureAPI on Android.
* Android projects may enable/disable clang-tidy checks locally;
  warn/*patterns.py keep global classification of all warnings.

Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: I7720f7babd0a33c1b6602c9a8bb67565c45db94e
2022-01-20 16:13:12 -08:00
Kelvin Zhang
6fe2fc031f Add erofs compressor type param
Test: th
Bug: 206729162
Change-Id: I3ddd1a55e1544a8a4d24ed445562f05ad0aaad2c
2022-01-18 10:17:49 -08:00
Kelvin Zhang
554c8bee14 Fix formatting error
Test: th
Bug: 214388458
Change-Id: I2dc72884aad4f440b4b68566e2e29f9f6f5aa73e
2022-01-18 10:17:49 -08:00
Kelvin Zhang
4a376986ea Merge "Fix check_tf failure when duplicate package names are present" 2022-01-18 18:14:02 +00:00
Jingwen Chen
2a31f3df87 Migrate java-event-logs-tags.py to python3.
These are used in the Bazel Android app builds.

Test: m droid
Test: CI
Test: b run //build/make/tools:java-event-log-tags

Change-Id: Iaffe6f974008d1a0532a849353d25df02197afd2
2022-01-17 13:02:53 +00:00
Yi-yo Chiang
8b4e2fd6c0 Merge changes from topic "gki-avb-vts"
* changes:
  releasetools: Android T GKI certification scheme
  Android T GKI certification scheme
2022-01-17 04:52:28 +00:00
Yi-Yo Chiang
36054e2daf releasetools: Android T GKI certification scheme
Companion change of Iaf48a6e3d4b97fa6bfb5e1635a288b045baa248f
To support new GKI certification scheme for boot.img and
init_boot.img on upgrading and launching device combinations.

Bug: 210367929
Bug: 211741246
Bug: 203698939
Test: atest --host releasetools_test:test_common
Test: unpack_bootimg --boot_img boot.img
Test: unpack_bootimg --boot_img init_boot.img
Test: avbtool info_image --image out/boot_signature
Change-Id: I3749297c09c3899046550e4be776acbeea37ef2e
2022-01-14 19:50:32 +08:00
Treehugger Robot
2f1f985480 Merge "Add option to enable lz4diff" 2022-01-13 20:33:31 +00:00
Kelvin Zhang
67553739e3 Fix check_tf failure when duplicate package names are present
Test: check_target_files_signatures sdk_gphone64_x86_64-target_files-8069754.zip
Bug: 214388458

Change-Id: I0a8a0d0596c04a9da4283d4d4caeb3bb62762ccc
2022-01-13 12:30:22 -08:00
Kelvin Zhang
f2728d615e Add option to enable lz4diff
When lz4diff is enabled, we inject the host copy of liblz4.so in
target_file to delta_generator. This is to ensure that host tooling can
produce same compressed output as the device.

Test: th
Bug: 206729162

Change-Id: I2d8206f7ec54fadedea16bf3d811b8353bc9414d
2022-01-12 17:21:00 -08:00
Treehugger Robot
3a0656307c Merge "Regression testcase for shipped vs nonshipped." 2022-01-12 23:35:17 +00:00
Treehugger Robot
710813e871 Merge "Fix typo in doc: code segment for container dot" 2022-01-12 22:31:40 +00:00
Bob Badour
00bf3d9b29 Regression testcase for shipped vs nonshipped.
Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Test: m systemlicense
Test: m listshare; out/soong/host/linux-x86/bin/listshare ...
Test: m checkshare; out/soong/host/linux-x86/bin/checkshare ...
Test: m dumpgraph; out/soong/host/linux-x86/dumpgraph ...
Test: m dumpresolutions; out/soong/host/linux-x86/dumpresolutions ...

where ... is the path to the .meta_lic file for the system image. In my
case if

$ export PRODUCT=$(realpath $ANDROID_PRODUCT_OUT --relative-to=$PWD)

... can be expressed as:

${PRODUCT}/gen/META/lic_intermediates/${PRODUCT}/system.img.meta_lic

Change-Id: I17221ec8fe429b5f745c0733f8bb1ab0ea2f4567
2022-01-11 16:38:55 -08:00
Treehugger Robot
49380ebecf Merge changes Ia2ec1b81,Ibc831ae8
* changes:
  Performance and scale.
  Use struct{}
2022-01-12 00:27:41 +00:00
Treehugger Robot
b3f3e7b3f7 Merge "Fold annotations." 2022-01-12 00:27:35 +00:00
Bob Badour
99dba55b4b Fix typo in doc: code segment for container dot
Test: not applicable
Change-Id: Ibaadc6e8fd4a267b50a46feb2dd6278ff1f5ace1
2022-01-11 14:46:22 -08:00
Bob Badour
103eb0f9bc Performance and scale.
Defer edge creation.

Don't create edges until the count is known to avoid repeated allocate+
copy operatios.

Limit resolutions.

Allow only a single resolution condition set per target, and overwrite
intermediate results. Reduces memory and obviates allocations.

Propagate fewer conditions.

Instead of propagating notice conditions to parents in graph during
initial resolve, leave them on leaf node, and attach to ancestors in
the final walk. Reduces copies.

Parallelize resolutions.

Use goroutines, mutexes, and waitgroups to resolve branches of the
graph in parallel. Makes better use of available cores.

Don't accumulate resolutions inside non-containers.

During the final resolution walk, only attach actions to ancestors from
the root down until the 1st non-aggregate. Prevents an explosion of
copies in the lower levels of the graph.

Drop origin for scale.

Tracking the origin of every potential origin for every restricted
condition does not scale. By dropping origin, propagating from top
to bottom can prune many redundant paths avoiding an exponential
explosion.

Conditions as bitmask.

Use bit masks for license conditions and condition sets. Reduces maps
and allocations.

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Test: m systemlicense
Test: m listshare; out/soong/host/linux-x86/bin/listshare ...
Test: m checkshare; out/soong/host/linux-x86/bin/checkshare ...
Test: m dumpgraph; out/soong/host/linux-x86/dumpgraph ...
Test: m dumpresolutions; out/soong/host/linux-x86/dumpresolutions ...

where ... is the path to the .meta_lic file for the system image. In my
case if

$ export PRODUCT=$(realpath $ANDROID_PRODUCT_OUT --relative-to=$PWD)

... can be expressed as:

${PRODUCT}/gen/META/lic_intermediates/${PRODUCT}/system.img.meta_lic

Change-Id: Ia2ec1b818de6122c239fbd0824754f1d65daffd3
2022-01-11 10:40:50 -08:00
Bob Badour
5446a6f8e1 Use struct{}
Using struct{}{} as the payload for set maps reduces memory use for
large sets.

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Test: m systemlicense
Test: m listshare; out/soong/host/linux-x86/bin/listshare ...
Test: m checkshare; out/soong/host/linux-x86/bin/checkshare ...
Test: m dumpgraph; out/soong/host/linux-x86/dumpgraph ...
Test: m dumpresolutions; out/soong/host/linux-x86/dumpresolutions ...

where ... is the path to the .meta_lic file for the system image. In my
case if

$ export PRODUCT=$(realpath $ANDROID_PRODUCT_OUT --relative-to=$PWD)

... can be expressed as:

${PRODUCT}/gen/META/lic_intermediates/${PRODUCT}/system.img.meta_lic

Change-Id: Ibc831ae80fc50f35e1000348fb28fc0167d0ebed
2022-01-11 10:40:50 -08:00
Bob Badour
67d8ae390a Fold annotations.
Use annotation slices looked up from map instead of read from disk to
reduce copies.

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Test: m systemlicense
Test: m listshare; out/soong/host/linux-x86/bin/listshare ...
Test: m checkshare; out/soong/host/linux-x86/bin/checkshare ...
Test: m dumpgraph; out/soong/host/linux-x86/dumpgraph ...
Test: m dumpresolutions; out/soong/host/linux-x86/dumpresolutions ...

where ... is the path to the .meta_lic file for the system image. In my
case if

$ export PRODUCT=$(realpath $ANDROID_PRODUCT_OUT --relative-to=$PWD)

... can be expressed as:

${PRODUCT}/gen/META/lic_intermediates/${PRODUCT}/system.img.meta_lic

Change-Id: Ibf6f7d319092e0d54ab451ffbbd35dcd7d0080e0
2022-01-11 10:40:39 -08:00
Treehugger Robot
9d83209f12 Merge "Do not append .meta_lic to meta_lic" 2022-01-11 06:11:14 +00:00
Bob Badour
63a281cc29 Do not append .meta_lic to meta_lic
Test: manual
Change-Id: I8d7162dc55f057d542faaa7feb546050d3a872e7
2022-01-10 18:00:03 -08:00
Jiyong Park
efbb6ffa00 Add min_sdk_version to BuildManifest.apk
sign_target_files_apks demands it.

Bug: 213823227
Test: run com.google.android.tradefed.ota.SigningToolTest#Testcase1_Signingtest
Change-Id: I1bba2b25a71449a57d284024e77fb76d1b79a0ee
2022-01-10 20:14:05 +09:00
Treehugger Robot
dcd7e283d2 Merge "Add option to enable zucchini" 2022-01-09 20:38:18 +00:00
Martin Stjernholm
76537be0a9 Merge "Add an option to specify the path to aapt2." 2022-01-09 19:11:49 +00:00
Treehugger Robot
555c3a7dc7 Merge "Write signature size even when it's empty" 2022-01-08 02:20:11 +00:00
Martin Stjernholm
58472e8609 Add an option to specify the path to aapt2.
Thin manifests (e.g. master-art) may not have the aapt2 sources and
instead relies on the prebuilt in prebuilts/sdk/tools/linux/bin. In
that case there's no aapt2 in the search path, so it needs to be
specified.

Test: Heavy presubmit build on mainline_modules_bundles on git_master
Test: vendor/google/modules/ArtGoogle/build-art-module.sh
  with http://ag/16584845 on git_master-art, where only the prebuilt
  aapt2 is present
Bug: 212462945
Change-Id: I41a22e8146f5a88534c2721345b4d9d64f76698c
2022-01-07 23:08:53 +00:00
Kelvin Zhang
410bb389d8 Add option to enable zucchini
Change-Id: Id952826c9c5af912fba679af61f2a2e1645641dd
2022-01-07 14:59:01 -08:00
Kelvin Zhang
98ef7bb157 Fix GetCareMap for small images
Change-Id: Iac518e36dbb2fe9303e84d502cd7dfe74621c0af
2022-01-07 14:59:01 -08:00
Treehugger Robot
7c88c9c1e6 Merge "Move fsverity metadata generation to Makefile" 2022-01-07 03:37:16 +00:00
Treehugger Robot
bd5fd25265 Merge "Avoid packing ramdisk into GKI boot-*.img" 2022-01-07 02:35:06 +00:00
Inseob Kim
3d5ae80f50 Write signature size even when it's empty
Normally this has no effect, but when we generate metadata for small
files (<=4KB), merkle tree isn't generated. In such case, writing zero
will make the metadata format simpler and unconditional.

Test: manual
Change-Id: Ibe18175b580af3409c896a8bb97323792ad9c459
2022-01-07 10:56:17 +09:00
Inseob Kim
135c1f144f Move fsverity metadata generation to Makefile
build_image.py has been handling fsverity metadata generation in the
packing step, but it can cause issues because the metadata files are
missing in the $OUT directory, and they only exist in result system.img.
This change moves the generation logic into Makefile, and makes the
metadata tracked by ninja graph.

Bug: 206326351
Test: PRODUCT_SYSTEM_FSVERITY_GENERATE_METADATA := true and build
Change-Id: I1f910d8ac6e2cc3c54f35916871733c632f18e44
2022-01-07 09:16:42 +09:00
Bowgo Tsai
88fc2bdd19 Avoid packing ramdisk into GKI boot-*.img
If init_boot.img is present, the GKI boot-*.img should
not include the ramdisk because the ramdisk will be packed
into the init_boot.img instead.

The "has_ramdisk" flag incorrectly checks the condition of:
prebuilt_name != "boot.img" to see if it is a boot.img.
Because "has_ramdisk" was added before we packed multiple
GKI boot-*.img, e.g., boot-5.10.img, boot-5.10-lz4.img, etc.,
into the target files.

Fix this by checking the partition_name is "boot" or not.
Also moving the logic into a new function with comments for each
condition.

Bug: 203698939
Bug: 213028932
Test: sign_target_files_apks \
        --gki_signing_key=external/avb/test/data/testkey_rsa4096.pem \
        --gki_signing_algorithm=SHA256_RSA4096 \
        ./out/dist/*-target_files-eng.*.zip signed.zip, then
        unpack_bootimg to checks the signed boot-*.img has no ramdisk
Change-Id: I5354669feb54d547dbe797e51b1b1baa187cb7cf
2022-01-06 17:50:04 +08:00
Jacky Liu
bff997fd1f Merge "Add PRODUCT_EXTRA_OTA_KEYS to add extra ota keys in otacerts.zip" 2022-01-06 06:31:37 +00:00
Treehugger Robot
790214a4c9 Merge "Fix the signing error on no-system-image targets" 2022-01-06 06:27:17 +00:00
Chih-Hung Hsieh
d4691ecfb6 Show directories and files with most warnings.
* Now with 4 sections that can be shown/hidden independently.
* After the 'selected_projects' section, add two more sections:
  * 'top_directory_section' contains
    * a table of directories with at least 1% warnings.
    * a 'selected_directory_warnings' subsection to show all warnings
      in the clicked directory from the directory table
  * 'top_file_section' contains
    * a table of files with at least 100 or 1% warnings.
    * a 'selected_file_warnings' subsection to show all warnings
      in the clicked file from the file table
* Adjust button/section spaces and reduce button font size to 100%.
* Rename drawTable to genTables.

Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: I765b09a46adc111cfe781719ba7aa0f917aa6ffc
2022-01-05 15:43:52 -08:00
Wei Su
22ecce0658 Merge "Write files in a temporary directory" 2022-01-05 20:03:07 +00:00
Treehugger Robot
7ca77ea994 Merge "Convert generate-self-extracting-archive.py to python 3" 2022-01-05 18:58:58 +00:00
Jacky Liu
beb0b6927c Add PRODUCT_EXTRA_OTA_KEYS to add extra ota keys in otacerts.zip
Equivalent to PRODUCT_EXTRA_RECOVERY_KEYS but for A/B OTA.

Bug: 211848136
Test: set PRODUCT_EXTRA_OTA_KEYS and check otacerts.zip
Change-Id: I81e27d12a22b405f6227b09c01ed684dfcede19e
2022-01-05 17:54:40 +08:00
Bowgo Tsai
8d4b72405e Fix the signing error on no-system-image targets
Currently when running sign_target_files_apks on a no-system-image
target, it will raise the following error:

  ValueError: max() arg is an empty sequence

This is because there is no APK files in the target_files.zip.
Fixing this by setting maxsize to zero in this case.

Bug: 213028932
Test: lunch gki_arm64-userdebug; make dist
Test: sign_target_files_apks \
        --gki_signing_key=external/avb/test/data/testkey_rsa4096.pem \
        --gki_signing_algorithm=SHA256_RSA4096 \
        --gki_signing_extra_args="--prop gki:prop1 --prop gki:prop2" \
        ./out/dist/*-target_files-eng.*.zip signed.zip
Change-Id: I40daecbc2ff3f89d3e635d1a4a1c1dea31ba9a27
2022-01-04 17:55:19 +08:00
Cole Faust
547ca205ae Convert generate-self-extracting-archive.py to python 3
Test: Add a VENDOR_BLOBS_LICENSE entry to an existing product, then `m with-license`
Bug: 203436762
Change-Id: I4bbe77bda7789b6c44bea141518b1cd2e699d326
2021-12-29 13:58:28 -08:00
Baligh Uddin
06cc018629 --sign_tool is an optional flag applicable to virtApex.
For not virtApex, this results in a KeyError.
line 151, in <module>\n', '  File
"/usr/local/google/home/baligh/clients/goog/master/out/host/linux-x86/bin/sign_apex/sign_apex.py",
line 144, in main\n', "KeyError: 'sign_tool'\n"]

BUG: 193504286
Test: TH
Change-Id: Id982e5c57086ada78168163d2293813df121847d
2021-12-24 06:17:47 +00:00
Devin Moore
6363a04e79 Merge changes from topic "init_boot_img"
* changes:
  Update releasetools for new init_boot.img
  Build a new init_boot.img that contains the boot ramdisk
2021-12-22 23:21:17 +00:00
Treehugger Robot
ceb81e2bef Merge "Fix some python2/3 migration issues" 2021-12-22 06:33:32 +00:00
Treehugger Robot
01ca0d0c5e Merge changes I8d60efc5,Ie291ea87
* changes:
  SignApk - change signature of readPassword to use char[] instead
  SignApk - use existing password mechanism when using keystore
2021-12-22 06:23:19 +00:00
weisu
eae45315cd Write files in a temporary directory
Avoid writing test files in the build output directory which fails when
run with Bazel. This happens because Bazel's sandboxing environment
ensures that the test's working directory is unwritable.

See https://docs.bazel.build/versions/main/sandboxing.html for more
information.

Bug: 209687942
Test: atest --bazel-mode zipalign_tests
Test: atest zipalign_tests

Change-Id: Ie22f464830c1ffe4d38a94a16dbd39dafa7fe317
2021-12-22 00:06:14 +00:00