From d9c6e47534e4dadbcf727857d0be387299cabb2b Mon Sep 17 00:00:00 2001 From: Kory Maincent Date: Thu, 20 Jun 2024 16:38:51 +0200 Subject: [PATCH] package/optee-client: add support for custom tarball OP-TEE OS supports custom tarballs. If the OP-TEE OS custom tarball version does not match the latest optee-client version supported by Buildroot, optee-client might not build or run properly. This patch adds support for an optee-client custom tarball URL to address this potential issue. Signed-off-by: Kory Maincent Acked-by: Etienne Carriere Signed-off-by: Thomas Petazzoni --- package/optee-client/Config.in | 38 ++++++++++++++++++++++++++++ package/optee-client/optee-client.mk | 21 +++++++++++++-- 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/package/optee-client/Config.in b/package/optee-client/Config.in index 4061164cbb..738d43f837 100644 --- a/package/optee-client/Config.in +++ b/package/optee-client/Config.in @@ -17,6 +17,44 @@ config BR2_PACKAGE_OPTEE_CLIENT if BR2_PACKAGE_OPTEE_CLIENT +choice + prompt "optee-client version" + default BR2_PACKAGE_OPTEE_CLIENT_LATEST + help + Select the version of optee-client you want to use + +config BR2_PACKAGE_OPTEE_CLIENT_LATEST + bool "4.3.0" + help + Use the latest release tag from the optee-client official Git + repository. + +config BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_TARBALL + bool "Custom tarball" + help + This option allows to specify a URL pointing to an + optee-client source tarball. This URL can use any protocol + recognized by Buildroot, like http://, ftp://, file:// + or scp://. + + When pointing to a local tarball using file://, you may want + to use a make variable like $(TOPDIR) to reference the root of + the Buildroot tree. + +endchoice + +if BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_TARBALL + +config BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_TARBALL_LOCATION + string "URL of custom optee-client tarball" + +endif + +config BR2_PACKAGE_OPTEE_CLIENT_VERSION + string + default "4.3.0" if BR2_PACKAGE_OPTEE_CLIENT_LATEST + default "custom" if BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_TARBALL + config BR2_PACKAGE_OPTEE_CLIENT_TEE_FS_PATH string "Path for normal world OS secure storage" default "/data/tee" diff --git a/package/optee-client/optee-client.mk b/package/optee-client/optee-client.mk index c1813cd9b1..de3ff1df7f 100644 --- a/package/optee-client/optee-client.mk +++ b/package/optee-client/optee-client.mk @@ -4,12 +4,23 @@ # ################################################################################ -OPTEE_CLIENT_VERSION = 4.3.0 -OPTEE_CLIENT_SITE = $(call github,OP-TEE,optee_client,$(OPTEE_CLIENT_VERSION)) +OPTEE_CLIENT_VERSION = $(call qstrip,$(BR2_PACKAGE_OPTEE_CLIENT_VERSION)) OPTEE_CLIENT_LICENSE = BSD-2-Clause OPTEE_CLIENT_LICENSE_FILES = LICENSE OPTEE_CLIENT_INSTALL_STAGING = YES +ifeq ($(BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_TARBALL),y) +OPTEE_CLIENT_TARBALL = $(call qstrip,$(BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_TARBALL_LOCATION)) +OPTEE_CLIENT_SITE = $(patsubst %/,%,$(dir $(OPTEE_CLIENT_TARBALL))) +OPTEE_CLIENT_SOURCE = $(notdir $(OPTEE_CLIENT_TARBALL)) +else +OPTEE_CLIENT_SITE = $(call github,OP-TEE,optee_client,$(OPTEE_CLIENT_VERSION)) +endif + +ifeq ($(BR2_PACKAGE_OPTEE_CLIENT):$(BR2_PACKAGE_OPTEE_CLIENT_LATEST),y:) +BR_NO_CHECK_HASH_FOR += $(OPTEE_CLIENT_SOURCE) +endif + OPTEE_CLIENT_CONF_OPTS = \ -DCFG_TEE_FS_PARENT_PATH=$(BR2_PACKAGE_OPTEE_CLIENT_TEE_FS_PATH) \ -DCFG_WERROR=OFF @@ -38,4 +49,10 @@ define OPTEE_CLIENT_INSTALL_INIT_SYSV $(TARGET_DIR)/etc/init.d/S30tee-supplicant endef +ifeq ($(BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_TARBALL)$(BR_BUILDING),yy) +ifeq ($(call qstrip,$(BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_TARBALL_LOCATION)),) +$(error No tarball location specified. Please check BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_TARBALL_LOCATION) +endif +endif + $(eval $(cmake-package))