summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Swierczek <t.swierczek@samsung.com>2018-09-17 09:39:06 +0200
committerTomasz Swierczek <t.swierczek@samsung.com>2018-09-17 09:39:06 +0200
commitbd4367bc3899916361dcaa5f33c6dd2822ca5441 (patch)
tree9750de209f41811f683b6ce6076268a57a5fbdac
parenta5c8ea2d4c5fd04a1ae02995724e5b0d79a19c21 (diff)
downloadtef-simulator-accepted/tizen_5.0_unified.tar.gz
tef-simulator-accepted/tizen_5.0_unified.tar.bz2
tef-simulator-accepted/tizen_5.0_unified.zip
This reverts commit a5c8ea2d4c5fd04a1ae02995724e5b0d79a19c21.
-rw-r--r--cmake/TEFSimulatorDevkit.cmake23
-rw-r--r--helloworld/CMakeLists.txt4
-rw-r--r--packaging/tef-simulator-helloworld.spec7
3 files changed, 19 insertions, 15 deletions
diff --git a/cmake/TEFSimulatorDevkit.cmake b/cmake/TEFSimulatorDevkit.cmake
index 91d471e..293dc9e 100644
--- a/cmake/TEFSimulatorDevkit.cmake
+++ b/cmake/TEFSimulatorDevkit.cmake
@@ -30,18 +30,19 @@ IF(NOT TA_PACKAGE_BUILDER)
MESSAGE(FATAL_ERROR "TA_PackageBuilder.sh script not found.")
ENDIF()
-MACRO(TEF_GENERATE_TA_IMAGE TargetName TAManifestFile TAImageName)
- SET(STRIPPED_TARGET_FILE ${CMAKE_CURRENT_BINARY_DIR}/${TargetName}.strip)
+MACRO(TEF_GENERATE_TA_IMAGE TargetName TAElfTargetName TAManifestFile TAImageName)
+ SET(STRIPPED_TARGET_FILE ${TAElfTargetName}.strip)
- ADD_CUSTOM_COMMAND(TARGET ${TargetName} POST_BUILD
- COMMAND ${CMAKE_STRIP} --strip-unneeded -o ${STRIPPED_TARGET_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${TargetName}
- COMMENT "Stripping image")
+ ADD_CUSTOM_COMMAND(OUTPUT ${STRIPPED_TARGET_FILE}
+ COMMAND ${CMAKE_STRIP} --strip-unneeded -o ${STRIPPED_TARGET_FILE} ${TAElfTargetName}
+ DEPENDS ${TAElfTargetName})
- STRING(TOUPPER "${TargetName}" TargetOutName)
- STRING(REPLACE "-" "" TargetImage ${TargetOutName})
+ ADD_CUSTOM_COMMAND(OUTPUT ${TAImageName}
+ COMMAND ${TA_PACKAGE_BUILDER} /usr/bin ${STRIPPED_TARGET_FILE} ${TAManifestFile}
+ DEPENDS ${STRIPPED_TARGET_FILE})
+
+ ADD_CUSTOM_TARGET(${TargetName}
+ ALL
+ DEPENDS ${TAImageName})
- SET(${TAImageName} ${TargetImage})
- ADD_CUSTOM_COMMAND(TARGET ${TargetName} POST_BUILD
- COMMAND ${TA_PACKAGE_BUILDER} /usr/bin ${STRIPPED_TARGET_FILE} ${TAManifestFile}
- COMMENT "Signing and encrypting image ${${TAImageName}}")
ENDMACRO()
diff --git a/helloworld/CMakeLists.txt b/helloworld/CMakeLists.txt
index b52cad1..2a9325c 100644
--- a/helloworld/CMakeLists.txt
+++ b/helloworld/CMakeLists.txt
@@ -70,8 +70,8 @@ TARGET_LINK_LIBRARIES(${TARGET_HELLO_WORLD_TA}
${HELLO_WORLD_TA_DEPS_LIBRARIES}
)
-TEF_GENERATE_TA_IMAGE(${TARGET_HELLO_WORLD_TA} ${HELLO_WORLD_TA_PATH}/hello_world.xml HELLO_WORLD_TA_IMAGE)
-INSTALL(FILES ${HELLO_WORLD_TA_IMAGE} DESTINATION ${TASTORE_DIR})
+TEF_GENERATE_TA_IMAGE(SINGED_TA ${TARGET_HELLO_WORLD_TA} ${HELLO_WORLD_TA_PATH}/hello_world.xml ${TA_NAME})
+INSTALL(FILES ${TA_NAME} DESTINATION ${TASTORE_DIR})
############# CA #############
diff --git a/packaging/tef-simulator-helloworld.spec b/packaging/tef-simulator-helloworld.spec
index 457653e..27153d0 100644
--- a/packaging/tef-simulator-helloworld.spec
+++ b/packaging/tef-simulator-helloworld.spec
@@ -22,6 +22,8 @@ Requires: tef-simulator
%define build_include_dir %{buildroot}%{include_dir}
%define build_tastore_dir %{buildroot}%{tastore_dir}
+%define ta_name 00000000000000000000112233445566
+
%description
An example Hello World application, for TEF TrustZone simulator
testing purposes.
@@ -35,7 +37,8 @@ cd helloworld
cmake . \
-DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:RELEASE} \
-DBIN_DIR=%{build_bin_dir} \
- -DTASTORE_DIR=%{build_tastore_dir}
+ -DTASTORE_DIR=%{build_tastore_dir} \
+ -DTA_NAME=%{ta_name}
make %{?jobs:-j%jobs}
%install
@@ -54,4 +57,4 @@ make install
%license LICENSE
%manifest tef-simulator-helloworld.manifest
%attr(111,security_fw,security_fw) %{bin_dir}/tef-simulator-helloworld
-%attr(444,security_fw,security_fw) %{tastore_dir}/00000000000000000000112233445566
+%attr(444,security_fw,security_fw) %{tastore_dir}/%{ta_name}