Support to merge PREBUILT_IMAGES

For example, pvmfw.img comes from framework target files package
and dtbo.img comes from vendor target files package.

Test: merge_target_files
Change-Id: If2e6fac5ce3671e3387e801808a195fb7b2c55b5
This commit is contained in:
Po Hu
2023-03-29 17:49:49 +08:00
parent f0889e28b6
commit 81c3f4a884

View File

@@ -129,6 +129,7 @@ def ValidateConfigLists():
_PARTITION_ITEM_PATTERN = re.compile(r'^([A-Z_]+)/.*$') _PARTITION_ITEM_PATTERN = re.compile(r'^([A-Z_]+)/.*$')
_IMAGE_PARTITION_PATTERN = re.compile(r'^IMAGES/(.*)\.img$') _IMAGE_PARTITION_PATTERN = re.compile(r'^IMAGES/(.*)\.img$')
_PREBUILT_IMAGE_PARTITION_PATTERN = re.compile(r'^PREBUILT_IMAGES/(.*)\.img$')
def ItemListToPartitionSet(item_list): def ItemListToPartitionSet(item_list):
@@ -151,12 +152,12 @@ def ItemListToPartitionSet(item_list):
partition_set = set() partition_set = set()
for item in item_list: for item in item_list:
for pattern in (_PARTITION_ITEM_PATTERN, _IMAGE_PARTITION_PATTERN): for pattern in (_PARTITION_ITEM_PATTERN, _IMAGE_PARTITION_PATTERN, _PREBUILT_IMAGE_PARTITION_PATTERN):
partition_match = pattern.search(item.strip()) partition_match = pattern.search(item.strip())
if partition_match: if partition_match:
partition = partition_match.group(1).lower() partition = partition_match.group(1).lower()
# These directories in target-files are not actual partitions. # These directories in target-files are not actual partitions.
if partition not in ('meta', 'images'): if partition not in ('meta', 'images', 'prebuilt_images'):
partition_set.add(partition) partition_set.add(partition)
return partition_set return partition_set
@@ -165,7 +166,7 @@ def ItemListToPartitionSet(item_list):
# Partitions that are grabbed from the framework partial build by default. # Partitions that are grabbed from the framework partial build by default.
_FRAMEWORK_PARTITIONS = { _FRAMEWORK_PARTITIONS = {
'system', 'product', 'system_ext', 'system_other', 'root', 'system_dlkm', 'system', 'product', 'system_ext', 'system_other', 'root', 'system_dlkm',
'vbmeta_system' 'vbmeta_system', 'pvmfw'
} }
@@ -201,7 +202,7 @@ def InferItemList(input_namelist, framework):
if partition == 'meta': if partition == 'meta':
continue continue
if partition == 'images': if partition in ('images', 'prebuilt_images'):
image_partition, extension = os.path.splitext(os.path.basename(namelist)) image_partition, extension = os.path.splitext(os.path.basename(namelist))
if image_partition == 'vbmeta': if image_partition == 'vbmeta':
# Always regenerate vbmeta.img since it depends on hash information # Always regenerate vbmeta.img since it depends on hash information