validate_target_files: support gki_arm64
gki_arm64 is a special target to build multiple GKI boot-*.img
files. It has neither system.img nor vbmeta.img. Skips checking
system.img and vbmeta.img in this case.
Bug: 223078405
Test: validate_target_files signed-gki_arm64-target_files-8277156.zip
Change-Id: I9d3c102c11787cf70c1e1fc8e6a552f8fd19ff72
diff --git a/tools/releasetools/validate_target_files.py b/tools/releasetools/validate_target_files.py
index 282dc99..beb9e75 100755
--- a/tools/releasetools/validate_target_files.py
+++ b/tools/releasetools/validate_target_files.py
@@ -131,8 +131,10 @@
logging.warning('Skipped due to target using non-sparse images')
return
- # Verify IMAGES/system.img.
- CheckAllFiles('system')
+ # Verify IMAGES/system.img if applicable.
+ # Some targets, e.g., gki_arm64, gki_x86_64, etc., are system.img-less.
+ if 'IMAGES/system.img' in input_zip.namelist():
+ CheckAllFiles('system')
# Verify IMAGES/vendor.img if applicable.
if 'VENDOR/' in input_zip.namelist():
@@ -259,9 +261,6 @@
def ValidatePartitionFingerprints(input_tmp, info_dict):
build_info = common.BuildInfo(info_dict)
- if not build_info.avb_enabled:
- logging.info("AVB not enabled, skipping partition fingerprint checks")
- return
# Expected format:
# Prop: com.android.build.vendor.fingerprint -> 'generic/aosp_cf_x86_64_phone/vsoc_x86_64:S/AOSP.MASTER/7335886:userdebug/test-keys'
# Prop: com.android.build.vendor_boot.fingerprint -> 'generic/aosp_cf_x86_64_phone/vsoc_x86_64:S/AOSP.MASTER/7335886:userdebug/test-keys'
@@ -398,7 +397,7 @@
verity_key_mincrypt, stdoutdata.rstrip())
# Handle the case of Verified Boot 2.0 (AVB).
- if info_dict.get("avb_enable") == "true":
+ if info_dict.get("avb_building_vbmeta_image") == "true":
logging.info('Verifying Verified Boot 2.0 (AVB) images...')
key = options['verity_key']