From 500ff76216a58df2eff2fd254e8efcd64565ba63 Mon Sep 17 00:00:00 2001 From: Kory Maincent Date: Thu, 20 Jun 2024 16:38:53 +0200 Subject: [PATCH] package/optee-examples: 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-examples version supported by Buildroot, optee-examples might not build or run properly. This patch adds support for an optee-examples custom tarball URL to address this potential issue. Signed-off-by: Kory Maincent Acked-by: Etienne Carriere Signed-off-by: Thomas Petazzoni --- package/optee-examples/Config.in | 42 ++++++++++++++++++++++++ package/optee-examples/optee-examples.mk | 21 ++++++++++-- 2 files changed, 61 insertions(+), 2 deletions(-) diff --git a/package/optee-examples/Config.in b/package/optee-examples/Config.in index eb6ee16502..52ef268ac4 100644 --- a/package/optee-examples/Config.in +++ b/package/optee-examples/Config.in @@ -26,3 +26,45 @@ comment "optee-examples needs a toolchain w/ threads, dynamic library, headers > depends on BR2_USE_MMU depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS || \ !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_3 + +if BR2_PACKAGE_OPTEE_EXAMPLES + +choice + prompt "optee-examples version" + default BR2_PACKAGE_OPTEE_EXAMPLES_LATEST + help + Select the version of optee-examples you want to use + +config BR2_PACKAGE_OPTEE_EXAMPLES_LATEST + bool "4.3.0" + help + Use the latest release tag from the optee-examples official + Git repository. + +config BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_TARBALL + bool "Custom tarball" + help + This option allows to specify a URL pointing to an + optee-examples 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_EXAMPLES_CUSTOM_TARBALL + +config BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_TARBALL_LOCATION + string "URL of custom optee-examples tarball" + +endif + +config BR2_PACKAGE_OPTEE_EXAMPLES_VERSION + string + default "4.3.0" if BR2_PACKAGE_OPTEE_EXAMPLES_LATEST + default "custom" if BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_TARBALL + +endif # BR2_PACKAGE_OPTEE_EXAMPLES diff --git a/package/optee-examples/optee-examples.mk b/package/optee-examples/optee-examples.mk index 8eb8724ff6..fc90cfcff6 100644 --- a/package/optee-examples/optee-examples.mk +++ b/package/optee-examples/optee-examples.mk @@ -4,11 +4,22 @@ # ################################################################################ -OPTEE_EXAMPLES_VERSION = 4.3.0 -OPTEE_EXAMPLES_SITE = $(call github,linaro-swg,optee_examples,$(OPTEE_EXAMPLES_VERSION)) +OPTEE_EXAMPLES_VERSION = $(call qstrip,$(BR2_PACKAGE_OPTEE_EXAMPLES_VERSION)) OPTEE_EXAMPLES_LICENSE = BSD-2-Clause OPTEE_EXAMPLES_LICENSE_FILES = LICENSE +ifeq ($(BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_TARBALL),y) +OPTEE_EXAMPLES_TARBALL = $(call qstrip,$(BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_TARBALL_LOCATION)) +OPTEE_EXAMPLES_SITE = $(patsubst %/,%,$(dir $(OPTEE_EXAMPLES_TARBALL))) +OPTEE_EXAMPLES_SOURCE = $(notdir $(OPTEE_EXAMPLES_TARBALL)) +else +OPTEE_EXAMPLES_SITE = $(call github,linaro-swg,optee_examples,$(OPTEE_EXAMPLES_VERSION)) +endif + +ifeq ($(BR2_PACKAGE_OPTEE_EXAMPLES):$(BR2_PACKAGE_OPTEE_EXAMPLES_LATEST),y:) +BR_NO_CHECK_HASH_FOR += $(OPTEE_EXAMPLES_SOURCE) +endif + OPTEE_EXAMPLES_DEPENDENCIES = optee-client optee-os # Trusted Application are not built from CMake due to ta_dev_kit dependencies. @@ -28,4 +39,10 @@ endef OPTEE_EXAMPLES_POST_BUILD_HOOKS += OPTEE_EXAMPLES_BUILD_TAS OPTEE_EXAMPLES_POST_INSTALL_TARGET_HOOKS += OPTEE_EXAMPLES_INSTALL_TAS +ifeq ($(BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_TARBALL)$(BR_BUILDING),yy) +ifeq ($(call qstrip,$(BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_TARBALL_LOCATION)),) +$(error No tarball location specified. Please check BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_TARBALL_LOCATION) +endif +endif + $(eval $(cmake-package))