Browse Source

boot/optee-os: add support for custom tarball URL

For now only latest release and custom git repository was supported.
This patch adds support for custom tarball URL.

It also adds configuration verification for custom git repository and
tarball URL.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.rog> for the v2.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Kory Maincent 3 years ago
parent
commit
9c79b369d6
2 changed files with 41 additions and 2 deletions
  1. 19 0
      boot/optee-os/Config.in
  2. 22 2
      boot/optee-os/optee-os.mk

+ 19 - 0
boot/optee-os/Config.in

@@ -25,6 +25,17 @@ config BR2_TARGET_OPTEE_OS_LATEST
 	  Use the latest release tag from the OP-TEE OS official Git
 	  Use the latest release tag from the OP-TEE OS official Git
 	  repository.
 	  repository.
 
 
+config BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL
+	bool "Custom tarball"
+	help
+	  This option allows to specify a URL pointing to a kernel
+	  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.
+
 config BR2_TARGET_OPTEE_OS_CUSTOM_GIT
 config BR2_TARGET_OPTEE_OS_CUSTOM_GIT
 	bool "Custom Git repository"
 	bool "Custom Git repository"
 	help
 	help
@@ -32,6 +43,13 @@ config BR2_TARGET_OPTEE_OS_CUSTOM_GIT
 
 
 endchoice
 endchoice
 
 
+if BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL
+
+config BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL_LOCATION
+	string "URL of custom OP-TEE OS tarball"
+
+endif
+
 if BR2_TARGET_OPTEE_OS_CUSTOM_GIT
 if BR2_TARGET_OPTEE_OS_CUSTOM_GIT
 
 
 config BR2_TARGET_OPTEE_OS_CUSTOM_REPO_URL
 config BR2_TARGET_OPTEE_OS_CUSTOM_REPO_URL
@@ -53,6 +71,7 @@ endif
 config BR2_TARGET_OPTEE_OS_VERSION
 config BR2_TARGET_OPTEE_OS_VERSION
 	string
 	string
 	default "3.17.0"	if BR2_TARGET_OPTEE_OS_LATEST
 	default "3.17.0"	if BR2_TARGET_OPTEE_OS_LATEST
+	default "custom"	if BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL
 	default BR2_TARGET_OPTEE_OS_CUSTOM_REPO_VERSION \
 	default BR2_TARGET_OPTEE_OS_CUSTOM_REPO_VERSION \
 				if BR2_TARGET_OPTEE_OS_CUSTOM_GIT
 				if BR2_TARGET_OPTEE_OS_CUSTOM_GIT
 
 

+ 22 - 2
boot/optee-os/optee-os.mk

@@ -13,14 +13,21 @@ endif
 OPTEE_OS_INSTALL_STAGING = YES
 OPTEE_OS_INSTALL_STAGING = YES
 OPTEE_OS_INSTALL_IMAGES = YES
 OPTEE_OS_INSTALL_IMAGES = YES
 
 
-ifeq ($(BR2_TARGET_OPTEE_OS_CUSTOM_GIT),y)
+ifeq ($(BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL),y)
+OPTEE_OS_TARBALL = $(call qstrip,$(BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL_LOCATION))
+OPTEE_OS_SITE = $(patsubst %/,%,$(dir $(OPTEE_OS_TARBALL)))
+OPTEE_OS_SOURCE = $(notdir $(OPTEE_OS_TARBALL))
+else ifeq ($(BR2_TARGET_OPTEE_OS_CUSTOM_GIT),y)
 OPTEE_OS_SITE = $(call qstrip,$(BR2_TARGET_OPTEE_OS_CUSTOM_REPO_URL))
 OPTEE_OS_SITE = $(call qstrip,$(BR2_TARGET_OPTEE_OS_CUSTOM_REPO_URL))
 OPTEE_OS_SITE_METHOD = git
 OPTEE_OS_SITE_METHOD = git
-BR_NO_CHECK_HASH_FOR += $(OPTEE_OS_SOURCE)
 else
 else
 OPTEE_OS_SITE = $(call github,OP-TEE,optee_os,$(OPTEE_OS_VERSION))
 OPTEE_OS_SITE = $(call github,OP-TEE,optee_os,$(OPTEE_OS_VERSION))
 endif
 endif
 
 
+ifeq ($(BR2_TARGET_OPTEE_OS):$(BR2_TARGET_OPTEE_OS_LATEST_VERSION),y:)
+BR_NO_CHECK_HASH_FOR += $(OPTEE_OS_SOURCE)
+endif
+
 OPTEE_OS_DEPENDENCIES = host-openssl host-python3 host-python-pyelftools
 OPTEE_OS_DEPENDENCIES = host-openssl host-python3 host-python-pyelftools
 
 
 ifeq ($(BR2_TARGET_OPTEE_OS_NEEDS_PYTHON_CRYPTOGRAPHY),y)
 ifeq ($(BR2_TARGET_OPTEE_OS_NEEDS_PYTHON_CRYPTOGRAPHY),y)
@@ -130,6 +137,19 @@ ifeq ($(BR2_TARGET_OPTEE_OS)$(BR_BUILDING),yy)
 ifeq ($(call qstrip,$(BR2_TARGET_OPTEE_OS_PLATFORM)),)
 ifeq ($(call qstrip,$(BR2_TARGET_OPTEE_OS_PLATFORM)),)
 $(error No OP-TEE OS platform set. Check your BR2_TARGET_OPTEE_OS_PLATFORM setting)
 $(error No OP-TEE OS platform set. Check your BR2_TARGET_OPTEE_OS_PLATFORM setting)
 endif
 endif
+
+ifeq ($(BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL),y)
+ifeq ($(call qstrip,$(BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL_LOCATION)),)
+$(error No tarball location specified. Please check BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL_LOCATION)
+endif
+endif
+
+ifeq ($(BR2_TARGET_OPTEE_OS_CUSTOM_GIT),y)
+ifeq ($(call qstrip,$(BR2_TARGET_OPTEE_OS_CUSTOM_REPO_URL)),)
+$(error No repository specified. Please check BR2_TARGET_OPTEE_OS_CUSTOM_REPO_URL)
+endif
+endif
+
 endif # BR2_TARGET_OPTEE_OS && BR2_BUILDING
 endif # BR2_TARGET_OPTEE_OS && BR2_BUILDING
 
 
 $(eval $(generic-package))
 $(eval $(generic-package))