From 6ece1c9dac9817732cf73574d14cd84c589d4b35 Mon Sep 17 00:00:00 2001 From: Oliver Scott Date: Wed, 1 Apr 2020 18:58:34 -0400 Subject: [PATCH] releasetools: support prebuilt vendor.img Signing builds with prebuilt vendor.img causes the following error: Traceback (most recent call last): File "./build/make/tools/releasetools/sign_target_files_apks", line 1230, in main(sys.argv[1:]) File "./build/make/tools/releasetools/sign_target_files_apks", line 1223, in main add_img_to_target_files.main(new_args) File ".../build/make/tools/releasetools/add_img_to_target_files.py", line 942, in main AddImagesToTargetFiles(args[0]) File ".../build/make/tools/releasetools/add_img_to_target_files.py", line 892, in AddImagesToTargetFiles CheckAbOtaImages(output_zip, ab_partitions) File ".../build/make/tools/releasetools/add_img_to_target_files.py", line 562, in CheckAbOtaImages assert available, "Failed to find " + img_name AssertionError: Failed to find vendor.img This patch addresses this error by copying IMAGES/vendor.img if it exists in the input zip Test: Follow https://source.android.com/devices/tech/ota/sign_builds#release-keys and then https://source.android.com/devices/tech/ota/sign_builds#creating-image-files Change-Id: I903ff20d79bcf7621ebf29f0b8dfe85ebc3fb1ff --- tools/releasetools/sign_target_files_apks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/releasetools/sign_target_files_apks.py b/tools/releasetools/sign_target_files_apks.py index 936ef888dc..d262db963a 100755 --- a/tools/releasetools/sign_target_files_apks.py +++ b/tools/releasetools/sign_target_files_apks.py @@ -520,7 +520,7 @@ def ProcessTargetFiles(input_tf_zip, output_tf_zip, misc_info, for info in input_tf_zip.infolist(): filename = info.filename - if filename.startswith("IMAGES/"): + if filename.startswith("IMAGES/") and not filename.endswith("vendor.img"): continue # Skip OTA-specific images (e.g. split super images), which will be @@ -1404,7 +1404,7 @@ def main(argv): common.ZipClose(output_zip) # Skip building userdata.img and cache.img when signing the target files. - new_args = ["--is_signing"] + new_args = ["--is_signing", "--add_missing"] # add_img_to_target_files builds the system image from scratch, so the # recovery patch is guaranteed to be regenerated there. if OPTIONS.rebuild_recovery: -- GitLab