Update split build support
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
Change-Id: I582379b4c133905575f28965ef656261e1204627
diff --git a/build_helper/build_helper_configs.py b/build_helper/build_helper_configs.py
index c95dafe..ebe61ae 100755
--- a/build_helper/build_helper_configs.py
+++ b/build_helper/build_helper_configs.py
@@ -46,6 +46,8 @@
# provided in the seed dictionary.
"spe_config_template": "cmake -G Ninja " + \
+ "-S %(tfm_tests_root_dir)s/%(test_root_dir)s/spe " + \
+ "-B %(ci_build_root_dir)s/spe " + \
"-DTFM_PLATFORM=%(tfm_platform)s " + \
"-DTFM_TOOLCHAIN_FILE=%(codebase_root_dir)s/%(compiler)s " + \
"-DTFM_ISOLATION_LEVEL=%(isolation_level)s " + \
@@ -54,28 +56,24 @@
"-DTEST_PSA_API=%(test_psa_api)s " + \
"-DBL2=%(with_bl2)s " + \
"-DTFM_PROFILE=%(profile)s " + \
- "-DCONFIG_TFM_BUILD_SPLIT=ON " + \
- "-DCMAKE_INSTALL_PREFIX=%(codebase_root_dir)s/../ci_build/api_ns " +\
"%(extra_params)s " + \
- "-DTFM_TEST_REPO_PATH=%(codebase_root_dir)s/../tf-m-tests " + \
+ "-DCONFIG_TFM_SOURCE_PATH=%(codebase_root_dir)s " + \
"-DMBEDCRYPTO_PATH=%(codebase_root_dir)s/../mbedtls " + \
"-DPSA_ARCH_TESTS_PATH=%(codebase_root_dir)s/../psa-arch-tests " + \
"-DMCUBOOT_PATH=%(codebase_root_dir)s/../mcuboot " + \
"-DQCBOR_PATH=%(codebase_root_dir)s/../qcbor " + \
- "-DTFM_EXTRAS_REPO_PATH=%(codebase_root_dir)s/../tf-m-extras " + \
- "-S %(codebase_root_dir)s " + \
- "-B %(codebase_root_dir)s/../ci_build/spe_build ",
+ "-DTFM_EXTRAS_REPO_PATH=%(codebase_root_dir)s/../tf-m-extras ",
"nspe_config_template": "cmake -G Ninja " + \
- "%(test_regression)s " + \
+ "-S %(tfm_tests_root_dir)s/%(test_root_dir)s " + \
+ "-B %(ci_build_root_dir)s/nspe " + \
+ "-DCONFIG_SPE_PATH=%(ci_build_root_dir)s/spe/api_ns " + \
"%(extra_params)s " + \
- "-DCONFIG_SPE_PATH=%(codebase_root_dir)s/../ci_build/api_ns " + \
- "-S %(codebase_root_dir)s/../tf-m-tests/app_ns_test " + \
- "-B %(codebase_root_dir)s/../ci_build/nspe_build ",
+ "-DQCBOR_PATH=%(codebase_root_dir)s/../qcbor ",
# CMake build commands will be executed for every build.
- "spe_cmake_build": "cmake --build %(codebase_root_dir)s/../ci_build/spe_build -- install",
- "nspe_cmake_build": "cmake --build %(codebase_root_dir)s/../ci_build/nspe_build -- tfm_app_binaries",
+ "spe_cmake_build": "cmake --build %(ci_build_root_dir)s/spe -- install",
+ "nspe_cmake_build": "cmake --build %(ci_build_root_dir)s/nspe -- tfm_app_binaries",
"set_compiler_path": "export PATH=$PATH:$%(compiler)s_PATH",
@@ -83,57 +81,57 @@
# tfm_build_manager will replace %(_tbm_build_dir_)s, %(_tbm_code_dir_)s,
# _tbm_target_platform_ with the paths set when building
- "artifact_capture_rex": (r'%(_tbm_build_dir_)s/bin'
+ "artifact_capture_rex": (r'%(ci_build_root_dir)s/nspe'
r'/(\w+\.(?:axf|bin|hex))$'),
# Keys will append extra commands when matching target_platform
- "post_build": {"arm/corstone1000": ("dd conv=notrunc bs=1 if=%(codebase_root_dir)s/../ci_build/spe_build/bin/bl1_1.bin of=%(codebase_root_dir)s/../ci_build/spe_build/bin/bl1.bin seek=0;"
- "dd conv=notrunc bs=1 if=%(codebase_root_dir)s/../ci_build/spe_build/bin/bl1_provisioning_bundle.bin of=%(codebase_root_dir)s/../ci_build/spe_build/bin/bl1.bin seek=40960;"
- "../platform/ext/target/arm/corstone1000/create-flash-image.sh %(codebase_root_dir)s/../ci_build/spe_build/bin/ cs1000.bin;"),
+ "post_build": {"arm/corstone1000": ("dd conv=notrunc bs=1 if=%(ci_build_root_dir)s/spe/bin/bl1_1.bin of=%(ci_build_root_dir)s/spe/bin/bl1.bin seek=0;"
+ "dd conv=notrunc bs=1 if=%(ci_build_root_dir)s/spe/bin/bl1_provisioning_bundle.bin of=%(ci_build_root_dir)s/spe/bin/bl1.bin seek=40960;"
+ "../platform/ext/target/arm/corstone1000/create-flash-image.sh %(ci_build_root_dir)s/spe/bin/ cs1000.bin;"),
"arm/musca_b1": ("srec_cat "
- "%(codebase_root_dir)s/../ci_build/spe_build/bin/"
+ "%(ci_build_root_dir)s/spe/bin/"
"bl2.bin "
"-Binary -offset 0xA000000 "
"-fill 0xFF 0xA000000 0xA020000 "
- "%(codebase_root_dir)s/../ci_build/nspe_build/"
+ "%(ci_build_root_dir)s/nspe/"
"tfm_s_ns_signed.bin "
"-Binary -offset 0xA020000 "
"-fill 0xFF 0xA020000 0xA200000 "
- "-o %(codebase_root_dir)s/../ci_build/"
+ "-o %(ci_build_root_dir)s/"
"tfm.hex -Intel"),
"arm/musca_s1": ("srec_cat "
- "%(codebase_root_dir)s/../ci_build/spe_build/bin/"
+ "%(ci_build_root_dir)s/spe/bin/"
"bl2.bin "
"-Binary -offset 0xA000000 "
"-fill 0xFF 0xA000000 0xA020000 "
- "%(codebase_root_dir)s/../ci_build/nspe_build/"
+ "%(ci_build_root_dir)s/nspe/"
"tfm_s_ns_signed.bin "
"-Binary -offset 0xA020000 "
"-fill 0xFF 0xA020000 0xA200000 "
- "-o %(codebase_root_dir)s/../ci_build/"
+ "-o %(ci_build_root_dir)s/"
"tfm.hex -Intel"),
"stm/stm32l562e_dk": ("echo 'STM32L562E-DK board post process';"
# TODO: Confirm the path of postbuild.sh
- "%(codebase_root_dir)s/../ci_build/spe_build/postbuild.sh;"
- "pushd %(codebase_root_dir)s/../ci_build/spe_build;"
+ "%(ci_build_root_dir)s/spe/postbuild.sh;"
+ "pushd %(ci_build_root_dir)s/spe;"
"BIN_FILES=$(grep -o '\/.*\.bin' TFM_UPDATE.sh | sed 's/^/bin/');"
"tar jcf ./bin/stm32l562e-dk-tfm.tar.bz2 regression.sh TFM_UPDATE.sh ${BIN_FILES};"
"popd"),
"stm/b_u585i_iot02a": ("echo 'STM32U5 board post process';"
# TODO: Confirm the path of postbuild.sh
- "%(codebase_root_dir)s/../ci_build/spe_build/postbuild.sh;"
- "pushd %(codebase_root_dir)s/../ci_build/spe_build;"
+ "%(ci_build_root_dir)s/spe/postbuild.sh;"
+ "pushd %(ci_build_root_dir)s/spe;"
"BIN_FILES=$(grep -o '\/.*\.bin' TFM_UPDATE.sh | sed 's/^/bin/');"
"tar jcf ./bin/b_u585i_iot02a-tfm.tar.bz2 regression.sh TFM_UPDATE.sh ${BIN_FILES};"
"popd"),
"nxp/lpcxpresso55s69": ("echo 'LPCXpresso55S69 board post process\n';"
- "if [ -f \"%(codebase_root_dir)s/../ci_build/spe_build/bin/bl2.hex\" ]; then FLASH_FILE='flash_bl2_JLink.py'; else FLASH_FILE='flash_JLink.py'; fi;"
+ "if [ -f \"%(ci_build_root_dir)s/spe/bin/bl2.hex\" ]; then FLASH_FILE='flash_bl2_JLink.py'; else FLASH_FILE='flash_JLink.py'; fi;"
"pushd%(codebase_root_dir)s/platform/ext/target/nxp/lpcxpresso55s69/scripts;"
"LN=$(grep -n 'JLinkExe' ${FLASH_FILE}|awk -F: '{print $1}');"
"sed -i \"${LN}s/.*/ print('flash.jlink generated')/\" ${FLASH_FILE};"
"python3 ./${FLASH_FILE};"
# TODO: Confirm which bin is needed? SPE or NSPE?
- "cd %(codebase_root_dir)s/../ci_build/spe_build/bin;"
+ "cd %(ci_build_root_dir)s/spe/bin;"
"BIN_FILES=$(grep loadfile flash.jlink | awk '{print $2}');"
"tar jcf lpcxpresso55s69-tfm.tar.bz2 flash.jlink ${BIN_FILES};"
"popd"),
@@ -143,36 +141,36 @@
"--policy platform/ext/target/cypress/psoc64/security/policy/policy_multi_CM0_CM4_tfm.json "
"--target cy8ckit-064s0s2-4343w "
"sign-image "
- "--hex %(codebase_root_dir)s/../ci_build/spe_build/bin/tfm_s.hex "
+ "--hex %(ci_build_root_dir)s/spe/bin/tfm_s.hex "
"--image-type BOOT --image-id 1;"
"sudo /usr/local/bin/cysecuretools "
"--policy platform/ext/target/cypress/psoc64/security/policy/policy_multi_CM0_CM4_tfm.json "
"--target cy8ckit-064s0s2-4343w "
"sign-image "
- "--hex %(codebase_root_dir)s/../ci_build/nspe_build/bin/tfm_ns.hex "
+ "--hex %(ci_build_root_dir)s/nspe/bin/tfm_ns.hex "
"--image-type BOOT --image-id 16;"
- "mv %(codebase_root_dir)s/../ci_build/spe_build/bin/tfm_s.hex %(codebase_root_dir)s/../ci_build/spe_build/bin/tfm_s_signed.hex;"
- "mv %(codebase_root_dir)s/../ci_build/nspe_build/bin/tfm_ns.hex %(codebase_root_dir)s/../ci_build/nspe_build/bin/tfm_ns_signed.hex;"
+ "mv %(ci_build_root_dir)s/spe/bin/tfm_s.hex %(ci_build_root_dir)s/spe/bin/tfm_s_signed.hex;"
+ "mv %(ci_build_root_dir)s/nspe/bin/tfm_ns.hex %(ci_build_root_dir)s/nspe/bin/tfm_ns_signed.hex;"
"popd")
},
# (Optional) If set will fail if those artefacts are missing post build
"required_artefacts": {"all": [
- "%(codebase_root_dir)s/../ci_build/spe_build/bin/"
+ "%(ci_build_root_dir)s/spe/bin/"
"tfm_s.bin",
- "%(codebase_root_dir)s/../ci_build/nspe_build/"
+ "%(ci_build_root_dir)s/nspe/"
"tfm_ns.bin"],
"arm/musca_b1": [
- "%(codebase_root_dir)s/../ci_build/tfm.hex",
- "%(codebase_root_dir)s/../ci_build/spe_build/bin/"
+ "%(ci_build_root_dir)s/tfm.hex",
+ "%(ci_build_root_dir)s/spe/bin/"
"bl2.bin",
- "%(codebase_root_dir)s/../ci_build/spe_build/bin/"
+ "%(ci_build_root_dir)s/spe/bin/"
"tfm_sign.bin"],
"arm/musca_s1": [
- "%(codebase_root_dir)s/../ci_build/tfm.hex",
- "%(codebase_root_dir)s/../ci_build/spe_build/bin/"
+ "%(ci_build_root_dir)s/tfm.hex",
+ "%(ci_build_root_dir)s/spe/bin/"
"bl2.bin",
- "%(codebase_root_dir)s/../ci_build/spe_build/bin/"
+ "%(ci_build_root_dir)s/spe/bin/"
"tfm_sign.bin"]
}
}