summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-03-20 20:04:27 -0700
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2025-03-20 20:04:27 -0700
commitd6a56a2d9a161135da0a439a71e610cc3e3d6db4 (patch)
tree2ab59e54fbea074557448ef8e9eb5db4f75a759c /tools
parenta4ebb5df54ebcd126cc1990b222f6830463a9b15 (diff)
parentde6c2706365b034d04fdf177c6488b7816a69b9a (diff)
Merge "Don't put BOARD_CUSTOMIMAGES_PARTITION_LIST partitions with IMAGE_NO_FLASHALL into $PRODUCT-img.zip" into main am: de6c270636
Original change: https://android-review.googlesource.com/c/platform/build/+/3554854 Change-Id: I545464e97b3f922b3ec9e7aee3f4f2a5347488a2 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/releasetools/img_from_target_files.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/releasetools/img_from_target_files.py b/tools/releasetools/img_from_target_files.py
index b7a5ad8b74..186257786a 100755
--- a/tools/releasetools/img_from_target_files.py
+++ b/tools/releasetools/img_from_target_files.py
@@ -35,6 +35,10 @@ Flags:
`filespec` arg in zip2zip's help message). The option can be repeated to
include multiple entries.
+ --exclude <filespec>
+ Don't include these files. If the file is in --additional and --exclude,
+ the file will not be included.
+
"""
from __future__ import print_function
@@ -56,6 +60,7 @@ logger = logging.getLogger(__name__)
OPTIONS = common.OPTIONS
OPTIONS.additional_entries = []
+OPTIONS.excluded_entries = []
OPTIONS.bootable_only = False
OPTIONS.put_super = None
OPTIONS.put_bootloader = None
@@ -245,6 +250,9 @@ def ImgFromTargetFiles(input_file, output_file):
# Any additional entries provided by caller.
entries += OPTIONS.additional_entries
+ # Remove any excluded entries
+ entries = [e for e in entries if e not in OPTIONS.excluded_entries]
+
CopyZipEntries(input_file, output_file, entries)
if rebuild_super:
@@ -258,6 +266,8 @@ def main(argv):
OPTIONS.bootable_only = True
elif o == '--additional':
OPTIONS.additional_entries.append(a)
+ elif o == '--exclude':
+ OPTIONS.excluded_entries.append(a)
elif o == '--build_super_image':
OPTIONS.build_super_image = a
else:
@@ -268,6 +278,7 @@ def main(argv):
extra_opts='z',
extra_long_opts=[
'additional=',
+ 'exclude=',
'bootable_zip',
'build_super_image=',
],