aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinyu Zhang <xinyu.zhang@arm.com>2021-03-31 16:26:20 +0800
committerKen Liu <ken.liu@arm.com>2021-04-12 07:11:06 +0200
commit19504a550ce608765322d7e4b5dc1601159627f1 (patch)
tree3c15229383cae94916c7ab0bf82d8fbcc7f0dded
parentaa7d90a23b045e50c26ef66b11250842b665f54b (diff)
downloadtrusted-firmware-m-19504a550ce608765322d7e4b5dc1601159627f1.tar.gz
Tool: Detect duplicated partition IDs
Add logic in existing manifest tools to detect duplicated partition IDs. Signed-off-by: Xinyu Zhang <xinyu.zhang@arm.com> Change-Id: Id2e19af1f37f42f26bb7442307f582f263d032d5
-rw-r--r--tools/tfm_parse_manifest_list.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/tfm_parse_manifest_list.py b/tools/tfm_parse_manifest_list.py
index cfc6bfcbd..e788554bd 100644
--- a/tools/tfm_parse_manifest_list.py
+++ b/tools/tfm_parse_manifest_list.py
@@ -77,7 +77,13 @@ def process_manifest(manifest_list_files):
memorytemplate = ENV.get_template('secure_fw/partitions/partition_intermedia.template')
print("Start to generate PSA manifests:")
+ pid_list = []
for manifest_item in manifest_list:
+ # Check if partition ID is duplicated
+ if manifest_item['pid'] in pid_list:
+ raise Exception("PID No. {pid} has already been used!".format(pid=manifest_item['pid']))
+ pid_list.append(manifest_item['pid'])
+
# Replace environment variables in the manifest path
manifest_path = os.path.expandvars(manifest_item['manifest'])
file = open(manifest_path)