Commit graph

3057 commits

Author SHA1 Message Date
Treehugger Robot
58ab571b38 Merge "Add fs_config support for vendor_boot" into main 2024-05-24 19:31:07 +00:00
Treehugger Robot
078c1c95c9 Merge "Disable zucchini for all OTAs" into main 2024-05-24 19:03:06 +00:00
Kelvin Zhang
d4bdbdced6 Disable zucchini for all OTAs
zucchini failure in OTA is observed. To unblock, disable
zucchini first. After the investigation are done and determined
zucchini is safe to enable, we will turn it back on.

Test: th
Bug: 342523982
Change-Id: I79c245356a356389328c788b3b7977b224e1df6a
2024-05-24 11:02:54 -07:00
Ashok Mutyala
8a3e361ea4 Add fs_config support for vendor_boot
Test:
1) add META/vendor_boot_filesystem_config.txt to    merge_config_other_item_list
2)Building vendor_boot image from target_files

Change-Id: Ia983d1119e30c46a6730566c567f13e25a65b0ff
2024-05-24 14:09:28 +00:00
Daniel Zheng
7a61f499be Merge changes Ibbed6cf9,I31b36b42 into main
* changes:
  ota_from_target_files: allow cow version override
  Add build configs for wearable tunables
2024-05-16 19:34:11 +00:00
Daniel Zheng
60922a45ef ota_from_target_files: allow cow version override
With our version compatibility check, overriding our cow version no
longer works. Updating this check to only apply if a command line
vabc_cow_version is not specified.

NOTE: the ota may not successfully apply, depending on device if we
override the cow version

Test: th
Change-Id: Ibbed6cf94cc2e91597d0c249dc8ade314b8341a2
2024-05-16 10:22:03 -07:00
Kelvin Zhang
13f0b68a8f Reland "Fix retrofit OTA generation failures"
This reverts commit 681597df18.

retrofit OTA generation relies on files in OTA/* , include these
files when copying target_files dir to tmp location.

Test: th
Bug: 337043530
Fixes: 337043530

Change-Id: Id9bb1cddcf992556923a17fd3f9b5e41eac7ca96
2024-05-08 18:14:41 -07:00
Kelvin Zhang
e41c75cb83 Merge "Revert "Fix retrofit OTA generation failures"" into main 2024-05-08 20:37:41 +00:00
Kelvin Zhang
681597df18 Revert "Fix retrofit OTA generation failures"
This reverts commit 7af14aa7da.

Reason for revert: b/339483257

Change-Id: I86cf6c0baed8697ace888135b3d66b4785d22aa5
2024-05-08 20:10:22 +00:00
Treehugger Robot
9a78be4d42 Merge "Fix retrofit OTA generation failures" into main 2024-05-08 17:35:43 +00:00
Kelvin Zhang
7af14aa7da Fix retrofit OTA generation failures
retrofit OTA generation relies on files in OTA/* , include these
files when copying target_files dir to tmp location.

Test: th
Bug: 337043530
Fixes: 337043530
Change-Id: I8fd7729bc1b2d2797f7e76f594b06fd9675fa104
2024-05-08 09:28:40 -07:00
Jooyung Han
5548c31901 Merge "Remove unused testdata" into main 2024-05-07 01:37:05 +00:00
Jooyung Han
d6a9631d8b Remove unused testdata
com.android.apex.compressed.v1_original is removed.

Bug: 338157001
Test: releasetools_test
Change-Id: Icd4fe958f260640a541e9843efa64e85036542ed
2024-05-03 11:49:55 +09:00
Daniel Zheng
76f13d280c Merge "create_brick_ota: logic fix" into main 2024-05-02 18:10:51 +00:00
Daniel Zheng
7e4cc58f2d create_brick_ota: logic fix
ota_metadata should be initialized outside of the if block.

Bug: 3072303
Test: th
Change-Id: Iabe52be3557c71921586d960d8a8a91c33d5558b
2024-05-02 09:55:45 -07:00
Ben Fennema
cd6de1bc7f Allow boot_variable_file to be read from input_target_files
If boot_variable_file is not found locally, look for it inside
input_target_files.

Bug: 335732867
Test: generate OTA with file in target-files.zip and verify metadata
Change-Id: I2e61f50850e82a3795f2e0e1aefcaf2329a8cfb1
2024-04-25 17:11:13 +00:00
Chirayu Desai
c8edf8af33 fixup! Support generating partial OTAs from extracted target_files
Test: Sign crosshatch
Change-Id: I6728da3a3a50ee24a35581af7e6ead3e13c5ff1d
2024-04-19 02:49:17 +05:30
Daniel Zheng
2fc519a568 Merge "ota_from_target_files: read correct api level" into main 2024-04-16 19:32:37 +00:00
Daniel Zheng
dc411eda4c ota_from_target_files: read correct api level
ro.product.first_api_level looks like the value we actually want to read
to since it inherits from $PRODUCT_SHIPPING_API_LEVEL. Other variables
we attempted to look at were giving other values (e.g 202504 for pixel
watch)

Bug: 331202590
Test: th
Change-Id: Ied3da247cba45611132db6c9e3cdefb447891f96
2024-04-16 12:32:05 -07:00
Kelvin Zhang
1d9b3daad2 Make output of MakeVbmeta consistent
The order of items in `partitions` map is non-deterministic. To make
sure that builds are hermetic, sort the map before use.

Test: th
Bug: 332550989
Change-Id: I76c7037ef9f03904899339813819fcf985a7c893
2024-04-15 09:45:03 -07:00
Nariyasu Heseri
5ffefcc642 Ensure insertion order of Python dict
Add keys to the dict `partitions` in serial to have a deterministic
insertion order.
This guarantees the generated vbmeta.img is always the same on the same
input, fixing image consistency issues.

Reference:
https://android-review.googlesource.com/c/platform/build/+/2585397

Bug: 332550989
Test: Generate vbmeta several times, confirm identical result.
Change-Id: I39da5844045f497fdc89e6477a7e32ddacb70764
2024-04-12 07:57:37 +00:00
Daniel Zheng
e836a3a2e4 Merge "zstd negative compression support" into main 2024-04-10 17:56:45 +00:00
Daniel Zheng
d919100382 zstd negative compression support
supporting negative compression levels in ota_from_target_files in the
format of zstd,-$compression_level

Test: ota_from_target_files
Change-Id: If2ca592829f10e7a0226cb41680cb47223d17c71
2024-04-10 10:54:51 -07:00
Kelvin Zhang
7a17cfd81a Remove dependency on non-AB modules
imgdiff is scheduled for removal.

Test: th
Bug: 324360816
Change-Id: I1a5615e9f5f776c16269ac8780187f97edba16f2
2024-04-08 11:08:14 -07:00
Kelvin Zhang
4dc089971b Make build_image output consistent for partitions w/o build.prop
Bug: 331405669
Change-Id: I01a673e7c842a5042d85f079e29c680c4d7b589c
2024-04-02 09:05:08 -07:00
Daniel Zheng
2826b1a2d3 Full ota v3 compatibilty check
Check that device is shipped supporting v3 in order to enable it.
Otherwise fallback.

Bug: 331202590
Test: th
Change-Id: I218fbaa6a044420af39be70b055da5ffbfced158
2024-04-01 12:08:01 -07:00
Treehugger Robot
e1df94c841 Merge "releasetools: Resolve symlinks in IsEntryOtaPackage()" into main 2024-03-26 16:55:57 +00:00
Treehugger Robot
decb8f4d1b Merge "Add apk_name information in error message" into main 2024-03-25 22:30:31 +00:00
Spandan Das
198dcf91ca Add apk_name information in error message
Logging the apk_name will improve debugging process if
`GetMinSdkVersion` returns an exception.

Test: None
Change-Id: I3ddf602d92701dcaaa4821fe42a76a870a721a11
2024-03-25 21:24:33 +00:00
LuK1337
fc51de4553
releasetools: Resolve symlinks in IsEntryOtaPackage()
Test: Sign target files package where
      SYSTEM/product/media/bootanimation-dark.zip is a symlink to
      bootanimation.zip.
Change-Id: I4648c3c39c094cb090cbe337c566c3e9ad894691
2024-03-24 21:18:17 +01:00
Daniel Zheng
4a80c5403d fallback to v2 on s build
In the case that a vendor is on s build (which doesn't have snapuserd),
and is takinga  v3 -> v3 upgrade, we want to fallback to v2 vabc ota.

Test: th
Change-Id: Iba259b139b9b423ac77d82e14a113cf35fbfea64
2024-03-22 12:02:54 -07:00
Daniel Zheng
02393ee106 Revert "allow command line override"
This reverts commit f3d476ed40.

Reason for revert: b/330767621

Change-Id: Ia0b8ec3f177ae74c03d7cb4e568e44149b125617
2024-03-21 21:08:22 +00:00
Daniel Zheng
f3d476ed40 allow command line override
Allow override for vabc_cow version if specified from the command line.
If OPTIONS.vabc_cow_version is already defined, then we don't want to
modify this value since it was defined by --vabc_compression_param=

Test: th
Change-Id: I57b8129faf5caf9de1dc8ad96e7570214a9f3313
2024-03-21 10:47:51 -07:00
Kelvin Zhang
0669b8eac2 Fix typo
Test: th
Bug: 329678555
Change-Id: I952c19f93484dad9e273afe1cd45a043a36a34ee
2024-03-20 13:58:15 -07:00
Daniel Zheng
0b7a685573 create_brick_ota: fix nonetype bug
If devkeys are present, we don't need to specify a serialno. In this
case we should conditionally add serial no to our metadata

Test: create_brick_ota
Change-Id: I9c93aa0f9ec5752693a9ddde5b76be4c12d6fc3b
2024-03-19 12:29:13 -07:00
Seungjae Yoo
b345651e6c Add unit test for parsing avb info
Bug: 328195652
Test: atest --host releasetools_test
Test: sign_target_files_apks
Change-Id: Ie38c3883907bc70c794606b20caf55a70dbcdf7c
2024-03-11 14:41:22 +09:00
Jooyung Han
9738259f3e checkvintf with all apexes
Previously, checkvintf read only vendor apexes. Now, we support vintf
from other apexes.

Bug: 327365139
Test: m check-vintf-all
Change-Id: I46dc04ccdbe7d3f035ea9f63b1e45358ab31021b
2024-03-07 17:32:09 +09:00
Treehugger Robot
ee7dbd22dd Merge "Resign microdroid_vendor.img with avb_vendor_key" into main 2024-03-05 10:55:45 +00:00
Daniel Zheng
474afa8f06 fallback on older cow version
If a device's source or target cow version is specified at 2 (or
undefined) we should fallback on using the v2 writer.

e.g.
1. v3 -> v2 downgrade OTA
2. v2 -> v3

Bug: 322279333
Test: ota_from_target_files
Change-Id: I8c5139eceeb64ee255ddea66017b3e17bbdc44c0
2024-02-28 20:47:20 -08:00
Seungjae Yoo
976035677c Resign microdroid_vendor.img with avb_vendor_key
microdroid_vendor.img is vendor image for running Microdroid, a type of
VM run on top of Android. microdroid_vendor.img is currently stored in
host device's vendor partition. However the original key signed for
microdroid_vendor.img is not enrolled in the signing server, so it can
make possible test breakage if there's a test checking all files in the
partition is signed with trusted key.

Therefore, this is the patch to resign micrdoroid_vendor.img with
avb_vendor_key. When vendor image of host device is resigned with that
key, microdroid_vendor.img would be resigned as well with the same key.

Bug: 285855442
Test: First, for testing, modify the script to skip all files except
VENDOR/etc/avf/microdroid/microdroid_vendor.img in ProcessTargetFiles.
Second, run following commands and check if script doesn't throw any
error until ProcessTargetFiles ends.
- sign_target_files_apks --avb_vendor_key external/avb/test/data/testkey_rsa2048.pem --avb_vendor_algorithm SHA256_RSA2048 <source_zip_file> <target_zip_file>
- sign_target_files_apks --avb_vendor_key external/avb/test/data/testkey_rsa4096.pem --avb_vendor_algorithm SHA256_RSA4096 <source_zip_file> <target_zip_file>
- sign_target_files_apks --avb_vendor_key external/avb/test/data/testkey_rsa8192.pem --avb_vendor_algorithm SHA256_RSA8192 <source_zip_file> <target_zip_file>
Third, `unzip <target_zip_file>` and do `avbtool info_image`

Change-Id: I5337f61ab9eca7e6d0f92860486bc820b6e09eac
2024-02-23 11:58:15 +09:00
Daniel Zheng
cedc765ca2 add 256k support
Adding 256k support for ota_from_target_files since this is the max
comperssion_factor allowed in v3 cow

Test: ota_from_target_files
Change-Id: Ic7826c82e53ec3fdbd04fdff9dfb7a76038f6a42
2024-02-21 13:33:02 -08:00
Dennis Song
bc7e0a9f25 Allow merging target files without framework ab_partitions.txt
Introduce a new option `--allow-partial-ab` in merge_target_files,
which allows merging a non-AB framework with an AB vendor.

The reason for adding this option is to support merging a real
device framework with a cuttlefish vendor. Cuttlefish enables AB
partition by default; however, some real devices do not.

Bug: 318326532
Test: merge_target_files
Test: atest --host releasetools_test
Change-Id: Iaebd06796153fe82fbf56e86fcc8c500b6d60771
2024-02-06 14:40:57 +00:00
Treehugger Robot
1cc902690e Merge "Fix ext4 size estimates" into main 2024-01-29 20:06:18 +00:00
Yi-Yo Chiang
accdd3f087 Merge "Re-land: releasetools: Deprecate GKI build rules" into main 2024-01-25 05:29:11 +00:00
Yi-Yo Chiang
a4d5f4380b Re-land: releasetools: Deprecate GKI build rules
(Re-land of Ie882fccd864920289e48366e99a4ebd67e784d0d)

We no longer build GKIs from the platform tree.
These build commands were neither used nor maintained anymore, so clean
them up to reduce maintenance effort.
Keep the command line options as no-op, so existing scripts that still
specifies the deprecated options don't break.

Bug: 229701033
Test: presubmit
Change-Id: I0f7d05562dbc3eed29e902d6dc9a0f2e4083aaa6
2024-01-25 11:21:00 +08:00
Kelvin Zhang
158a5ebbc9 Fix ext4 size estimates
Currently, EXT4 image building is done in a 2 pass fashion:

First pass: build ext4 image with small margin/headroom, check the
number of block used in the output image

Second pass: Build ext4 image again with an estimated block count from
first pass

The two pass implementation is done to keep image size at a
minimum. Recently some failures in first pass invocation is observed due
to image being undersized. Since we will reduce the image size in 2nd
pass, it's OK to increase the image size estimate during first pass. Add
a headroom 10% of total file size to fix build failures.

Test: cherry pick r.android.com/q/topic:%22aosp_cf_system_x86_64%22 and
m aosp_cf_system_x86_64

Bug: 321003625
Change-Id: I254310c67a08b98b05d2c858d4ab59a48112a07b
2024-01-24 18:37:27 -08:00
Jooyung Han
750aad5c32 Add all apexes to apex_info
Previously, META/apex_info.pb contained only /system/apex apexes. Now,
it has all apexes from all possible partitions.

The main purpose of this file is to caculate the decompressed apex size
when applying OTA. Hence it should have all apexes, not just system
apexes.

Bug: 320228659
Test: m dist # check META/apex_info.pb
Change-Id: I3428dc502e4fe3336d1fc5ca941f1fbc332985cd
2024-01-23 05:52:51 +09:00
Treehugger Robot
3b7d46f4ca Merge "Fix signing failures on targets with >4GB target_files" into main 2024-01-19 20:06:07 +00:00
Kelvin Zhang
12ac11025e Fix signing failures on targets with >4GB target_files
An old python zipfile hack prevented zipfile module from decoding 64 bit
sizes correctly, remove the legacy hack to fix.

Test: check_target_files_signatures -v 5GB_target_files.zip
Bug: 319367048
Change-Id: I376c7b68f549ddf88680280d604548d1849cdfe2
2024-01-19 11:04:58 -08:00
Tim Tsai
7cd5b313f6 Merge "Fixed not mapping sdk_sandbox key to vendor key" into main 2024-01-17 17:08:07 +00:00