summaryrefslogtreecommitdiff
path: root/tools/releasetools/merge_target_files.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/releasetools/merge_target_files.py')
-rwxr-xr-xtools/releasetools/merge_target_files.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/releasetools/merge_target_files.py b/tools/releasetools/merge_target_files.py
index 97b53d92a7..77c774a966 100755
--- a/tools/releasetools/merge_target_files.py
+++ b/tools/releasetools/merge_target_files.py
@@ -54,6 +54,10 @@ Usage: merge_target_files.py [args]
file patterns to copy into the --output-dir. Required if providing
the --output-dir flag.
+ --output-ota output-ota-package
+ The output ota package. This is a zip archive. Use of this flag may
+ require passing the --path common flag; see common.py.
+
--output-super-empty output-super-empty-image
If provided, creates a super_empty.img file from the merged target
files package and saves it at this path.
@@ -78,6 +82,7 @@ import zipfile
import add_img_to_target_files
import build_super_image
import common
+import ota_from_target_files
logger = logging.getLogger(__name__)
OPTIONS = common.OPTIONS
@@ -90,6 +95,7 @@ OPTIONS.other_item_list = None
OPTIONS.output_target_files = None
OPTIONS.output_dir = None
OPTIONS.output_item_list = None
+OPTIONS.output_ota = None
OPTIONS.output_super_empty = None
OPTIONS.rebuild_recovery = False
OPTIONS.keep_tmp = False
@@ -590,6 +596,7 @@ def merge_target_files(
output_target_files,
output_dir,
output_item_list,
+ output_ota,
output_super_empty,
rebuild_recovery):
"""Merge two target files packages together.
@@ -625,6 +632,8 @@ def merge_target_files(
output_target_files: The name of the output zip archive target files
package created by merging system and other.
+ output_ota: The name of the output zip archive ota package.
+
output_super_empty: If provided, creates a super_empty.img file from the
merged target files package and saves it at this path.
@@ -770,6 +779,15 @@ def merge_target_files(
logger.info('creating %s', output_target_files)
common.RunAndWait(command, verbose=True)
+ # Create the OTA package from the merged target files package.
+
+ if output_ota:
+ ota_from_target_files_args = [
+ output_zip,
+ output_ota,
+ ]
+ ota_from_target_files.main(ota_from_target_files_args)
+
def call_func_with_temp_dir(func, keep_tmp):
"""Manage the creation and cleanup of the temporary directory.
@@ -827,6 +845,8 @@ def main():
OPTIONS.output_dir = a
elif o == '--output-item-list':
OPTIONS.output_item_list = a
+ elif o == '--output-ota':
+ OPTIONS.output_ota = a
elif o == '--output-super-empty':
OPTIONS.output_super_empty = a
elif o == '--rebuild_recovery':
@@ -848,6 +868,7 @@ def main():
'output-target-files=',
'output-dir=',
'output-item-list=',
+ 'output-ota=',
'output-super-empty=',
'rebuild_recovery',
'keep-tmp',
@@ -901,6 +922,7 @@ def main():
output_target_files=OPTIONS.output_target_files,
output_dir=OPTIONS.output_dir,
output_item_list=output_item_list,
+ output_ota=OPTIONS.output_ota,
output_super_empty=OPTIONS.output_super_empty,
rebuild_recovery=OPTIONS.rebuild_recovery),
OPTIONS.keep_tmp)