[Buildroot] [PATCH] boot/optee-os: add support for custom tarball URL

Etienne Carriere etienne.carriere at linaro.org
Tue Jun 21 13:30:59 UTC 2022


Hello Kory,

On Tue, 21 Jun 2022 at 15:06, <kory.maincent at bootlin.com> wrote:
>
> From: Kory Maincent <kory.maincent at bootlin.com>
>
> 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 at bootlin.com>
> ---
>  boot/optee-os/Config.in   | 11 +++++++++++
>  boot/optee-os/optee-os.mk | 25 +++++++++++++++++++++++--
>  2 files changed, 34 insertions(+), 2 deletions(-)
>
> diff --git a/boot/optee-os/Config.in b/boot/optee-os/Config.in
> index 0be6e68b0c..d56cf53c8a 100644
> --- a/boot/optee-os/Config.in
> +++ b/boot/optee-os/Config.in
> @@ -25,6 +25,9 @@ config BR2_TARGET_OPTEE_OS_LATEST
>           Use the latest release tag from the OP-TEE OS official Git
>           repository.
>
> +config BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL
> +       bool "Custom tarball"
> +
>  config BR2_TARGET_OPTEE_OS_CUSTOM_GIT
>         bool "Custom Git repository"
>         help
> @@ -32,6 +35,13 @@ config BR2_TARGET_OPTEE_OS_CUSTOM_GIT
>
>  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
>
>  config BR2_TARGET_OPTEE_OS_CUSTOM_REPO_URL
> @@ -53,6 +63,7 @@ endif
>  config BR2_TARGET_OPTEE_OS_VERSION
>         string
>         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 \
>                                 if BR2_TARGET_OPTEE_OS_CUSTOM_GIT
>
> diff --git a/boot/optee-os/optee-os.mk b/boot/optee-os/optee-os.mk
> index 88f14b48e4..cc90cff2cb 100644
> --- a/boot/optee-os/optee-os.mk
> +++ b/boot/optee-os/optee-os.mk
> @@ -13,14 +13,22 @@ endif
>  OPTEE_OS_INSTALL_STAGING = YES
>  OPTEE_OS_INSTALL_IMAGES = YES
>
> -ifeq ($(BR2_TARGET_OPTEE_OS_CUSTOM_GIT),y)
> +ifeq ($(OPTEE_OS_VERSION),custom)

It looks strange to me that "custom" is a reserved version identifier
when using a custom tarball.
I'd rather use:
   ifeq ($(BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL),y)

> +# Handle custom U-Boot tarballs as specified by the configuration
> +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_METHOD = git
> -BR_NO_CHECK_HASH_FOR += $(OPTEE_OS_SOURCE)
>  else
>  OPTEE_OS_SITE = $(call github,OP-TEE,optee_os,$(OPTEE_OS_VERSION))
>  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
>
>  ifeq ($(BR2_TARGET_OPTEE_OS_NEEDS_PYTHON_CRYPTOGRAPHY),y)
> @@ -130,6 +138,19 @@ ifeq ($(BR2_TARGET_OPTEE_OS)$(BR_BUILDING),yy)
>  ifeq ($(call qstrip,$(BR2_TARGET_OPTEE_OS_PLATFORM)),)
>  $(error No OP-TEE OS platform set. Check your BR2_TARGET_OPTEE_OS_PLATFORM setting)
>  endif
> +
> +ifeq ($(OPTEE_OS_VERSION),custom)

Ditto:
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))

There is a extra ending parentheses to be removed in each of the 2 above lines.

Br,
etienne

> +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
>
>  $(eval $(generic-package))
> --
> 2.25.1
>



More information about the buildroot mailing list