Don't regenerate userdata.img when signing
The userdata.img and cache.img entries are not useful in signed builds;
because fastboot doesn't look at these two entries in the *img.zip when
flashing a device. And they aren't used elsewhere. Therefore, skip
building the image files for them when signing the target files with
sign_target_files_apks. Also, add an option "--is_signing" to avoid
adding these two images when we call add_img_to_target_files.
Change-Id: I39ba91a86d9a856d7d01771f6d1403dbf21f2011
Test: Run sign_target_files_apks on a target file and userdata/cache.img doesn't not generate.
Bug: 30642470
diff --git a/tools/releasetools/sign_target_files_apks.py b/tools/releasetools/sign_target_files_apks.py
index 0f20f82..6d68be1 100755
--- a/tools/releasetools/sign_target_files_apks.py
+++ b/tools/releasetools/sign_target_files_apks.py
@@ -713,7 +713,9 @@
common.ZipClose(input_zip)
common.ZipClose(output_zip)
- add_img_to_target_files.AddImagesToTargetFiles(args[1])
+ # Skip building userdata.img and cache.img when signing the target files.
+ new_args = ["--is_signing", args[1]]
+ add_img_to_target_files.main(new_args)
print "done."