Loading core/Makefile +2 −0 Original line number Original line Diff line number Diff line Loading @@ -3417,6 +3417,8 @@ OTATOOLS := $(HOST_OUT_EXECUTABLES)/minigzip \ $(HOST_OUT_EXECUTABLES)/lib/shflags/shflags \ $(HOST_OUT_EXECUTABLES)/lib/shflags/shflags \ $(HOST_OUT_EXECUTABLES)/delta_generator \ $(HOST_OUT_EXECUTABLES)/delta_generator \ $(HOST_OUT_EXECUTABLES)/care_map_generator \ $(HOST_OUT_EXECUTABLES)/care_map_generator \ $(HOST_OUT_EXECUTABLES)/fc_sort \ $(HOST_OUT_EXECUTABLES)/sefcontext_compile \ $(LPMAKE) \ $(LPMAKE) \ $(AVBTOOL) \ $(AVBTOOL) \ $(BLK_ALLOC_TO_BASE_FS) \ $(BLK_ALLOC_TO_BASE_FS) \ Loading tools/releasetools/merge_target_files.py +38 −31 Original line number Original line Diff line number Diff line Loading @@ -35,7 +35,6 @@ Usage: merge_target_files.py [args] from __future__ import print_function from __future__ import print_function import argparse import fnmatch import fnmatch import logging import logging import os import os Loading @@ -48,6 +47,10 @@ import add_img_to_target_files logger = logging.getLogger(__name__) logger = logging.getLogger(__name__) OPTIONS = common.OPTIONS OPTIONS = common.OPTIONS OPTIONS.verbose = True OPTIONS.verbose = True OPTIONS.system_target_files = None OPTIONS.other_target_files = None OPTIONS.output_target_files = None OPTIONS.keep_tmp = False # system_extract_as_is_item_list is a list of items to extract from the partial # system_extract_as_is_item_list is a list of items to extract from the partial # system target files package as is, meaning these items will land in the # system target files package as is, meaning these items will land in the Loading Loading @@ -561,8 +564,7 @@ def merge_target_files( f.write(other_content) f.write(other_content) command = [ command = [ # TODO(124468071): Use soong_zip from otatools.zip 'soong_zip', 'prebuilts/build-tools/linux-x86/bin/soong_zip', '-d', '-d', '-o', output_zip, '-o', output_zip, '-C', output_target_files_temp_dir, '-C', output_target_files_temp_dir, Loading Loading @@ -643,36 +645,41 @@ def main(): common.InitLogging() common.InitLogging() parser = argparse.ArgumentParser() def option_handler(o, a): if o == '--system-target-files': parser.add_argument( OPTIONS.system_target_files = a '--system-target-files', elif o == '--other-target-files': required=True, OPTIONS.other_target_files = a help='The input target files package containing system bits.') elif o == '--output-target-files': OPTIONS.output_target_files = a parser.add_argument( elif o == '--keep_tmp': '--other-target-files', OPTIONS.keep_tmp = True required=True, else: help='The input target files package containing other bits.') return False return True parser.add_argument( '--output-target-files', args = common.ParseOptions( required=True, sys.argv[1:], __doc__, help='The output merged target files package.') extra_long_opts=[ 'system-target-files=', parser.add_argument( 'other-target-files=', '--keep-tmp', 'output-target-files=', required=False, "keep_tmp", action='store_true', ], help='Keep the temporary directories after execution.') extra_option_handler=option_handler) args = parser.parse_args() if (len(args) != 0 or OPTIONS.system_target_files is None or OPTIONS.other_target_files is None or OPTIONS.output_target_files is None): common.Usage(__doc__) return 1 return merge_target_files_with_temp_dir( return merge_target_files_with_temp_dir( system_target_files=args.system_target_files, system_target_files=OPTIONS.system_target_files, other_target_files=args.other_target_files, other_target_files=OPTIONS.other_target_files, output_target_files=args.output_target_files, output_target_files=OPTIONS.output_target_files, keep_tmp=args.keep_tmp) keep_tmp=OPTIONS.keep_tmp) if __name__ == '__main__': if __name__ == '__main__': Loading Loading
core/Makefile +2 −0 Original line number Original line Diff line number Diff line Loading @@ -3417,6 +3417,8 @@ OTATOOLS := $(HOST_OUT_EXECUTABLES)/minigzip \ $(HOST_OUT_EXECUTABLES)/lib/shflags/shflags \ $(HOST_OUT_EXECUTABLES)/lib/shflags/shflags \ $(HOST_OUT_EXECUTABLES)/delta_generator \ $(HOST_OUT_EXECUTABLES)/delta_generator \ $(HOST_OUT_EXECUTABLES)/care_map_generator \ $(HOST_OUT_EXECUTABLES)/care_map_generator \ $(HOST_OUT_EXECUTABLES)/fc_sort \ $(HOST_OUT_EXECUTABLES)/sefcontext_compile \ $(LPMAKE) \ $(LPMAKE) \ $(AVBTOOL) \ $(AVBTOOL) \ $(BLK_ALLOC_TO_BASE_FS) \ $(BLK_ALLOC_TO_BASE_FS) \ Loading
tools/releasetools/merge_target_files.py +38 −31 Original line number Original line Diff line number Diff line Loading @@ -35,7 +35,6 @@ Usage: merge_target_files.py [args] from __future__ import print_function from __future__ import print_function import argparse import fnmatch import fnmatch import logging import logging import os import os Loading @@ -48,6 +47,10 @@ import add_img_to_target_files logger = logging.getLogger(__name__) logger = logging.getLogger(__name__) OPTIONS = common.OPTIONS OPTIONS = common.OPTIONS OPTIONS.verbose = True OPTIONS.verbose = True OPTIONS.system_target_files = None OPTIONS.other_target_files = None OPTIONS.output_target_files = None OPTIONS.keep_tmp = False # system_extract_as_is_item_list is a list of items to extract from the partial # system_extract_as_is_item_list is a list of items to extract from the partial # system target files package as is, meaning these items will land in the # system target files package as is, meaning these items will land in the Loading Loading @@ -561,8 +564,7 @@ def merge_target_files( f.write(other_content) f.write(other_content) command = [ command = [ # TODO(124468071): Use soong_zip from otatools.zip 'soong_zip', 'prebuilts/build-tools/linux-x86/bin/soong_zip', '-d', '-d', '-o', output_zip, '-o', output_zip, '-C', output_target_files_temp_dir, '-C', output_target_files_temp_dir, Loading Loading @@ -643,36 +645,41 @@ def main(): common.InitLogging() common.InitLogging() parser = argparse.ArgumentParser() def option_handler(o, a): if o == '--system-target-files': parser.add_argument( OPTIONS.system_target_files = a '--system-target-files', elif o == '--other-target-files': required=True, OPTIONS.other_target_files = a help='The input target files package containing system bits.') elif o == '--output-target-files': OPTIONS.output_target_files = a parser.add_argument( elif o == '--keep_tmp': '--other-target-files', OPTIONS.keep_tmp = True required=True, else: help='The input target files package containing other bits.') return False return True parser.add_argument( '--output-target-files', args = common.ParseOptions( required=True, sys.argv[1:], __doc__, help='The output merged target files package.') extra_long_opts=[ 'system-target-files=', parser.add_argument( 'other-target-files=', '--keep-tmp', 'output-target-files=', required=False, "keep_tmp", action='store_true', ], help='Keep the temporary directories after execution.') extra_option_handler=option_handler) args = parser.parse_args() if (len(args) != 0 or OPTIONS.system_target_files is None or OPTIONS.other_target_files is None or OPTIONS.output_target_files is None): common.Usage(__doc__) return 1 return merge_target_files_with_temp_dir( return merge_target_files_with_temp_dir( system_target_files=args.system_target_files, system_target_files=OPTIONS.system_target_files, other_target_files=args.other_target_files, other_target_files=OPTIONS.other_target_files, output_target_files=args.output_target_files, output_target_files=OPTIONS.output_target_files, keep_tmp=args.keep_tmp) keep_tmp=OPTIONS.keep_tmp) if __name__ == '__main__': if __name__ == '__main__': Loading