boot/optee-os: correct TA files install
PATCH v2 1/7 boot/optee-os: correct TA files install
This change corrects TA binary files install sequence that were previously install in target filesystem though OPTEE_OS_INSTALL_IMAGES_CMDS instead of expected OPTEE_OS_INSTALL_TARGET_CMDS.
This change removes useless mkdir prior call to $(INSTALL) that already handles parent directory creation when needed.
This change conditions .ta files install upon their generation as a custom package repository may not generate any .ta files.
---
Changes v1 -> v2:
- Patch introduced in v2
--- boot/optee-os/optee-os.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
boot/optee-os/optee-os.mk +4 -4
@@ -75,10 +75,10 @@ endef endif # BR2_TARGET_OPTEE_OS_CORE ifeq ($(BR2_TARGET_OPTEE_OS_SERVICES),y) -define OPTEE_OS_INSTALL_IMAGES_SERVICES - mkdir -p $(TARGET_DIR)/lib/optee_armtz - $(INSTALL) -D -m 444 -t $(TARGET_DIR)/lib/optee_armtz \ - $(@D)/$(OPTEE_OS_BUILDDIR_OUT)/ta/*/*.ta +define OPTEE_OS_INSTALL_TARGET_CMDS + $(if $(wildcard $(@D)/$(OPTEE_OS_BUILDDIR_OUT)/ta/*/*.ta), + $(INSTALL) -D -m 444 -t $(TARGET_DIR)/lib/optee_armtz \ + $(@D)/$(OPTEE_OS_BUILDDIR_OUT)/ta/*/*.ta) endef endif # BR2_TARGET_OPTEE_OS_SERVICES
Signature · 1 line
2.17.1
PATCH v2 2/7 boot/optee-os: install trusted shared libraries
Install generated trusted shared libraries in the target file system next to the trusted applications.
---
Changes v1 -> v2:
- Fixes on .ta file install commands move to a specific patch
- Fix BR2_TARGET_OPTEE_OS_SERVICES 1-string description
- Replace conditional commands in .ta files install commands with Makefile script level conditionals
--- boot/optee-os/Config.in | 14 +++++++------- boot/optee-os/optee-os.mk | 3 +++ 2 files changed, 10 insertions(+), 7 deletions(-)
boot/optee-os/Config.in +7 -7
@@ -70,16 +70,16 @@ config BR2_TARGET_OPTEE_OS_SDK installed in the staging directory /lib/optee. config BR2_TARGET_OPTEE_OS_SERVICES - bool "Build service TAs" + bool "Build service TAs and libs" default y select BR2_TARGET_OPTEE_OS_CORE help - This option installs the service trusted applications built - from OP-TEE OS source tree. These are installed in the target - /lib/optee_armtz directory as other trusted applications. - At runtime OP-TEE OS can load trusted applications from this - non-secure filesystem/directory into the secure world for - execution. + This option installs the service trusted applications and + trusted shared libraries built from OP-TEE OS source tree. + These are installed in target /lib/optee_armtz directory + as other trusted applications. At runtime OP-TEE OS can + load these from this non-secure filesystem/directory into + the secure world for execution. config BR2_TARGET_OPTEE_OS_PLATFORM string "Target platform (mandatory)"
boot/optee-os/optee-os.mk +3 -0
@@ -79,6 +79,9 @@ define OPTEE_OS_INSTALL_TARGET_CMDS $(if $(wildcard $(@D)/$(OPTEE_OS_BUILDDIR_OUT)/ta/*/*.ta), $(INSTALL) -D -m 444 -t $(TARGET_DIR)/lib/optee_armtz \ $(@D)/$(OPTEE_OS_BUILDDIR_OUT)/ta/*/*.ta) + $(if $(wildcard $(OPTEE_OS_SDK)/lib/*.ta), + $(INSTALL) -D -m 444 -t $(TARGET_DIR)/lib/optee_armtz \ + $(OPTEE_OS_SDK)/lib/*.ta) endef endif # BR2_TARGET_OPTEE_OS_SERVICES
Signature · 1 line
2.17.1
PATCH v2 2/7 boot/optee-os: install trusted shared libraries
Hello Etienne,
boot/optee-os/optee-os.mk define OPTEE_OS_INSTALL_TARGET_CMDS · line 82
Quoted 1 line · On Tue, 14 May 2019 09:38:57 +0200 Etienne Carriere…
boot/optee-os/optee-os.mk +1
-0+ $(if $(wildcard $(OPTEE_OS_SDK)/lib/*.ta),
OPTEE_OS_SDK is only populated if BR2_TARGET_OPTEE_OS_SDK=y, but services/libs are installed if BR2_TARGET_OPTEE_OS_SERVICES=y.
So if BR2_TARGET_OPTEE_OS_SDK is disabled, but BR2_TARGET_OPTEE_OS_SERVICES=y, this will not copy anything. Is this the indented behavior ?
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v2 2/7 boot/optee-os: install trusted shared libraries
Quoted 6 lines · Thomas Petazzoni
Hello Etienne,
On Tue, 14 May 2019 09:38:57 +0200
Etienne Carriere <[email protected]> wrote:
Quoted 8 lines
Quoted 1 line
+ $(if $(wildcard $(OPTEE_OS_SDK)/lib/*.ta),
OPTEE_OS_SDKis only populated if BR2_TARGET_OPTEE_OS_SDK=y, but services/libs are installed if BR2_TARGET_OPTEE_OS_SERVICES=y.So if
BR2_TARGET_OPTEE_OS_SDKis disabled, but BR2_TARGET_OPTEE_OS_SERVICES=y, this will not copy anything. Is this the indented behavior ?
No, this is not intended.
I'll find a better way.
Thanks,
regards,
etienne
Quoted 6 lines
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
PATCH v2 3/7 boot/optee-os: dump to OP-TEE 3.5.0
In reply to Etienne CarriereDump to OP-TEE OS 3.5.0.
---
Changes v1 -> v2:
- Move hash file to package root dir
- Remove old 3.4.0/ subdir
--- boot/optee-os/3.4.0/optee-os.hash | 4 ---- boot/optee-os/Config.in | 4 ++-- boot/optee-os/optee-os.hash | 4 ++++ 3 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 boot/optee-os/3.4.0/optee-os.hash create mode 100644 boot/optee-os/optee-os.hash
boot/optee-os/3.4.0/optee-os.hash deleted +0 -4
@@ -1,4 +0,0 @@ -# From https://github.com/OP-TEE/optee_os/archive/3.4.0.tar.gz -sha256 51d42ac7aa780ec8d8ee471eff689a29a7621aacace046722b1490b62ec2d481 optee-os-3.4.0.tar.gz -# Locally computed -sha256 fda8385993f112d7ca61b88b54ba5b4cbeec7e43a0f9b317d5186703c1985e8f LICENSE
boot/optee-os/Config.in +2 -2
@@ -18,7 +18,7 @@ choice Select the version of OP-TEE OS you want to use config BR2_TARGET_OPTEE_OS_LATEST - bool "3.4.0" + bool "3.5.0" help Use the latest release tag from the OP-TEE OS official Git repository.
@@ -50,7 +50,7 @@ endif config BR2_TARGET_OPTEE_OS_VERSION string - default "3.4.0" if BR2_TARGET_OPTEE_OS_LATEST + default "3.5.0" if BR2_TARGET_OPTEE_OS_LATEST default BR2_TARGET_OPTEE_OS_CUSTOM_REPO_VERSION \ if BR2_TARGET_OPTEE_OS_CUSTOM_GIT
boot/optee-os/optee-os.hash new file +4 -0
@@ -0,0 +1,4 @@ +# From https://github.com/OP-TEE/optee_os/archive/3.5.0.tar.gz +sha256 a02fe8e7fdee9653e9207059071735a839b1255fdaf311a2a6cfd185a4cee6a2 optee-os-3.5.0.tar.gz +# Locally computed +sha256 fda8385993f112d7ca61b88b54ba5b4cbeec7e43a0f9b317d5186703c1985e8f LICENSE
Signature · 1 line
2.17.1
PATCH v2 4/7 package/optee-client: bump version to 3.5.0
In reply to Etienne CarriereBump to OP-TEE OS package version to release 3.5.0. This change discard now useless patches on OP-TEE Client package.
---
Changes v1 -> v2:
- No change
--- ...-BUILD_STATIC_LIBS-BUILD_SHARED_LIBS.patch | 52 ------- .../0002-libteec-fix-build-warnings.patch | 128 ------------------ .../0003-libteec-fix-clang-build-errors.patch | 64 --------- package/optee-client/optee-client.hash | 4 +- package/optee-client/optee-client.mk | 2 +- 5 files changed, 3 insertions(+), 247 deletions(-) delete mode 100644 package/optee-client/0001-cmake-support-BUILD_STATIC_LIBS-BUILD_SHARED_LIBS.patch delete mode 100644 package/optee-client/0002-libteec-fix-build-warnings.patch delete mode 100644 package/optee-client/0003-libteec-fix-clang-build-errors.patch
package/optee-client/0001-cmake-support-BUILD_STATIC_LIBS-BUILD_SHARED_LIBS.patch deleted +0 -52
@@ -1,52 +0,0 @@ -From e2d82d46b33b693305978dfe64d84148314aef46 Mon Sep 17 00:00:00 2001 -From: Etienne Carriere <[email protected]> -Date: Wed, 6 Mar 2019 11:46:07 +0100 -Subject: [PATCH] cmake: support BUILD_STATIC_LIBS/BUILD_SHARED_LIBS - -CMake variables BUILD_STATIC_LIBS and BUILD_SHARED_LIBS -set constraints on libraries and executable linkage. - -With this change OP-TEE client CMake script builds and installs the -embedded files with the expected linkage configuration. - -Reported-by: Thomas Petazzoni <[email protected]> -Signed-off-by: Etienne Carriere <[email protected]> -Acked-by: Jerome Forissier <[email protected]> ---- - libteec/CMakeLists.txt | 5 +++-- - tee-supplicant/CMakeLists.txt | 2 +- - 2 files changed, 4 insertions(+), 3 deletions(-) - -diff --git a/libteec/CMakeLists.txt b/libteec/CMakeLists.txt -index 3ec8f66..e3495fb 100644 ---- a/libteec/CMakeLists.txt -+++ b/libteec/CMakeLists.txt -@@ -33,7 +33,7 @@ endif() - ################################################################################ - # Built library - ################################################################################ --add_library (teec SHARED ${SRC}) -+add_library (teec ${SRC}) - - set_target_properties (teec PROPERTIES - VERSION ${PROJECT_VERSION} -@@ -71,4 +71,5 @@ target_link_libraries (teec - ################################################################################ - # FIXME: This should in someway harmonize with CFG_TEE_CLIENT_LOAD_PATH - # FIXME: Should we change this to /usr/local/lib? --install (TARGETS teec DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+install (TARGETS teec LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" -+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") -diff --git a/tee-supplicant/CMakeLists.txt b/tee-supplicant/CMakeLists.txt -index d2d3afd..e663be9 100644 ---- a/tee-supplicant/CMakeLists.txt -+++ b/tee-supplicant/CMakeLists.txt -@@ -85,4 +85,4 @@ target_link_libraries (${PROJECT_NAME} - ################################################################################ - # Install targets - ################################################################################ --install (TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_SBINDIR}) -+install (TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}) --- -2.17.1 -
package/optee-client/0002-libteec-fix-build-warnings.patch deleted +0 -128
128 lines not on this page · raw message
package/optee-client/0003-libteec-fix-clang-build-errors.patch deleted +0 -64
64 lines not on this page · raw message
package/optee-client/optee-client.hash +2 -2
@@ -1,4 +1,4 @@ -# From https://github.com/OP-TEE/optee_client/archive/3.4.0.tar.gz -sha256 7c131a44f4d73acb8816fba88bcd7e6a18537f0a522ae426a20e2ca7dc46a6ec optee-client-3.4.0.tar.gz +# From https://github.com/OP-TEE/optee_client/archive/3.5.0.tar.gz +sha256 b7f6f8ac57c0c9b0cc59c34a2622b9ff3ae85676d2da10176fb2eaaa10716083 optee-client-3.5.0.tar.gz # Locally computed sha256 fda8385993f112d7ca61b88b54ba5b4cbeec7e43a0f9b317d5186703c1985e8f LICENSE
package/optee-client/optee-client.mk +1 -1
@@ -4,7 +4,7 @@ # ################################################################################ -OPTEE_CLIENT_VERSION = 3.4.0 +OPTEE_CLIENT_VERSION = 3.5.0 OPTEE_CLIENT_SITE = $(call github,OP-TEE,optee_client,$(OPTEE_CLIENT_VERSION)) OPTEE_CLIENT_LICENSE = BSD-2-Clause OPTEE_CLIENT_LICENSE_FILES = LICENSE
Signature · 1 line
2.17.1
PATCH v2 5/7 package/optee-test: bump version to 3.5.0
In reply to Etienne CarriereBump to OP-TEE OS package version to release 3.5.0. This change updates patches on OP-TEE Test package accordingly.
---
Changes v1 -> v2:
- No change
--- ...n-4100-update-string-conversion-loop.patch | 72 ------------------- ...prevent-unsafe-loop-optimizations-bu.patch | 63 ++++++++++++++++ package/optee-test/optee-test.hash | 4 +- package/optee-test/optee-test.mk | 2 +- 4 files changed, 66 insertions(+), 75 deletions(-) delete mode 100644 package/optee-test/0001-regression-4100-update-string-conversion-loop.patch create mode 100644 package/optee-test/0001-regression-41xx-prevent-unsafe-loop-optimizations-bu.patch
package/optee-test/0001-regression-4100-update-string-conversion-loop.patch deleted +0 -72
@@ -1,72 +0,0 @@ -From 88714fc174b91950c9e1c53a9832fc6d4ffa6e2a Mon Sep 17 00:00:00 2001 -From: Etienne Carriere <[email protected]> -Date: Sun, 17 Feb 2019 22:44:44 +0100 -Subject: [PATCH] regression 4100: update string conversion loop - -Change the loop used to convert string into numerical value. -The original loop was fine but its implementation hits toolchain -unsafe-loop-optimizations feature. The new implementation -proposed here simplifies a bit the loop and prevents toolchain -from complaining when directive -Werror=unsafe-loop-optimizations -is enabled. - -Issue reported by the Buildroot cross toolchain [1] with the -following error traces: - -build/armv7/build/optee-test-3.4.0/host/xtest/regression_4100.c:447:8: error: missed loop optimization, the loop counter may overflow [-Werror=unsafe-loop-optimizations] - while (spos) { - ^ -build/optee-test-3.4.0/host/xtest/regression_4100.c:454:6: error: missed loop optimization, the loop counter may overflow [-Werror=unsafe-loop-optimizations] - if (!spos) - ^ - -[1] arm-buildroot-linux-uclibcgnueabihf-gcc.br_real (Buildroot 2019.02-git-00933-gb75e93c) 7.4.0 - -Signed-off-by: Etienne Carriere <[email protected]> ---- - host/xtest/regression_4100.c | 25 ++++++++++++++----------- - 1 file changed, 14 insertions(+), 11 deletions(-) - -diff --git a/host/xtest/regression_4100.c b/host/xtest/regression_4100.c -index b477f38..88346d4 100644 ---- a/host/xtest/regression_4100.c -+++ b/host/xtest/regression_4100.c -@@ -445,21 +445,24 @@ static TEEC_Result convert_from_string(ADBG_Case_t *c, TEEC_Session *s, - return TEEC_ERROR_OUT_OF_MEMORY; - - while (spos) { -- spos--; -- nibble = digit_value(str[spos]); -- if (nibble == -1) -+ nibble = digit_value(str[spos - 1]); -+ if (nibble == -1) { -+ spos--; - break; -+ } - os[ospos] = nibble; - -- if (!spos) -- break; -+ if (spos > 1) { -+ nibble = digit_value(str[spos - 2]); -+ if (nibble == -1) { -+ spos -= 2; -+ break; -+ } -+ os[ospos] |= nibble << 4; -+ ospos--; -+ spos--; -+ } - spos--; -- nibble = digit_value(str[spos]); -- if (nibble == -1) -- break; -- -- os[ospos] |= nibble << 4; -- ospos--; - } - - if (spos) --- -2.20.1 -
package/optee-test/0001-regression-41xx-prevent-unsafe-loop-optimizations-bu.patch new file +63 -0
63 lines not on this page · raw message
package/optee-test/optee-test.hash +2 -2
@@ -1,4 +1,4 @@ -# From https://github.com/OP-TEE/optee_test/archive/3.4.0.tar.gz -sha256 755904c5b845763a2460c32c21100a57c713009b6b88cc3fc21f0e5be8645e2b optee-test-3.4.0.tar.gz +# From https://github.com/OP-TEE/optee_test/archive/3.5.0.tar.gz +sha256 19118b7002a618bb2519cf7d0d61feb90e8574148f69b29260344119ac855520 optee-test-3.5.0.tar.gz # Locally computed sha256 6e6810981f0ddab9e0d44399d0700a15d9f760a3c2843cc866659c2074139ae7 LICENSE.md
package/optee-test/optee-test.mk +1 -1
@@ -4,7 +4,7 @@ # ################################################################################ -OPTEE_TEST_VERSION = 3.4.0 +OPTEE_TEST_VERSION = 3.5.0 OPTEE_TEST_SITE = $(call github,OP-TEE,optee_test,$(OPTEE_TEST_VERSION)) OPTEE_TEST_LICENSE = GPL-2.0, BSD-2-Clause, OPTEE_TEST_LICENSE_FILES = LICENSE.md
Signature · 1 line
2.17.1
PATCH v2 6/7 package/optee-examples: bump version to 3.5.0
In reply to Etienne CarriereBump to OP-TEE OS package version to release 3.5.0. This change discard now useless patches on OP-TEE Examples package.
---
Changes v1 -> v2:
- No change
--- ...-fix-deprecated-size_t-type-for-size.patch | 42 ------------------- package/optee-examples/optee-examples.hash | 4 +- package/optee-examples/optee-examples.mk | 2 +- 3 files changed, 3 insertions(+), 45 deletions(-) delete mode 100644 package/optee-examples/0001-fix-deprecated-size_t-type-for-size.patch
package/optee-examples/0001-fix-deprecated-size_t-type-for-size.patch deleted +0 -42
@@ -1,42 +0,0 @@ -From 1a2713ac698410fb1a889941d52df12a7bd75f3b Mon Sep 17 00:00:00 2001 -From: Etienne Carriere <[email protected]> -Date: Sun, 17 Feb 2019 22:17:21 +0100 -Subject: [PATCH] secure_storage: fix deprecated size_t type for size - -size_t types is an deprecated type used in GPD API v1.0. -Update - -Error reported by GCC 7.3-2018.05: - secure_storage_ta.c:203:6: warning: passing argument 4 of 'TEE_ReadObjectData' from incompatible pointer type [-Wincompatible-pointer-types] - &read_bytes); - -Signed-off-by: Etienne Carriere <[email protected]> ---- - secure_storage/ta/secure_storage_ta.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/secure_storage/ta/secure_storage_ta.c b/secure_storage/ta/secure_storage_ta.c -index d120e47..3ccc12d 100644 ---- a/secure_storage/ta/secure_storage_ta.c -+++ b/secure_storage/ta/secure_storage_ta.c -@@ -146,7 +146,7 @@ static TEE_Result read_raw_object(uint32_t param_types, TEE_Param params[4]) - TEE_ObjectHandle object; - TEE_ObjectInfo object_info; - TEE_Result res; -- size_t read_bytes; -+ uint32_t read_bytes; - char *obj_id; - size_t obj_id_sz; - char *data; -@@ -202,7 +202,7 @@ static TEE_Result read_raw_object(uint32_t param_types, TEE_Param params[4]) - res = TEE_ReadObjectData(object, data, object_info.dataSize, - &read_bytes); - if (res != TEE_SUCCESS || read_bytes != object_info.dataSize) { -- EMSG("TEE_ReadObjectData failed 0x%08x, read %u over %u", -+ EMSG("TEE_ReadObjectData failed 0x%08x, read %" PRIu32 " over %u", - res, read_bytes, object_info.dataSize); - goto exit; - } --- -2.20.1 -
package/optee-examples/optee-examples.hash +2 -2
@@ -1,4 +1,4 @@ -# From https://github.com/linaro-swg/optee_examples/archive/3.4.0.tar.gz -sha256 d833753980ac438c1675787857bb8352997352212334274de9419770097ce039 optee-examples-3.4.0.tar.gz +# From https://github.com/linaro-swg/optee_examples/archive/3.5.0.tar.gz +sha256 5b7cf07f6d4b19a8557cfa9ab7a0d98b9e199832694c65c8a74e928926821862 optee-examples-3.5.0.tar.gz # Locally computed sha256 6f1ef8449cb82ae79d2155605f7985bdf0f08e7ab5007de9b4362e8bf28733b9 LICENSE
package/optee-examples/optee-examples.mk +1 -1
@@ -4,7 +4,7 @@ # ################################################################################ -OPTEE_EXAMPLES_VERSION = 3.4.0 +OPTEE_EXAMPLES_VERSION = 3.5.0 OPTEE_EXAMPLES_SITE = $(call github,linaro-swg,optee_examples,$(OPTEE_EXAMPLES_VERSION)) OPTEE_EXAMPLES_LICENSE = BSD-2-Clause OPTEE_EXAMPLES_LICENSE_FILES = LICENSE
Signature · 1 line
2.17.1
PATCH v2 7/7 package/optee-benchmark: bump version to 3.5.0
In reply to Etienne CarriereBump to OP-TEE OS package version to release 3.5.0 that now provides an identified LICENSE file.
---
Changes v1 -> v2:
- No change
--- package/optee-benchmark/optee-benchmark.hash | 6 ++++-- package/optee-benchmark/optee-benchmark.mk | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-)
package/optee-benchmark/optee-benchmark.hash +4 -2
@@ -1,2 +1,4 @@ -# From https://github.com/linaro-swg/optee_benchmark/archive/3.4.0.tar.gz -sha256 e5e868a06a9dcc8cc444b3e72c65f57670b0811091be62edbe0d03d13c75e716 optee-benchmark-3.4.0.tar.gz +# From https://github.com/linaro-swg/optee_benchmark/archive/3.5.0.tar.gz +sha256 678fd4d3f65d7e18952f4505a1caad6c7ebfef67458a2e92fb51f8c098e7f439 optee-benchmark-3.5.0.tar.gz +# Locally computed +sha256 fda8385993f112d7ca61b88b54ba5b4cbeec7e43a0f9b317d5186703c1985e8f LICENSE
package/optee-benchmark/optee-benchmark.mk +1 -1
@@ -4,7 +4,7 @@ # ################################################################################ -OPTEE_BENCHMARK_VERSION = 3.4.0 +OPTEE_BENCHMARK_VERSION = 3.5.0 OPTEE_BENCHMARK_SITE = $(call github,linaro-swg,optee_benchmark,$(OPTEE_BENCHMARK_VERSION)) OPTEE_BENCHMARK_LICENSE = BSD-2-Clause
Signature · 1 line
2.17.1