Skip to content

Commit 3cd6bd4

Browse files
jainvikas8Patater
authored andcommitted
psa: Add TF-M utility scripts to python path
When python3 is enforced to build the ARM_MUSCA_A1 or ARM_MUSCA_B1 targets, it is unable to find binary utility tool scripts which are imported from TF-M. The reason to use the python3 environment is as follows: Mbed OS + TFM contained a faulty boot record TLV, which failed the attestation test (TF-M regression). The data in the boot record TLV will be included in the generated attestation token as 1 item in the SW_COMPONENTS claim. This data (in the boot record TLV) is pre-encoded in CBOR format at build time and appended to the image during the image signing process (done by the imgtool Python3 script). Signed-off-by: Vikas Katariya <[email protected]>
1 parent be09f92 commit 3cd6bd4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/targets/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import shutil
2323
import inspect
2424
import sys
25+
2526
from collections import namedtuple
2627
from copy import copy
2728
from future.utils import raise_from
@@ -31,6 +32,11 @@
3132
from tools.utils import json_file_to_dict, NotSupportedException
3233
from tools.psa import find_secure_image
3334

35+
# Add PSA TF-M binary utility scripts in system path
36+
from os.path import dirname, abspath, join
37+
TFM_SCRIPTS = abspath(join(dirname(__file__), '..', 'psa', 'tfm', 'bin_utils'))
38+
sys.path.insert(0, TFM_SCRIPTS)
39+
3440

3541
__all__ = ["target", "TARGETS", "TARGET_MAP", "TARGET_NAMES", "CORE_LABELS",
3642
"CORE_ARCH", "HookError", "generate_py_target", "Target",

0 commit comments

Comments
 (0)