diff options
author | Doug Zongker <dougz@android.com> | 2014-03-03 10:21:27 -0800 |
---|---|---|
committer | Doug Zongker <dougz@android.com> | 2014-03-03 10:21:27 -0800 |
commit | 25568486e5777f416d2fcb6cc7aa96caafc66880 (patch) | |
tree | 29b40f08bb5ccf71a82b179a3f16a579d853ceb0 /tools | |
parent | 36ac26a014263361c8388219c86c55b4962840ba (diff) | |
download | build-25568486e5777f416d2fcb6cc7aa96caafc66880.zip build-25568486e5777f416d2fcb6cc7aa96caafc66880.tar.gz build-25568486e5777f416d2fcb6cc7aa96caafc66880.tar.bz2 |
add option to specify updater binary, for development
Change-Id: I5f239afff70c87fb16ddc4b8abefa7bbcda6040d
Diffstat (limited to 'tools')
-rw-r--r-- | tools/releasetools/edify_generator.py | 2 | ||||
-rwxr-xr-x | tools/releasetools/ota_from_target_files | 19 |
2 files changed, 15 insertions, 6 deletions
diff --git a/tools/releasetools/edify_generator.py b/tools/releasetools/edify_generator.py index a5340a0..7978062 100644 --- a/tools/releasetools/edify_generator.py +++ b/tools/releasetools/edify_generator.py @@ -305,7 +305,7 @@ class EdifyGenerator(object): if input_path is None: data = input_zip.read("OTA/bin/updater") else: - data = open(os.path.join(input_path, "updater")).read() + data = open(input_path, "rb").read() common.ZipWriteStr(output_zip, "META-INF/com/google/android/update-binary", data, perms=0755) diff --git a/tools/releasetools/ota_from_target_files b/tools/releasetools/ota_from_target_files index 1afc640..a7936b1 100755 --- a/tools/releasetools/ota_from_target_files +++ b/tools/releasetools/ota_from_target_files @@ -21,7 +21,7 @@ a full OTA is produced. Usage: ota_from_target_files [flags] input_target_files output_ota_package - -b (--board_config) <file> + --board_config <file> Deprecated. -k (--package_key) <key> Key to use to sign the package (default is @@ -62,6 +62,11 @@ Usage: ota_from_target_files [flags] input_target_files output_ota_package file-based OTA if the target_files is older and doesn't support block-based OTAs. + -b (--binary) <file> + Use the given binary as the update-binary in the output package, + instead of the binary in the build's target_files. Use for + development only. + """ import sys @@ -103,6 +108,7 @@ OPTIONS.worker_threads = 3 OPTIONS.two_step = False OPTIONS.no_signing = False OPTIONS.block_based = False +OPTIONS.updater_binary = None def MostPopularKey(d, default): """Given a dict, return the key corresponding to the largest @@ -507,7 +513,7 @@ reboot_now("%(bcb_dev)s", ""); endif; endif; """ % bcb_dev) - script.AddToZip(input_zip, output_zip) + script.AddToZip(input_zip, output_zip, input_path=OPTIONS.updater_binary) WriteMetadata(metadata, output_zip) def WritePolicyConfig(file_context, output_zip): @@ -748,7 +754,7 @@ endif; """ % bcb_dev) script.SetProgress(1) - script.AddToZip(target_zip, output_zip) + script.AddToZip(target_zip, output_zip, input_path=OPTIONS.updater_binary) WriteMetadata(metadata, output_zip) def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip): @@ -1127,14 +1133,14 @@ endif; endif; """ % bcb_dev) - script.AddToZip(target_zip, output_zip) + script.AddToZip(target_zip, output_zip, input_path=OPTIONS.updater_binary) WriteMetadata(metadata, output_zip) def main(argv): def option_handler(o, a): - if o in ("-b", "--board_config"): + if o == "--board_config": pass # deprecated elif o in ("-k", "--package_key"): OPTIONS.package_key = a @@ -1159,6 +1165,8 @@ def main(argv): OPTIONS.no_signing = True elif o == "--block": OPTIONS.block_based = True + elif o in ("-b", "--binary"): + OPTIONS.updater_binary = a else: return False return True @@ -1176,6 +1184,7 @@ def main(argv): "two_step", "no_signing", "block", + "binary=", ], extra_option_handler=option_handler) |