Commit graph

184 commits

Author SHA1 Message Date
Treehugger Robot
d5474ac3da Merge "Add the option for custom_image to be AVB or NONAVB" into main 2023-08-01 19:08:06 +00:00
Ray-cy.lee
e97e0cb16b Add the option for custom_image to be AVB or NONAVB
Check BOARD_AVB_$(call to-upper,$(partition))_KEY_PATH to decide whether custom_image should sign AVB or not. If key path isn't set, the custom image will be excluded from AVB and copied to /IMAGES in target-files directly. This allows vendor to use custom_images flow packing unsigned image.
And to every non-avb custom partition, one image whose name is partition name must be added in its BOARD_<CUSTOM_PARTITION>_IMAGE_LIST.

BOARD_CUSTOMIMAGES_PARTITION_LIST := tvconfig
BOARD_TVCONFIG_IMAGE_LIST := \
    device/xxxx/yyyy/tvconfig.img \
    device/xxxx/yyyy/tvconfig_custom1.img

Test:
1) Build image, target-files, OTA package by m and m dist
2) Sign images by sign_target_files_apk.py

Fix: 285227850
Change-Id: I7477dafe023e4b168f0f08fb7aedd9e511a60e1b
2023-07-26 20:21:29 +08:00
Cole Faust
4f3dc8759f Remove BOARD_BPT* variables and the bpt parition table image
These variables appear to never be set.

Test: Presubmits
Change-Id: If4b89376f73204ad5780dff421f1216da255c3eb
2023-07-11 16:58:06 -07:00
Treehugger Robot
7b640806da Merge "Revert "Remove all ZIP64LIMIT hack"" 2023-04-15 01:48:58 +00:00
Kelvin Zhang
f92f7f046a Revert "Remove all ZIP64LIMIT hack"
This reverts commit 37a4290909.

Reason for revert: b/278156419

Change-Id: I67ea667619a9623be849d911993010ef0f0bfd88
2023-04-14 21:32:54 +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
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
Hongguang Chen
0d6b727e03 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
2022-11-07 15:48:23 -08:00
Kelvin Zhang
37a4290909 Remove all ZIP64LIMIT hack
In the old days, we hacked values of ZIP64LIMIT to get around size
limitations of non-zip64 supported zip files. Now that we switched to
python3 + zip64, there's no point in keeping those hacks.

Test: th
Bug: 255683436
Change-Id: I913db33dad5503736c68a7a1f1321aa952019f60
2022-10-26 13:22:52 -07:00
jiangxu5
2d8a4cbf84 [Bugfix] Fix compilation problems
vbmeta_system does not need to be rebuilt with vendor side

Signed-off-by: jiangxu5 <jiangxu5@xiaomi.com>
Change-Id: Ieb2076055aa3342a6071ec2ed5c976e22f59acd1
2022-09-18 12:38:51 +00:00
hungweichen
dd3fca09f6 Remove replace verity key args
We are removing VB support from release tools. This change aims to
remove the args related to replace verity key.

Bug: 242672222
Test: atest under build/make
Change-Id: I446a0b16e482c43542a1c0e41b24e80eb9fbc8e6
2022-08-24 06:37:12 +00:00
Treehugger Robot
2e30eed994 Merge "Add flags to override all apex/apk keys" am: c7cd55bf17
Original change: https://android-review.googlesource.com/c/platform/build/+/2171705

Change-Id: I6c3556e51fa839c078e1eea6f6daa2dd8d6e4024
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-06 04:53:55 +00:00
Kelvin Zhang
e50bb51fa9 Add flags to override all apex/apk keys
Currently, if we want to override all apex/apk key, we must specify all apk/apex names exhaustively. This causes CLI arguments to be very long and sometimes exceeds OS's limit.

Test: run signing test locally on build 8862875 on git_master
Bug: 239991438
Change-Id: Idbd3b7eef9b2a27236f4ca7a27449fcdf0d2dd3f
2022-08-02 18:32:38 +00:00
Kelvin Zhang
89c59b8fa5 Merge "Fix typo in recently changed extra_apex_payload_key flag" am: 193de78dfd
Original change: https://android-review.googlesource.com/c/platform/build/+/2167622

Change-Id: Ia46cc5f2a651aefc4884d5d642a0c6c04d66a536
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-29 17:08:22 +00:00
Kelvin Zhang
87e452739e Fix typo in recently changed extra_apex_payload_key flag
The intention was to make extra_apex_payload_key take a comma separted
list of keys. Iterating over a string will only iterate over each
characters individually. Must split by "," to iterate over keys.

Test: Run signing test locally using tradefed.sh
Bug: 239991438
Change-Id: I51bfed53a43b1b0fc1e33e0dc3d418a727e6ff15
2022-07-27 11:15:58 -07:00
Treehugger Robot
488525a889 Merge "Allow extra_apex_payload_key to take multiple names at once" am: d024518e1e
Original change: https://android-review.googlesource.com/c/platform/build/+/2164515

Change-Id: I0d2545f758d7469cf3a68ccf505a6183306630b3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-27 02:04:03 +00:00
Kelvin Zhang
085b6f3e84 Allow extra_apex_payload_key to take multiple names at once
When running tests, we might need to add many
extra_payload_keys. Currently we have to add --extra_apex_payload_key
for each key pair we pass, resulting in extremely long argument list.

Test: th
Bug: 239991438
Change-Id: I3e5f9d76c7f45822fb986b603dc089407c35b76b
2022-07-25 16:16:13 -07:00
Xin Li
05442a9213 Merge tm-dev-plus-aosp-without-vendor@8763363
Bug: 236760014
Merged-In: I1dffeb055a68250f574630d4ef5fedc51bad4a2b
Change-Id: I4e4b6a02fc140a1e38ce533031d7eb0a739396df
2022-06-28 21:23:05 +00:00
jiajia tang
e5ddfcd004 Fix potential issues if str has spaces
Uniform the split() function
str.split() will return a list split all spaces in str,
while str.split(' ') will return a list might contain ''
which might have potential issues.

Signed-off-by: jiajia tang <tangjiajia@xiaomi.com>
Change-Id: I0961659b140f800bdbe285f63bb4f02b8459ff8b
Signed-off-by: jiajia tang <tangjiajia@xiaomi.com>
2022-06-23 23:56:45 +00:00
Treehugger Robot
71880d9de6 Merge "[Bugfix] Check for presence before ZipWrite" am: bb8d9ed70f am: c3a915294b
Original change: https://android-review.googlesource.com/c/platform/build/+/2115654

Change-Id: Ifb49b4e8f30ea1da194e914c68cd01f63d8ccd4a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-04 05:36:55 +00:00
jiangxu5
b67b0d5bc0 [Bugfix] Check for presence before ZipWrite
There are vendor products but no *.map situation

Signed-off-by: jiangxu5 <jiangxu5@xiaomi.com>
Change-Id: I93a710fd10870b7406b1d7beb5a6f51b6badc104
2022-06-03 14:46:56 +08:00
Melisa Carranza Zúñiga
da308bf773 Revert "Merge "Adding sepolicy sign params to sign_target_files_apks." am: fb042449e0 am: bd8c313275 am: a2db49becd"
Test: sign_target_files_apks target_files.zip target_out.zip

This reverts commit 6e6c22c70e.

Reason for revert: Updateable SEPolicy is punted.

Change-Id: I99524d13811028a4036aa85c74cf10974fe08165
Merged-In: I99524d13811028a4036aa85c74cf10974fe08165
2022-05-31 09:55:22 +00:00
Iavor-Valentin Iftime
42a7160300 Merge "Rebuild and copy recovery and boot img when using vendor_otatools" am: 71585eae2b am: 7ee275cb81 am: 9fd594c53c
Original change: https://android-review.googlesource.com/c/platform/build/+/2068347

Change-Id: Id6c31fc941b14f5349b3b43f314c1a97872a4b4e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 17:06:22 +00:00
Iavor-Valentin Iftime
71585eae2b Merge "Rebuild and copy recovery and boot img when using vendor_otatools" 2022-04-21 16:07:12 +00:00
Lucas Wei
035fdee0ef Merge "vendor_kernel_boot: Update releasetools for vendor_kernel_boot" am: 2d5ecef1b3 am: bd66e32393 am: b8b3c0d0ab
Original change: https://android-review.googlesource.com/c/platform/build/+/2064760

Change-Id: Ibcf742f858c37141ab59cbd2d9c589ae15cf6ada
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 04:48:40 +00:00
Lucas Wei
03230250a3 vendor_kernel_boot: Update releasetools for vendor_kernel_boot
add_img_to_target_files.py will re-make image and build a new
signed vbmeta.img with new images in target-file.
We need to add vendor_kernel_boot into AVB signing list and make it
support that image.

Test: make dist -j110 and check vbmeta.img
Bug: 214409109
Signed-off-by: Lucas Wei <lucaswei@google.com>
Change-Id: Id07433f3dc33f95e2edd49de890f1e098cb9ef31
2022-04-21 00:27:27 +08:00
Iavor-Valentin Iftime
40adb17a1c Rebuild and copy recovery and boot img when using vendor_otatools
Rebuild recovery and boot images with vbmeta footers and copy together with recovery patch/install files when building vendor images using vendor otatools. Fixes validate_target_files failure.

Bug: 220126689
Bug: 186097910

Test: sign_target_files_apks \
        --vendor_otatools=otatools_vendor_dir \
	--vendor_partitions=vendor,odm \
	merged-target_files.zip \
	signed-target_files.zip
Test: validate_target_files signed-target_files.zip

Change-Id: Id45c67405bc37b769757db1701507f82cc6068d3
2022-04-19 18:35:36 +00:00
Melisa Carranza Zúñiga
69e6d82106 Revert "Merge "Adding sepolicy sign params to sign_target_files_apks." am: fb042449e0 am: bd8c313275 am: a2db49becd"
This reverts commit 6e6c22c70e.

Reason for revert: Updateable SEPolicy is punted.

Change-Id: I99524d13811028a4036aa85c74cf10974fe08165
2022-04-12 23:22:11 +00:00
Melisa Carranza Zúñiga
6e6c22c70e Merge "Adding sepolicy sign params to sign_target_files_apks." am: fb042449e0 am: bd8c313275 am: a2db49becd
Original change: https://android-review.googlesource.com/c/platform/build/+/2028269

Change-Id: Id27f7043ca2122cf43adf59e48843ffe5a445359
2022-03-22 18:46:25 +00:00
Treehugger Robot
7ecab5ff11 Merge "Rebuild and copy recovery patch files when using vendor_otatools" am: 93d7c150c9 am: c4a7031063 am: 07326c0417
Original change: https://android-review.googlesource.com/c/platform/build/+/2036543

Change-Id: Ic5871105c9867d22ee3666e6be02c523c6c5b493
2022-03-22 18:05:26 +00:00
Melisa Carranza Zúñiga
fb042449e0 Merge "Adding sepolicy sign params to sign_target_files_apks." 2022-03-22 18:00:43 +00:00
Iavor-Valentin Iftime
246a5c069a Rebuild and copy recovery patch files when using vendor_otatools
Rebuild recovery and copy recovery patch/install files when building vendor images using vendor otatools. Fixes ota_from_target_files failure.

Bug: 220126689
Bug: 186097910

Test: sign_target_files_apks \
        --vendor_otatools=otatools_vendor_dir \
	--vendor_partitions=vendor,odm \
	merged-target_files.zip \
	signed-target_files.zip

Change-Id: I4a415417e0d7b1bcd548292ec8f3a12570ec65f0
2022-03-22 13:51:10 +00:00
Melisa Carranza Zuniga
e6d4fb5ae6 Adding sepolicy sign params to sign_target_files_apks.
Bug: b/217570541
Test: sign_target_files_apks --sepolicy_key=build/make/tools/releasetools/testdata/testkey_RSA4096.key
--sepolicy_cert=build/make/tools/releasetools/testdata/testkey.x509.pem target_files.zip target_out.zip
Change-Id: I4ae9f2a3297d10de68c6444dea1cd9996ad9dd11

Change-Id: I4a1ac7009ae0d6bb53c74bd34f8c74f12ea0a3b8
2022-03-21 22:56:33 +00:00
Treehugger Robot
5444cac49a Merge "Copy vendor & odm .map files when using vendor_otatools" am: 6b3e5294db am: 32764d5b7e am: 0bd3600b17
Original change: https://android-review.googlesource.com/c/platform/build/+/2030363

Change-Id: I3f59d2477461f1027bedb44458b1510d39db1657
2022-03-17 19:44:52 +00:00
Iavor-Valentin Iftime
880e4432b9 Copy vendor & odm .map files when using vendor_otatools
Copy IMAGES/vendor.map and IMAGES/odm.map files when building vendor images
using vendor otatools. Fixes validate_target_files failure.

Bug: 220126689
Bug: 186097910

Test: sign_target_files_apks \
        --vendor_otatools=otatools_vendor_dir \
	--vendor_partitions=vendor,odm \
	merged-target_files.zip \
	signed-target_files.zip

Change-Id: Iaf904c90761b3830cf81af2561695c81bfc6c70d
2022-03-17 14:02:30 +00:00
Treehugger Robot
8b1a6f6cab Merge "Allow vendor_otatools arg to be file or folder" am: a2d6ed53f0 am: 8414a9e9c0 am: 93f34b089e
Original change: https://android-review.googlesource.com/c/platform/build/+/2007451

Change-Id: I2a861f598876b652fb5b36a34b541c2e98d4152f
2022-03-05 00:25:29 +00:00
Iavor-Valentin Iftime
63cde0fd92 Allow vendor_otatools arg to be file or folder
Required by signer script when using "--vendor_otatools" argument.

Bug: 220126689
Bug: 186097910

Test: sign_target_files_apks \
        --vendor_otatools=otatools_vendor_dir \
	--vendor_partitions=vendor,odm \
	merged-target_files.zip \
	signed-target_files.zip

Change-Id: Iaa596f95f9db1e1e423b8306e9590fe27acb76e7
2022-03-04 16:02:46 +00:00
Jooyung Han
dc24373bc8 Merge "Replace pvmfw embedded public key" am: 4d0af554ce am: 474339443f am: ba28c6a1f5
Original change: https://android-review.googlesource.com/c/platform/build/+/1990892

Change-Id: I3a4aa38e87bff56823e4b395af688964aa5260da
2022-02-25 07:52:54 +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
Daniel Norman
30f2cbbfe2 Merge "Fix build break for vendor freeze" am: f14e8caca7 am: 42a30f0ed4 am: 3cbb1bcfa8
Original change: https://android-review.googlesource.com/c/platform/build/+/1836120

Change-Id: Ib85b720da8fbb55dc3b9ba9c7e13f78a1f041f2c
2022-02-18 22:08:21 +00:00
Daniel Norman
f14e8caca7 Merge "Fix build break for vendor freeze" 2022-02-17 22:01:22 +00:00
Treehugger Robot
dc04f552d5 Merge "Fix signing failure when no entry to convert to store" am: ea586a8d71 am: 8e9b39e061 am: 9c03d6a61e am: b3c67ad42e
Original change: https://android-review.googlesource.com/c/platform/build/+/1978755

Change-Id: I5a28c53819b7b7f99851cddb3ff0f7363c6c11d4
2022-02-10 13:57:06 +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
Treehugger Robot
fead7b745f Merge "core & tools: system_dlkm: add dynamic partition" am: ef25de413e am: 0f5c34115c am: b4a4dee4c9 am: 144934f1fc
Original change: https://android-review.googlesource.com/c/platform/build/+/1963868

Change-Id: I122e7b631f692e9c5e05948e8fe25a24d4626f5d
2022-02-02 07:20:35 +00: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
Jacky Liu
0e3352a241 Merge "Add PRODUCT_EXTRA_OTA_KEYS to add extra ota keys in otacerts.zip" am: bff997fd1f am: 4f9eb6b9e4 am: 429e1f339b am: 5f1bdb32ae
Original change: https://android-review.googlesource.com/c/platform/build/+/1934214

Change-Id: Ic9e4bdd75e95d6df1595e1371977a532ae830db3
2022-01-06 07:37:19 +00:00
Treehugger Robot
8a3ac7b505 Merge "Fix the signing error on no-system-image targets" am: 790214a4c9 am: ba922579b1 am: 2a00929dec am: 50bf9c8a11
Original change: https://android-review.googlesource.com/c/platform/build/+/1936199

Change-Id: Ie9d4557587a1df9267d1a00ee97d4f46ec8d3ac2
2022-01-06 07:37:07 +00: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
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