[v2] u-boot: Improve extra template variables usage

Message ID 20240522143238.863223-1-amikan@ilbers.de
State Accepted, archived
Headers show
Series [v2] u-boot: Improve extra template variables usage | expand

Commit Message

Anton Mikanovich May 22, 2024, 2:32 p.m. UTC
Commit 1b0ea08f introduced BL31 and TEE variables to be used in custom
u-boot recipes. Summarize them to U_BOOT_EXTRA_BUILDARGS (with default
to the same values) to allow any custom variables to be set.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
Changes since v1:
 - Fixed typo in commit message

 meta/recipes-bsp/u-boot/files/debian/rules.tmpl | 2 +-
 meta/recipes-bsp/u-boot/u-boot-custom.inc       | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Uladzimir Bely May 30, 2024, 5:51 a.m. UTC | #1
On Wed, 2024-05-22 at 17:32 +0300, Anton Mikanovich wrote:
> Commit 1b0ea08f introduced BL31 and TEE variables to be used in
> custom
> u-boot recipes. Summarize them to U_BOOT_EXTRA_BUILDARGS (with
> default
> to the same values) to allow any custom variables to be set.
> 
> Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
> ---
> Changes since v1:
>  - Fixed typo in commit message
> 
>  meta/recipes-bsp/u-boot/files/debian/rules.tmpl | 2 +-
>  meta/recipes-bsp/u-boot/u-boot-custom.inc       | 4 +++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/recipes-bsp/u-boot/files/debian/rules.tmpl
> b/meta/recipes-bsp/u-boot/files/debian/rules.tmpl
> index 53c85451..f4c161aa 100755
> --- a/meta/recipes-bsp/u-boot/files/debian/rules.tmpl
> +++ b/meta/recipes-bsp/u-boot/files/debian/rules.tmpl
> @@ -14,7 +14,7 @@ endif
>  
>  override_dh_auto_build:
>  	$(MAKE) $(PARALLEL_MAKE) ${U_BOOT_CONFIG}
> -	$(MAKE) $(PARALLEL_MAKE) BL31=${BL31} TEE=${TEE}
> ${U_BOOT_BIN}
> +	$(MAKE) $(PARALLEL_MAKE) ${U_BOOT_EXTRA_BUILDARGS}
> ${U_BOOT_BIN}
>  	$(MAKE) -n u-boot-initial-env >/dev/null 2>&1; if [ $$? -ne
> 2 ]; then \
>  		$(MAKE) $(PARALLEL_MAKE) u-boot-initial-env; \
>  	else \
> diff --git a/meta/recipes-bsp/u-boot/u-boot-custom.inc
> b/meta/recipes-bsp/u-boot/u-boot-custom.inc
> index 017e8336..a7b6cb0b 100644
> --- a/meta/recipes-bsp/u-boot/u-boot-custom.inc
> +++ b/meta/recipes-bsp/u-boot/u-boot-custom.inc
> @@ -22,9 +22,11 @@ DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-
> tree-compiler, git"
>  
>  U_BOOT_BIN_INSTALL ?= "${U_BOOT_BIN}"
>  
> +U_BOOT_EXTRA_BUILDARGS ??= "BL31=${BL31} TEE=${TEE}"
> +
>  TEMPLATE_FILES = "debian/control.tmpl debian/rules.tmpl"
>  TEMPLATE_VARS += "MACHINE DEBIAN_BUILD_DEPENDS U_BOOT_CONFIG
> U_BOOT_BIN \
> -    BL31 TEE"
> +    U_BOOT_EXTRA_BUILDARGS"
>  
>  U_BOOT_TOOLS_PACKAGE ?= "0"
>  U_BOOT_CONFIG_PACKAGE ?= "0"
> -- 
> 2.34.1
> 

Applied to next.

Patch

diff --git a/meta/recipes-bsp/u-boot/files/debian/rules.tmpl b/meta/recipes-bsp/u-boot/files/debian/rules.tmpl
index 53c85451..f4c161aa 100755
--- a/meta/recipes-bsp/u-boot/files/debian/rules.tmpl
+++ b/meta/recipes-bsp/u-boot/files/debian/rules.tmpl
@@ -14,7 +14,7 @@  endif
 
 override_dh_auto_build:
 	$(MAKE) $(PARALLEL_MAKE) ${U_BOOT_CONFIG}
-	$(MAKE) $(PARALLEL_MAKE) BL31=${BL31} TEE=${TEE} ${U_BOOT_BIN}
+	$(MAKE) $(PARALLEL_MAKE) ${U_BOOT_EXTRA_BUILDARGS} ${U_BOOT_BIN}
 	$(MAKE) -n u-boot-initial-env >/dev/null 2>&1; if [ $$? -ne 2 ]; then \
 		$(MAKE) $(PARALLEL_MAKE) u-boot-initial-env; \
 	else \
diff --git a/meta/recipes-bsp/u-boot/u-boot-custom.inc b/meta/recipes-bsp/u-boot/u-boot-custom.inc
index 017e8336..a7b6cb0b 100644
--- a/meta/recipes-bsp/u-boot/u-boot-custom.inc
+++ b/meta/recipes-bsp/u-boot/u-boot-custom.inc
@@ -22,9 +22,11 @@  DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git"
 
 U_BOOT_BIN_INSTALL ?= "${U_BOOT_BIN}"
 
+U_BOOT_EXTRA_BUILDARGS ??= "BL31=${BL31} TEE=${TEE}"
+
 TEMPLATE_FILES = "debian/control.tmpl debian/rules.tmpl"
 TEMPLATE_VARS += "MACHINE DEBIAN_BUILD_DEPENDS U_BOOT_CONFIG U_BOOT_BIN \
-    BL31 TEE"
+    U_BOOT_EXTRA_BUILDARGS"
 
 U_BOOT_TOOLS_PACKAGE ?= "0"
 U_BOOT_CONFIG_PACKAGE ?= "0"