All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2] boot/optee-os: add support for custom tarball URL
@ 2022-06-22  8:34 Kory Maincent via buildroot
  2022-06-22 10:29 ` Etienne Carriere
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Kory Maincent via buildroot @ 2022-06-22  8:34 UTC (permalink / raw)
  To: buildroot; +Cc: Kory Maincent, etienne.carriere, thomas.petazzoni

From: Kory Maincent <kory.maincent@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@bootlin.com>
---

Change since v1:
- Update the test condition on custom tarball selection.
- Remeved extra ending parentheses.

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

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Buildroot] [PATCH v2] boot/optee-os: add support for custom tarball URL
  2022-06-22  8:34 [Buildroot] [PATCH v2] boot/optee-os: add support for custom tarball URL Kory Maincent via buildroot
@ 2022-06-22 10:29 ` Etienne Carriere
  2022-06-22 12:36   ` Köry Maincent via buildroot
  2022-06-23  0:07 ` Thomas Petazzoni via buildroot
  2022-06-27 21:24 ` Arnout Vandecappelle
  2 siblings, 1 reply; 8+ messages in thread
From: Etienne Carriere @ 2022-06-22 10:29 UTC (permalink / raw)
  To: kory.maincent; +Cc: thomas.petazzoni, buildroot

Hi Köry,

On Wed, 22 Jun 2022 at 10:34, <kory.maincent@bootlin.com> wrote:
>
> From: Kory Maincent <kory.maincent@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@bootlin.com>
> ---
>
> Change since v1:
> - Update the test condition on custom tarball selection.
> - Remeved extra ending parentheses.
>
>  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..cddc1f2448 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 ($(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 ($(BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL),y)
> +ifeq ($(call qstrip,$(BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL_LOCATION)),)

Here we expect a tarball file path. Since the config switch is default
populated with a string, I think this should test file presence rather
than string existence:

ifeq ($(wildcard $(call
qstrip,$(BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL_LOCATION))),)
or more simply:
ifeq ($(wildcard $(OPTEE_OS_TARBALL)),)

Br,
etienne

> +$(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
>
>  $(eval $(generic-package))
> --
> 2.25.1
>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Buildroot] [PATCH v2] boot/optee-os: add support for custom tarball URL
  2022-06-22 10:29 ` Etienne Carriere
@ 2022-06-22 12:36   ` Köry Maincent via buildroot
  2022-06-22 13:00     ` Etienne Carriere
  0 siblings, 1 reply; 8+ messages in thread
From: Köry Maincent via buildroot @ 2022-06-22 12:36 UTC (permalink / raw)
  To: Etienne Carriere; +Cc: thomas.petazzoni, buildroot

Hello Etienne,

On Wed, 22 Jun 2022 12:29:05 +0200
Etienne Carriere <etienne.carriere@linaro.org> wrote:

> > +ifeq ($(BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL),y)
> > +ifeq ($(call qstrip,$(BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL_LOCATION)),)  
> 
> Here we expect a tarball file path. Since the config switch is default
> populated with a string, I think this should test file presence rather
> than string existence:

No, we can also use tarball web URL, then the wildcard function won't work in
case of web URL.

Regards,

Köry
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Buildroot] [PATCH v2] boot/optee-os: add support for custom tarball URL
  2022-06-22 12:36   ` Köry Maincent via buildroot
@ 2022-06-22 13:00     ` Etienne Carriere
  0 siblings, 0 replies; 8+ messages in thread
From: Etienne Carriere @ 2022-06-22 13:00 UTC (permalink / raw)
  To: Köry Maincent; +Cc: thomas.petazzoni, buildroot

On Wed, 22 Jun 2022 at 14:36, Köry Maincent <kory.maincent@bootlin.com> wrote:
>
> Hello Etienne,
>
> On Wed, 22 Jun 2022 12:29:05 +0200
> Etienne Carriere <etienne.carriere@linaro.org> wrote:
>
> > > +ifeq ($(BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL),y)
> > > +ifeq ($(call qstrip,$(BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL_LOCATION)),)
> >
> > Here we expect a tarball file path. Since the config switch is default
> > populated with a string, I think this should test file presence rather
> > than string existence:
>
> No, we can also use tarball web URL, then the wildcard function won't work in
> case of web URL.

Ok, fine.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.rog> for the v2.

Best regards,
etienne

>
> Regards,
>
> Köry
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Buildroot] [PATCH v2] boot/optee-os: add support for custom tarball URL
  2022-06-22  8:34 [Buildroot] [PATCH v2] boot/optee-os: add support for custom tarball URL Kory Maincent via buildroot
  2022-06-22 10:29 ` Etienne Carriere
@ 2022-06-23  0:07 ` Thomas Petazzoni via buildroot
  2022-06-23 13:06   ` Köry Maincent via buildroot
  2022-06-27 21:24 ` Arnout Vandecappelle
  2 siblings, 1 reply; 8+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-06-23  0:07 UTC (permalink / raw)
  To: kory.maincent; +Cc: etienne.carriere, buildroot

Hello,

On Wed, 22 Jun 2022 10:34:33 +0200
kory.maincent@bootlin.com wrote:

> -ifeq ($(BR2_TARGET_OPTEE_OS_CUSTOM_GIT),y)
> +ifeq ($(BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL),y)
> +# Handle custom U-Boot tarballs as specified by the configuration

I followed the discussion on the v1 whether we should test the version
to be "custom" or whether we should test
BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL==y. I initially though there was a
reason for testing version==custom, but I was not able to find why, and
some packages (linux for example) do not test version==custom.

So I agree that testing BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL==y is a
better solution, which is what you have done here.

However, I would ideally like this to be consistent throughout the
tree, which means we should change the following ones:

boot/arm-trusted-firmware/arm-trusted-firmware.mk:ifeq ($(ARM_TRUSTED_FIRMWARE_VERSION),custom)
boot/arm-trusted-firmware/arm-trusted-firmware.mk:ifeq ($(ARM_TRUSTED_FIRMWARE_VERSION),custom)
boot/barebox/barebox.mk:ifeq ($$($(1)_VERSION),custom)
boot/opensbi/opensbi.mk:ifeq ($(OPENSBI_VERSION),custom)
boot/uboot/uboot.mk:ifeq ($(UBOOT_VERSION),custom)

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Buildroot] [PATCH v2] boot/optee-os: add support for custom tarball URL
  2022-06-23  0:07 ` Thomas Petazzoni via buildroot
@ 2022-06-23 13:06   ` Köry Maincent via buildroot
  0 siblings, 0 replies; 8+ messages in thread
From: Köry Maincent via buildroot @ 2022-06-23 13:06 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: etienne.carriere, buildroot

Hello Thomas,

On Thu, 23 Jun 2022 02:07:57 +0200
Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:

> Hello,
> 
> On Wed, 22 Jun 2022 10:34:33 +0200
> kory.maincent@bootlin.com wrote:
> 
> > -ifeq ($(BR2_TARGET_OPTEE_OS_CUSTOM_GIT),y)
> > +ifeq ($(BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL),y)
> > +# Handle custom U-Boot tarballs as specified by the configuration  
> 
> I followed the discussion on the v1 whether we should test the version
> to be "custom" or whether we should test
> BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL==y. I initially though there was a
> reason for testing version==custom, but I was not able to find why, and
> some packages (linux for example) do not test version==custom.
> 
> So I agree that testing BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL==y is a
> better solution, which is what you have done here.
> 
> However, I would ideally like this to be consistent throughout the
> tree, which means we should change the following ones:
> 
> boot/arm-trusted-firmware/arm-trusted-firmware.mk:ifeq
> ($(ARM_TRUSTED_FIRMWARE_VERSION),custom)
> boot/arm-trusted-firmware/arm-trusted-firmware.mk:ifeq
> ($(ARM_TRUSTED_FIRMWARE_VERSION),custom) boot/barebox/barebox.mk:ifeq
> ($$($(1)_VERSION),custom) boot/opensbi/opensbi.mk:ifeq
> ($(OPENSBI_VERSION),custom) boot/uboot/uboot.mk:ifeq ($(UBOOT_VERSION),custom)

Ok, I will send patches to have consistency in these packages.

Regards,
Köry
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Buildroot] [PATCH v2] boot/optee-os: add support for custom tarball URL
  2022-06-22  8:34 [Buildroot] [PATCH v2] boot/optee-os: add support for custom tarball URL Kory Maincent via buildroot
  2022-06-22 10:29 ` Etienne Carriere
  2022-06-23  0:07 ` Thomas Petazzoni via buildroot
@ 2022-06-27 21:24 ` Arnout Vandecappelle
  2022-06-29  9:37   ` Etienne Carriere
  2 siblings, 1 reply; 8+ messages in thread
From: Arnout Vandecappelle @ 2022-06-27 21:24 UTC (permalink / raw)
  To: kory.maincent, buildroot; +Cc: etienne.carriere, thomas.petazzoni



On 22/06/2022 10:34, Kory Maincent via buildroot wrote:
> From: Kory Maincent <kory.maincent@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@bootlin.com>

  Applied to master, thanks.


> ---
> 
> Change since v1:
> - Update the test condition on custom tarball selection.
> - Remeved extra ending parentheses.
> 
>   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"

  I've added the help text from the kernel here.

> +
>   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..cddc1f2448 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 ($(BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL),y)
> +# Handle custom U-Boot tarballs as specified by the configuration

  U-Boot? Copy paste error I guess :-)

  However, this comment is pretty useless, so I just removed it.

> +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)

  It's not immediately obvious that the first should be y and the second empty, 
so I changed this into

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 ($(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)

  Normally there should also be a handler in utils/genrandconfig to make sure 
that a fully random config with empty tarball location doesn't fail. However, 
that never happens at the moment because BR2_TARGET_OPTEE_OS_PLATFORM is already 
empty and that already triggers the removal of BR2_TARGET_OPTEE_OS. Still, it 
would be nice to handle this case as well, reverting to 
BR2_TARGET_OPTEE_OS_LATEST if the tarball location is empty.

  Regards,
  Arnout


> +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))
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Buildroot] [PATCH v2] boot/optee-os: add support for custom tarball URL
  2022-06-27 21:24 ` Arnout Vandecappelle
@ 2022-06-29  9:37   ` Etienne Carriere
  0 siblings, 0 replies; 8+ messages in thread
From: Etienne Carriere @ 2022-06-29  9:37 UTC (permalink / raw)
  To: Arnout Vandecappelle; +Cc: kory.maincent, thomas.petazzoni, buildroot

Hello Arnout,

On Mon, 27 Jun 2022 at 23:24, Arnout Vandecappelle <arnout@mind.be> wrote:
>
>
>
> On 22/06/2022 10:34, Kory Maincent via buildroot wrote:
> > From: Kory Maincent <kory.maincent@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@bootlin.com>
>
>   Applied to master, thanks.
>
>
> > ---
> >
> > Change since v1:
> > - Update the test condition on custom tarball selection.
> > - Remeved extra ending parentheses.
> >
> >   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"
>
>   I've added the help text from the kernel here.
>
> > +
> >   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..cddc1f2448 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 ($(BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL),y)
> > +# Handle custom U-Boot tarballs as specified by the configuration
>
>   U-Boot? Copy paste error I guess :-)
>
>   However, this comment is pretty useless, so I just removed it.
>
> > +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)
>
>   It's not immediately obvious that the first should be y and the second empty,
> so I changed this into
>
> 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 ($(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)
>
>   Normally there should also be a handler in utils/genrandconfig to make sure
> that a fully random config with empty tarball location doesn't fail. However,
> that never happens at the moment because BR2_TARGET_OPTEE_OS_PLATFORM is already
> empty and that already triggers the removal of BR2_TARGET_OPTEE_OS. Still, it
> would be nice to handle this case as well, reverting to
> BR2_TARGET_OPTEE_OS_LATEST if the tarball location is empty.

Do you mean optee_os.mk would force BR2_TARGET_OPTEE_OS_LATEST=y
configuration when the one provided to build is inconsistent?

Or is there a specific file where BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL=y
+ empty BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL_LOCATION can be defined as
invalid random config?

Br,
etienne

>
>   Regards,
>   Arnout
>
>
> > +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))
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-06-29  9:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-22  8:34 [Buildroot] [PATCH v2] boot/optee-os: add support for custom tarball URL Kory Maincent via buildroot
2022-06-22 10:29 ` Etienne Carriere
2022-06-22 12:36   ` Köry Maincent via buildroot
2022-06-22 13:00     ` Etienne Carriere
2022-06-23  0:07 ` Thomas Petazzoni via buildroot
2022-06-23 13:06   ` Köry Maincent via buildroot
2022-06-27 21:24 ` Arnout Vandecappelle
2022-06-29  9:37   ` Etienne Carriere

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.