From a3c3b9bc64e45b51c210e062b6a61a04333be36c Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Fri, 10 May 2019 15:47:37 -0700 Subject: [PATCH] releasetools: Unzip all files when generating image archive. Commit 7df64c3e starts to call common.LoadInfoDict() when generating image archive, which reads additional files under BOOT/, RECOVERY/ and ROOT/. Unzip everything from the target_files.zip. Bug: 132456827 Test: Run img_from_target_files.py on previously failing target_files.zip. Change-Id: I22ee57c4f765bee9494478bf115b1581877401f4 --- tools/releasetools/img_from_target_files.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/releasetools/img_from_target_files.py b/tools/releasetools/img_from_target_files.py index d44931ac81..e01b5e8ecd 100755 --- a/tools/releasetools/img_from_target_files.py +++ b/tools/releasetools/img_from_target_files.py @@ -166,8 +166,10 @@ def main(argv): common.InitLogging() - OPTIONS.input_tmp = common.UnzipTemp(args[0], - ["IMAGES/*", "OTA/*", "META/*"]) + # We need files under IMAGES/, OTA/, META/ for img_from_target_files.py. + # However, common.LoadInfoDict() may read additional files under BOOT/, + # RECOVERY/ and ROOT/. So unzip everything from the target_files.zip. + OPTIONS.input_tmp = common.UnzipTemp(args[0]) LoadOptions(OPTIONS.input_tmp) output_zip = zipfile.ZipFile(args[1], "w", compression=zipfile.ZIP_DEFLATED, allowZip64=not OPTIONS.sparse_userimages)