aboutsummaryrefslogtreecommitdiffstats
path: root/tools/releasetools/validate_target_files.py
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2018-05-11 23:38:46 -0700
committerTao Bao <tbao@google.com>2018-05-11 23:38:46 -0700
commit63e2f49fddd1101dcaf342b30e09608319f40b18 (patch)
tree21004b17f346e2f258154b7ee6c5854891a11ace /tools/releasetools/validate_target_files.py
parentfc56b59db48b3608abca3e5834a94df932a61cda (diff)
downloadbuild_make-63e2f49fddd1101dcaf342b30e09608319f40b18.tar.gz
build_make-63e2f49fddd1101dcaf342b30e09608319f40b18.tar.bz2
build_make-63e2f49fddd1101dcaf342b30e09608319f40b18.zip
releasetools: Skip validating non-sparse images.
Targets can define 'TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true' to generate non-sparse system images, but validate_target_files.py doesn't work with such images. This CL adds a workaround to temporarily skip the file consistency check for such images. Bug: 79616357 Test: Run validate_target_files.py on a target_files.zip that's not using sparse image. Test: Run validate_target_files.py on marlin target_files.zip (which uses sparse image). Change-Id: I1f4066c5b3fec595b10cab10283d62c1c5a6c624
Diffstat (limited to 'tools/releasetools/validate_target_files.py')
-rwxr-xr-xtools/releasetools/validate_target_files.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/releasetools/validate_target_files.py b/tools/releasetools/validate_target_files.py
index e8cea298ae..acd5b6e36e 100755
--- a/tools/releasetools/validate_target_files.py
+++ b/tools/releasetools/validate_target_files.py
@@ -66,7 +66,7 @@ def ValidateFileAgainstSha1(input_tmp, file_name, file_path, expected_sha1):
file_name, actual_sha1, expected_sha1)
-def ValidateFileConsistency(input_zip, input_tmp):
+def ValidateFileConsistency(input_zip, input_tmp, info_dict):
"""Compare the files from image files and unpacked folders."""
def CheckAllFiles(which):
@@ -103,6 +103,11 @@ def ValidateFileConsistency(input_zip, input_tmp):
logging.info('Validating file consistency.')
+ # TODO(b/79617342): Validate non-sparse images.
+ if info_dict.get('extfs_sparse_flag') != '-s':
+ logging.warning('Skipped due to target using non-sparse images')
+ return
+
# Verify IMAGES/system.img.
CheckAllFiles('system')
@@ -324,10 +329,10 @@ def main():
logging.info("Unzipping the input target_files.zip: %s", args.target_files)
input_tmp = common.UnzipTemp(args.target_files)
+ info_dict = common.LoadInfoDict(input_tmp)
with zipfile.ZipFile(args.target_files, 'r') as input_zip:
- ValidateFileConsistency(input_zip, input_tmp)
+ ValidateFileConsistency(input_zip, input_tmp, info_dict)
- info_dict = common.LoadInfoDict(input_tmp)
ValidateInstallRecoveryScript(input_tmp, info_dict)
ValidateVerifiedBootImages(input_tmp, info_dict, options)