summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorTakeshi Kanemoto <takeshi.kanemoto@sonymobile.com>2013-11-14 17:20:50 +0900
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2014-01-27 15:01:04 +0900
commite153b3464374155d03bfe47092faaab555b89e81 (patch)
tree0a50e2c332adadf74b23dd73e9a69a931344fa26 /tools
parent7c7f28e71044ca04d368dec626faba37fe74818d (diff)
downloadbuild-e153b3464374155d03bfe47092faaab555b89e81.zip
build-e153b3464374155d03bfe47092faaab555b89e81.tar.gz
build-e153b3464374155d03bfe47092faaab555b89e81.tar.bz2
ota_from_target_files: Add an option to not sign OTA packages
Sometimes it is useful to be able to tell ota_from_target_files to not sign the output zip file. For instance, the private release key may not be available when ota_from_target_files is executed; similarly the release tools may not be available or executable where the private key is stored. This change adds an option, '--no_signing', to simply output the unsigned OTA zip file, instead of spuriously signing it with the test key even though the zip file would need to be re-signed later with a different key. Change-Id: I1f3c4dc8ffa35ce85478f848b147aff3d40fe283
Diffstat (limited to 'tools')
-rwxr-xr-xtools/releasetools/ota_from_target_files18
1 files changed, 13 insertions, 5 deletions
diff --git a/tools/releasetools/ota_from_target_files b/tools/releasetools/ota_from_target_files
index 2ef896f..b7e6613 100755
--- a/tools/releasetools/ota_from_target_files
+++ b/tools/releasetools/ota_from_target_files
@@ -88,6 +88,7 @@ OPTIONS.omit_prereq = False
OPTIONS.extra_script = None
OPTIONS.aslr_mode = True
OPTIONS.worker_threads = 3
+OPTIONS.no_signing = False
def MostPopularKey(d, default):
"""Given a dict, return the key corresponding to the largest
@@ -822,6 +823,8 @@ def main(argv):
OPTIONS.aslr_mode = False
elif o in ("--worker_threads"):
OPTIONS.worker_threads = int(a)
+ elif o in ("--no_signing"):
+ OPTIONS.no_signing = True
else:
return False
return True
@@ -836,6 +839,7 @@ def main(argv):
"extra_script=",
"worker_threads=",
"aslr_mode=",
+ "no_signing",
],
extra_option_handler=option_handler)
@@ -870,9 +874,12 @@ def main(argv):
OPTIONS.device_specific = os.path.normpath(OPTIONS.device_specific)
print "using device-specific extensions in", OPTIONS.device_specific
- temp_zip_file = tempfile.NamedTemporaryFile()
- output_zip = zipfile.ZipFile(temp_zip_file, "w",
- compression=zipfile.ZIP_DEFLATED)
+ if OPTIONS.no_signing:
+ output_zip = zipfile.ZipFile(args[1], "w", compression=zipfile.ZIP_DEFLATED)
+ else:
+ temp_zip_file = tempfile.NamedTemporaryFile()
+ output_zip = zipfile.ZipFile(temp_zip_file, "w",
+ compression=zipfile.ZIP_DEFLATED)
if OPTIONS.incremental_source is None:
WriteFullOTAPackage(input_zip, output_zip)
@@ -896,8 +903,9 @@ def main(argv):
output_zip.close()
- SignOutput(temp_zip_file.name, args[1])
- temp_zip_file.close()
+ if not OPTIONS.no_signing:
+ SignOutput(temp_zip_file.name, args[1])
+ temp_zip_file.close()
common.Cleanup()