diff options
author | Tianjie Xu <xunchang@google.com> | 2016-06-28 14:34:03 -0700 |
---|---|---|
committer | Tianjie Xu <xunchang@google.com> | 2016-06-29 18:32:30 +0000 |
commit | aaca421ec12eff32d49bff76515322b85282ba72 (patch) | |
tree | 5f8decff430a4a4e86885d622918d002b25359a9 | |
parent | 73609480b3d04693e73e93595cc8390882ae710f (diff) | |
download | build-aaca421ec12eff32d49bff76515322b85282ba72.tar.gz |
Skip copying existing vendor images
add_img_to_target_files.py has an option of "-a" to add missing
images only. Under this option, the script should skip copying
the radio images for A/B devices when given image exists already
under "IMAGES/".
Test: Run the command on an A/B device, the existing radio images under "IMAGES/" don't get overwritten; and missing images are added correctly.
Bug: 29608905
Change-Id: Ie034b85a5d777d53e367f99470cea4d19cb1aaaf
-rwxr-xr-x | tools/releasetools/add_img_to_target_files.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py index 02e940eea1..5730019aa2 100755 --- a/tools/releasetools/add_img_to_target_files.py +++ b/tools/releasetools/add_img_to_target_files.py @@ -396,12 +396,18 @@ def AddImagesToTargetFiles(filename): # For devices using A/B update, copy over images from RADIO/ and/or # VENDOR_IMAGES/ to IMAGES/ and make sure we have all the needed # images ready under IMAGES/. All images should have '.img' as extension. + banner("radio") ab_partitions = os.path.join(OPTIONS.input_tmp, "META", "ab_partitions.txt") if os.path.exists(ab_partitions): with open(ab_partitions, 'r') as f: lines = f.readlines() for line in lines: img_name = line.strip() + ".img" + prebuilt_path = os.path.join(OPTIONS.input_tmp, "IMAGES", img_name) + if os.path.exists(prebuilt_path): + print "%s already exists, no need to overwrite..." % (img_name,) + continue + img_radio_path = os.path.join(OPTIONS.input_tmp, "RADIO", img_name) img_vendor_dir = os.path.join( OPTIONS.input_tmp, "VENDOR_IMAGES") |