aboutsummaryrefslogtreecommitdiff
path: root/bl2
diff options
context:
space:
mode:
authorBalint Matyi <Balint.Matyi@arm.com>2020-06-22 08:35:52 +0100
committerTamas Ban <tamas.ban@arm.com>2020-07-22 11:40:16 +0000
commitd9abb4973c5d7842f3bab8a7b34736472000f98e (patch)
tree202ce2c8531c94c0ff4ac147f5c7245e8d66851a /bl2
parent3bae8830af4c9b443cf0aa0902bffb0f08328e92 (diff)
downloadtrusted-firmware-m-d9abb4973c5d7842f3bab8a7b34736472000f98e.tar.gz
Boot: Use the PyPI version of imgtool
Modifies the Python wrapper for imgtool in TF-M to use the PyPI version instead of the one in the MCUBoot repository. Signed-off-by: Balint Matyi <Balint.Matyi@arm.com> Change-Id: I0b3fb9c802c59628cced0962241a1b4573a00cfc
Diffstat (limited to 'bl2')
-rw-r--r--bl2/ext/mcuboot/MCUBoot.cmake6
-rw-r--r--bl2/ext/mcuboot/scripts/requirements.txt1
-rw-r--r--bl2/ext/mcuboot/scripts/wrapper/wrapper.py (renamed from bl2/ext/mcuboot/scripts/wrapper.py)9
3 files changed, 8 insertions, 8 deletions
diff --git a/bl2/ext/mcuboot/MCUBoot.cmake b/bl2/ext/mcuboot/MCUBoot.cmake
index 71ed6e915..28dd7feaf 100644
--- a/bl2/ext/mcuboot/MCUBoot.cmake
+++ b/bl2/ext/mcuboot/MCUBoot.cmake
@@ -166,7 +166,7 @@ if (MCUBOOT_IMAGE_NUMBER GREATER 1)
POST_BUILD
#Sign secure binary image with default public key in mcuboot folder
- COMMAND ${PYTHON_EXECUTABLE} ${MCUBOOT_DIR}/scripts/wrapper.py
+ COMMAND ${PYTHON_EXECUTABLE} ${MCUBOOT_DIR}/scripts/wrapper/wrapper.py
ARGS -k ${KEY_FILE_S}
--public-key-format ${PUBLIC_KEY_FORMAT}
--align 1
@@ -182,7 +182,7 @@ if (MCUBOOT_IMAGE_NUMBER GREATER 1)
${CMAKE_BINARY_DIR}/${_MY_PARAMS_S_BIN}_signed.bin
#Sign non-secure binary image with default public key in mcuboot folder
- COMMAND ${PYTHON_EXECUTABLE} ${MCUBOOT_DIR}/scripts/wrapper.py
+ COMMAND ${PYTHON_EXECUTABLE} ${MCUBOOT_DIR}/scripts/wrapper/wrapper.py
ARGS -k ${KEY_FILE_NS}
--public-key-format ${PUBLIC_KEY_FORMAT}
--align 1
@@ -263,7 +263,7 @@ else() # MCUBOOT_IMAGE_NUMBER = 1
-o ${CMAKE_BINARY_DIR}/${_MY_PARAMS_FULL_BIN}.bin
#Sign concatenated binary image with default public key in mcuboot folder
- COMMAND ${PYTHON_EXECUTABLE} ${MCUBOOT_DIR}/scripts/wrapper.py
+ COMMAND ${PYTHON_EXECUTABLE} ${MCUBOOT_DIR}/scripts/wrapper/wrapper.py
ARGS -k ${KEY_FILE}
--public-key-format ${PUBLIC_KEY_FORMAT}
--align 1
diff --git a/bl2/ext/mcuboot/scripts/requirements.txt b/bl2/ext/mcuboot/scripts/requirements.txt
index d3c54b467..14bbb18f3 100644
--- a/bl2/ext/mcuboot/scripts/requirements.txt
+++ b/bl2/ext/mcuboot/scripts/requirements.txt
@@ -2,4 +2,5 @@ cryptography
pyasn1
pyyaml
cbor>=1.0.0
+imgtool>=1.6.0
click \ No newline at end of file
diff --git a/bl2/ext/mcuboot/scripts/wrapper.py b/bl2/ext/mcuboot/scripts/wrapper/wrapper.py
index 14ad07a10..09443367e 100644
--- a/bl2/ext/mcuboot/scripts/wrapper.py
+++ b/bl2/ext/mcuboot/scripts/wrapper/wrapper.py
@@ -11,13 +11,12 @@ import re
import os
import sys
import click
-import macro_parser
-# Import the external MCUBoot repo's imgtool script
-scripts_path = os.path.abspath(os.path.join(os.path.dirname(__file__),
- '../../../../../mcuboot/scripts'))
-sys.path.insert(0, scripts_path)
import imgtool
import imgtool.main
+# Import macro_parser script
+parser_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))
+sys.path.append(parser_path)
+import macro_parser
sign_bin_size_re = re.compile(r"^\s*RE_SIGN_BIN_SIZE\s*=\s*(.*)")
load_addr_re = re.compile(r"^\s*RE_IMAGE_LOAD_ADDRESS\s*=\s*(.*)")