Commit Graph

8167 Commits

Author SHA1 Message Date
Alex Buynytskyy
0fa58fa21d More finalization script fixes.
+ add an automation for bionic api-levels.h

Bug: 264308911
Test: local runs
Change-Id: I6ee24fce9b6de1b9bc1ddecde7b05c2e58002b9e
2023-02-14 00:14:19 +00:00
Treehugger Robot
236defbab2 Merge "Finalization scripts bugfixes." am: 2857d26608 am: b2f52e6497
Original change: https://android-review.googlesource.com/c/platform/build/+/2431266

Change-Id: Ib3cfcd7ffa2b502a9df0d2fceeff0ed39e46c25a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-13 21:08:15 +00:00
Alex Buynytskyy
1d2833ad2d Finalization scripts bugfixes.
Bug: 264308911
Test: local runs
Change-Id: Ie0812593fc41e1bb5d03e7912c3d526647f32725
2023-02-12 02:12:02 +00:00
TreeHugger Robot
8bdaa29ab1 Merge "Support SHA minSdkVersion in APK in APEX" into tm-dev am: 240c63fba3 am: 73214a06a4 am: 7b9f430cec
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/+/21337794

Change-Id: I9a9f1c7a09d71defc019cbb0ce877b2730ae181e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-11 04:44:58 +00:00
Alex Buynytskyy
afddc07570 Refactor finalization scripts.
Bug: 264308911
Test: run locally
Change-Id: I60fa1e1121fafb617d8508403fae07f0bdf39e66
2023-02-10 02:32:42 +00:00
Paul Duffin
a03f1265fb Support SHA minSdkVersion in APK in APEX
Bug: 266903788
Test: rm -fr out/dist
      UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true UNBUNDLED_BUILD_TARGET_SDK_WITH_API_FINGERPRINT=true TARGET_BUILD_APPS="com.google.android.rkpd" vendor/google/build/mainline_modules_bundles.sh
      # Without this change it fails, with this change it passes at
      # which point run the following.
      mkdir contents
      cd contents
      unzip ../out/dist/dev_keys_signed/com.google.android.rkpd/com.google.android.rkpd.apks
      deapexer extract standalones/standalone-x86.apex apex-contents
      aapt2 dump badging apex-contents/priv-app/rkpdapp.google@*/rkpdapp.google.apk  | grep Version
      # The sdkVersion and targetSdkVersion should both be set to SHA
      # versions.
Change-Id: I9ca54affd30f0a6cf561f1274b991d39e7cf1bce
(cherry picked from commit 730d0c437a)
Merged-In: I9ca54affd30f0a6cf561f1274b991d39e7cf1bce
2023-02-08 17:28:29 +00:00
Sorin Basca
d107351a3a Pin signapk to Java 11
Bug: 267608166
Test: TH
Change-Id: I4fe29ced62f385c0d22e5d3806fd5aa6e852b193
2023-02-03 18:06:46 +00:00
Dennis Shen
0dfb3aea75 Fix signing test failure
BUG: b/266137486
TEST: manual run target file signing pass with change
Change-Id: I4b8127937ba726560a69c79619a7f1a2882c9972
2023-01-31 13:28:09 +00:00
Hongguang Chen
1a7323390b Overwrite prop.default in all ramdisk fragments
default.prop can be linked to prop.default. To rewrite the fingerprints,
the original prop.default should be overwritten.

Bug: 264853953
Test: sign_target_files_apks, check artifacts
Change-Id: I8d22b8391dbfe13e74880ffad0619ef7fc4e20e0
2023-01-29 19:43:04 +00:00
Cole Faust
e03153b2bd Convert auto_gen_test_config.py to python 3
This script is run by soong, but without specifying
the python launcher, so it uses the default "python"
in the path, which is python 2.

Convert the script to use python 3.

Bug: 203436762
Test: Building an internal product that uses this
Change-Id: I4496c03b8669c54d080aa45c446dd1f27d91259e
2023-01-26 17:29:13 -08:00
Kelvin Zhang
e8ce38450f Disable imgdiff for non-AB OTA
imgdiff assumes that libz produces identical output across different
platforms, which is sometimes not the case. This causes incremental OTA
on non-AB targets to fail ocassionally. For stability, disable imgdiff.

Test: th
Bug: 265895599
Change-Id: I92d09a50762ec69a79caa37ed4d6e0db1ec8a47a
2023-01-23 20:43:09 -08:00
Kelvin Zhang
f80e886273 Fix non-AB OTA signing issue
After aosp/2201756 , caller must explicitly pass signing key as a
parameter to FinalizeMetadata . We forgot to update non_ab.py ,
therefore causing non-AB OTAs to be unsigned.

Test: th
Bug: 265895599
Change-Id: Ia54b1105f37b6574742b9b55d715fc9c61c223eb
2023-01-20 10:18:11 -08:00
Baligh Uddin
9f63b29083 Merge "Switch check_targetfiles_vintf to use the correct blkid binary." 2023-01-20 05:07:18 +00:00
Baligh Uddin
66dbfde748 Switch check_targetfiles_vintf to use the correct blkid binary.
BUG: 264426585
Test: TH
Change-Id: Iefe86e78c3e607ac27a5197d45fa832fa281c09d
2023-01-20 00:56:54 +00:00
Ibrahim Kanouche
aef5110fbe Fixed typos and naming for SPDX validation
Test: m compliance_sbom
Change-Id: I39edb73e11afc9050a2481a899b19f8f10eb7e72
2023-01-18 22:49:17 +00:00
Ibrahim Kanouche
cf066f01f3 Merge "Add deps tracking for SBOMs" 2023-01-18 16:11:49 +00:00
Ibrahim Kanouche
649b4d741c Add deps tracking for SBOMs
Test: m compliance_sbom

Bug: 242220547
Change-Id: Ife93e0e1cdc43490818798922d574ae1b1d441d1
2023-01-16 16:44:22 +00:00
Treehugger Robot
b80d9d6c33 Merge "Allow vendors to add custom vbmeta partitions" 2023-01-14 00:23:02 +00:00
Treehugger Robot
1ecedfc353 Merge "Allow otatools to deduce partial partition list from input" 2023-01-13 18:00:34 +00:00
Elliott Hughes
12d8a59513 Merge "zipalign/ziptime: use ftello()/fseeko()." 2023-01-13 14:52:05 +00:00
Kelvin Zhang
b81b4e3621 Allow vendors to add custom vbmeta partitions
Currently we only have vbmeta_system and vbmeta_vendor. Add
BOARD_AVB_VBMETA_CUSTOM_PARTITIONS , which allows OEMs to define
their own vbmeta_*.img partitions. example: aosp/2381823

Bug: 263568805
Change-Id: Id671e2c3aee9ada90256381cce432927df03169b
2023-01-12 17:34:42 -08:00
Elliott Hughes
04434739a2 zipalign/ziptime: use ftello()/fseeko().
Even if we were shipping 64-bit Windows host tools (which we still
aren't), this would still be a bug. Windows is LLP64 instead of LP64,
so the long that ftell()/fseek() uses isn't big enough for a 64-bit off_t.

Test: treehugger
Change-Id: I4e24afe811ff9b7d5696887cc5ee92e54e4a3b76
2023-01-13 00:41:38 +00:00
Kelvin Zhang
30669e6c29 Ovewrite build props in all ramdisk fragments
Under some build configuration, there could be build prop stored under
path VENDOR_BOOT/RAMDISK_FRAGMENTS/recovery/RAMDISK/default.prop .
When signing, we must overwrite all build props, or device would display
incorrect build fingerprint.

Bug: 264853953
Change-Id: Id3b176b4ce4efa348ecfb3c9848f72273c5ccca8
2023-01-10 21:09:14 -08:00
Chih-hung Hsieh
380635abec Merge "Fix uninitialized value warnings." 2023-01-10 18:46:09 +00:00
Chih-hung Hsieh
951f8c3130 Merge "Make DeprecatedOrUnsafeBufferHandling not high severity" 2023-01-10 02:15:35 +00:00
Chih-Hung Hsieh
fed64e390f Fix uninitialized value warnings.
Bug: 263274255
Test: presubmit; make tidy-build-make_subset
Change-Id: I33c8b0b006732e4351a15774b50036d10ffd26b5
2023-01-10 00:52:02 +00:00
Chih-Hung Hsieh
1a1f90e49a Make DeprecatedOrUnsafeBufferHandling not high severity
This tidy check has been disabled by default globally,
in build/soong/cc/config/tidy.go.
Local projects can enable it to find/fix such issues,
but if not fixed, it should not be treated as a
high severity one and not to alarm daily builds.

Bug: 227361697
Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: Ifa65a788ddc6a67ed3250d5bed737c6e3b153617
2023-01-09 14:19:11 -08:00
Kelvin Zhang
9f0379bd60 Fix VB 1.0 failure due to openssl output format change
Openssl changed output format, the 'keyid:' prefix is removed, hence old
regex is unable to extract key id.

Bug: 262902909
Change-Id: Iea5b6fffed7c27855d87e35292f07a56686e4197
Merged-In: I446a0b16e482c43542a1c0e41b24e80eb9fbc8e6
Merged-In: Iea5b6fffed7c27855d87e35292f07a56686e4197
(cherry picked from commit b7d70a2cb1)
2023-01-05 12:02:13 +00:00
Kelvin Zhang
a10528c7a8 Allow otatools to deduce partial partition list from input
Different devices/builds might have different constraints on what
partitions should be updated together in a partial OTA. Add a convenient
feature to auto detect.

Test: generate ota with --partial , make sure output OTA contains only 4
partitions

Change-Id: Id79e4bc4c5fb9d1225cb2aa7c1823afccc0b61f2
2023-01-03 16:04:49 -08:00
Bob Badour
f9d23a9f51 Fix concurrency bug in bottom-up resolution walk.
Concurrency is hard, and now that we no longer track origin it doesn't
improve performance in any meaningful way.

Bug: 261787132

Test: m droid dist compliance_dumpgraph compliance_dumpresolutions \
        compliance_sbom compliance_listshare compliance_rtrace \
        compliance_checkshare xmlnotice textnotice htmlnotice \
        compliancenotice_shippedlibs compliancenotice_bom

Test: m compliance_checkshare cts && \
        out/host/linux-x86/bin/compliance_checkshare out/host/linux-x86/gen/META/lic_intermediates/out/host/linux-x86/cts/android-cts.zip.meta_lic

Test: similar command as above for gts on internal

Test: m compliance_checksare droid dist && \
        out/host/linux-x86/bin/compliance_checkshare out/target/product/sunfish/gen/META/lic_intermediates/out/target/product/sunfish/obj/PACKAGING/systemimage_intermediates/system.img.meta_lic

Change-Id: I57a75927bf879c3ce6603049d8d583211dc0ce29
2023-01-04 00:02:02 +00:00
Bob Badour
3fe369c271 An ActionSet doesn't need to walk the graph.
Resolutions map back to the root, but actions do not. An iteration
works just fine.

Simplify TargetNodeSet so that it is directly iterable.

Bug: 261787132

Test: m droid dist compliance_dumpgraph compliance_dumpresolutions \
        compliance_sbom compliance_listshare compliance_rtrace \
        compliance_checkshare xmlnotice textnotice htmlnotice \
        compliancenotice_shippedlibs compliancenotice_bom

Test: m compliance_checkshare cts && \
        out/host/linux-x86/bin/compliance_checkshare out/host/linux-x86/gen/META/lic_intermediates/out/host/linux-x86/cts/android-cts.zip.meta_lic

Change-Id: Ic5a2d809b5a9a47b5d85f61e3a4a790dbe8f5fd2
2023-01-04 00:01:49 +00:00
Bob Badour
42b02efd05 Create regression test to catch concurrency error
The bottom-up walk to resolve conditions treats "already started" as
"alreay finished".

Bug: 261787132

Test: m compliance_checkshare
Change-Id: Ibb548bd4f5464b47682633878d475dfe011df3e1
2023-01-04 00:01:36 +00:00
Bob Badour
36f4a72aa7 Create regression test to catch WalkAction error.
Bug: 261787132

Test: m compliance_checkshare

Change-Id: I9f6a39a7f1cf50f9a0134b16f68d33f171cf7f13
2023-01-04 00:01:26 +00:00
Bob Badour
a6ee6d5511 Fix tests so they can fail.
Expected values were overwriting actual values.

Origin no longer tracked.

Bug: 261787132

Test: m droid dist

Test: m compliance_checkshare

Change-Id: Ie1fbc3d596cb08c6f0935a79441d8b00a4d1eb97
2023-01-04 00:01:03 +00:00
Chih-hung Hsieh
cef5fbb2e9 Merge "Fix uninitialized value warnings." 2022-12-22 00:06:15 +00:00
Chih-Hung Hsieh
442e08ffa7 Fix uninitialized value warnings.
Bug: 263274255
Test: presubmit; make tidy-build-make_subset
Change-Id: Ib6ce849596312f56e8d640c5f78e0e70f7ca54e3
2022-12-20 16:51:53 -08:00
Kelvin Zhang
37bc304a3d Allow build_image.py to build vbmeta partition
Cuttlefish needs to rebuild vbmeta at runtime, instead of duplicating
logic in cuttlefish tooling, re-use these logic in release tools.

Test: build_image $OUT misc_info.txt /tmp/vbmeta.img /tmp/otatols
Bug: 149866755
Change-Id: I2050f9e2dd7eed9b81a49a8442ec199147041d20
2022-12-20 10:59:58 -08:00
Jooyung Han
a4dc4a3ac7 Merge "Refactor: remove --apex-info-file arg to checkvintf" 2022-12-01 00:05:16 +00:00
Bob Badour
cac8a3cf09 Change condition to match go/thirdpartylicenses
Policy uses restricted_if_statically_linked at
https://opensource.google/documentation/reference/thirdparty/licenses#RestrictedIfStaticallyLinked

Test: m droid
Change-Id: I9b18d3133ae72de1bede99f46b530298313bc2e6
2022-11-30 10:52:41 -08:00
Jooyung Han
8af44a923f Refactor: remove --apex-info-file arg to checkvintf
Now, checkvintf finds input file from dirmaps. We don't need to pass
around --apex-info-file.

dump_apex_info also generates files under /apex without an explicit
--out_file argument.

This makes "make" know less about coupling between dump_apex_info
and checkvintf.

Bug: 260310732
Test: manually run check_target_files_vintf -v target-files
Change-Id: Ibfe31978e983e13df35c32521913d5cbc89dc1d1
2022-11-28 15:01:30 +09:00
Hongguang Chen
425f7d1cb3 Support chained init_boot partition signing
Bug: 256048561
Bug: 256237041
Test: sign_target_files_apks -d certs --avb_init_boot_algorithm \
        SHA256_RSA4096 --avb_init_boot_key init_boot_rsa4096.pem \
	xxx.zip signed.zip (Check signed.zip/META/misc_info.txt)
Change-Id: I65fc7913089ae318d90df55a533d3e2ebd93b029
(cherry picked from commit 0d6b727e03)
Merged-In: I65fc7913089ae318d90df55a533d3e2ebd93b029
(cherry picked from commit acf1b3afe2)
2022-11-15 22:30:54 +00:00
Treehugger Robot
9e0472e9c7 Merge "Fix recovery OTA error on merged targets" 2022-11-15 18:33:53 +00:00
Treehugger Robot
5cf8eef25e Merge "Fix 'expected str instance, bytes found' error when compute patches" 2022-11-14 19:14:22 +00:00
luoqiangwei1
3e3456bb72 Fix 'expected str instance, bytes found' error when compute patches
When building an incremental OTA package, if the compress_target=True
parameter is passed in when calculating a block, an exception will occur
in the subsequent join operation.

The reason is that Python 3 no longer allows str type join bytes type.

Bug: None
Test: Build Incremental OTA package

Change-Id: I6d556f9905b7ab75b70d3785334d71d5a6e5479b
Signed-off-by: luoqiangwei1 <luoqiangwei1@xiaomi.com>
2022-11-11 00:26:19 +08:00
Ibrahim Kanouche
f0c6cf501c Merge "Optimized project selection for getProjectMetadata" 2022-11-10 15:28:12 +00:00
Dennis Shen
da42e6fedb Merge "Update deapexer call to explictly use blkid" 2022-11-10 14:48:41 +00:00
Kelvin Zhang
fa40c04cba Fix recovery OTA error on merged targets
Currently, when merging target files, system side's update_engine
version info is copied into the merged target_files. This causes
recovery OTA failure, because update_engine_sideload daemon in recovery
is from vendor side. To fix it, use the older version of update_engine
config when merging target files.

Test: th
Bug: 257426678
Change-Id: I5d3304366749995c99a61ca0645a22ee047f1465
2022-11-09 14:43:17 -08:00
Cole Faust
7a48527b95 Fix crash in check_elf_file.py
`lib` is already a string and doesn't need to be decoded.

Bug: 258395719
Test: On internal master: build/soong/soong_ui.bash --make-mode --bazel-mode-staging TARGET_PRODUCT=aosp_coral TARGET_BUILD_VARIANT=userdebug droid dist device-tests platform_tests
Change-Id: I83ff35339bea9f01c61d953e251788e0894005dc
2022-11-09 12:50:35 -08:00
Dennis Shen
a8d1143beb Update deapexer call to explictly use blkid
To support erofs apex extract via deapexer, we need blkid to tell the filesystem type of underlying payload image. If it is ext4, debugfs_static will be used, if it is erofs, then we should use fsck.erofs. Thus we now need explicit blkid input.

Also, remove dependency on fsck.erofs for other deapexer calls. Only extract deapexer call needs blkid and fsck.erofs.

BUG: b/255963179, b/240288941
Change-Id: I8cea0f2def664f9cabf8b14c9a7ecc47bbddfbdd
2022-11-09 18:22:14 +00:00
Treehugger Robot
8f6474af5a Merge "Support chained init_boot partition signing" 2022-11-08 02:41:53 +00:00