public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] u-boot-custom: Add a config package for Linux user-space
@ 2020-06-16 14:20 Harald Seiler
  2020-06-18 14:09 ` Jan Kiszka
  0 siblings, 1 reply; 2+ messages in thread
From: Harald Seiler @ 2020-06-16 14:20 UTC (permalink / raw)
  To: isar-users; +Cc: Jan Kiszka, Harald Seiler

Add a new (optional) u-boot-${MACHINE}-config package (which also
provides u-boot-config) that contains configuration files for Linux
user-space.  Namely, the default environment as /etc/u-boot-initial-env
and a config for envtools as /etc/fw_env.config.

This new package can be enabled by setting

    U_BOOT_CONFIG_PACKAGE = "1"

in a concrete U-Boot recipe.  The recipe then also needs to provide
a fw_env.config file in its SRC_URI / in ${WORKDIR}.

Signed-off-by: Harald Seiler <hws@denx.de>
---
 meta/recipes-bsp/u-boot/files/debian/rules |  1 +
 meta/recipes-bsp/u-boot/u-boot-custom.inc  | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/meta/recipes-bsp/u-boot/files/debian/rules b/meta/recipes-bsp/u-boot/files/debian/rules
index 3f7a3218a870..e27299aa7a26 100755
--- a/meta/recipes-bsp/u-boot/files/debian/rules
+++ b/meta/recipes-bsp/u-boot/files/debian/rules
@@ -17,6 +17,7 @@ PARALLEL_BUILD=-j $(shell echo $$(($$(nproc) * 2)))
 override_dh_auto_build:
 	$(MAKE) $(PARALLEL_BUILD) $(U_BOOT_CONFIG)
 	$(MAKE) $(PARALLEL_BUILD) ${U_BOOT_BIN}
+	./scripts/get_default_envs.sh >u-boot-initial-env
 	$(MAKE) $(PARALLEL_BUILD) $(SET_CROSS_BUILD_TOOLS) NO_SDL=1 tools-only envtools
 
 override_dh_auto_install:
diff --git a/meta/recipes-bsp/u-boot/u-boot-custom.inc b/meta/recipes-bsp/u-boot/u-boot-custom.inc
index 41124fc359e8..3e4fc1b6ec3c 100644
--- a/meta/recipes-bsp/u-boot/u-boot-custom.inc
+++ b/meta/recipes-bsp/u-boot/u-boot-custom.inc
@@ -11,6 +11,8 @@ DESCRIPTION ?= "Custom U-Boot"
 
 PROVIDES += "u-boot-${MACHINE} u-boot-${MACHINE}-dev"
 PROVIDES += "${@'u-boot-tools' if d.getVar('U_BOOT_TOOLS_PACKAGE') == '1' else ''}"
+PROVIDES += "${@('u-boot-config u-boot-' + d.getVar('MACHINE') + '-config') \
+    if d.getVar('U_BOOT_CONFIG_PACKAGE') == '1' else ''}"
 
 inherit dpkg
 
@@ -22,6 +24,7 @@ TEMPLATE_FILES = "debian/control.tmpl"
 TEMPLATE_VARS += "MACHINE BUILD_DEPENDS"
 
 U_BOOT_TOOLS_PACKAGE ?= "0"
+U_BOOT_CONFIG_PACKAGE ?= "0"
 
 do_prepare_build() {
     cp -r ${WORKDIR}/debian ${S}/
@@ -41,6 +44,24 @@ Package: u-boot-tools
 Architecture: linux-any
 Depends: \${shlibs:Depends}, \${misc:Depends}
 Description: ${DESCRIPTION}, companion tools
+EOF
+    fi
+
+    if [ "${U_BOOT_CONFIG_PACKAGE}" = "1" ]; then
+        cp ${WORKDIR}/fw_env.config ${S}/ || \
+            die "U_BOOT_CONFIG_PACKAGE requires a fw_env.config in SRC_URI"
+
+        cat <<EOF >>${S}/debian/control
+
+Package: u-boot-${MACHINE}-config
+Provides: u-boot-config
+Architecture: ${DISTRO_ARCH}
+Description: ${DESCRIPTION}, environment configuration
+EOF
+
+        cat <<EOF >>${S}/debian/u-boot-${MACHINE}-config.install
+u-boot-initial-env /etc
+fw_env.config      /etc
 EOF
     fi
 }
-- 
2.25.4


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

* Re: [PATCH] u-boot-custom: Add a config package for Linux user-space
  2020-06-16 14:20 [PATCH] u-boot-custom: Add a config package for Linux user-space Harald Seiler
@ 2020-06-18 14:09 ` Jan Kiszka
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2020-06-18 14:09 UTC (permalink / raw)
  To: Harald Seiler, isar-users

On 16.06.20 16:20, Harald Seiler wrote:
> Add a new (optional) u-boot-${MACHINE}-config package (which also
> provides u-boot-config) that contains configuration files for Linux
> user-space.  Namely, the default environment as /etc/u-boot-initial-env
> and a config for envtools as /etc/fw_env.config.
> 
> This new package can be enabled by setting
> 
>     U_BOOT_CONFIG_PACKAGE = "1"
> 
> in a concrete U-Boot recipe.  The recipe then also needs to provide
> a fw_env.config file in its SRC_URI / in ${WORKDIR}.
> 

Would be worth mentioning that this is an important building block for
switching to libubootenv as binding for swupdate (rather than
u-boot-<machine>-dev.deb) and for replacing classic u-boot-tools,
including those self-built by this recipe.

Recipes to build Debian's new libubootenv and update u-boot-tools (the
latter is still needed for mkimage) from bullseye for buster will follow.

> Signed-off-by: Harald Seiler <hws@denx.de>
> ---
>  meta/recipes-bsp/u-boot/files/debian/rules |  1 +
>  meta/recipes-bsp/u-boot/u-boot-custom.inc  | 21 +++++++++++++++++++++
>  2 files changed, 22 insertions(+)
> 
> diff --git a/meta/recipes-bsp/u-boot/files/debian/rules b/meta/recipes-bsp/u-boot/files/debian/rules
> index 3f7a3218a870..e27299aa7a26 100755
> --- a/meta/recipes-bsp/u-boot/files/debian/rules
> +++ b/meta/recipes-bsp/u-boot/files/debian/rules
> @@ -17,6 +17,7 @@ PARALLEL_BUILD=-j $(shell echo $$(($$(nproc) * 2)))
>  override_dh_auto_build:
>  	$(MAKE) $(PARALLEL_BUILD) $(U_BOOT_CONFIG)
>  	$(MAKE) $(PARALLEL_BUILD) ${U_BOOT_BIN}
> +	./scripts/get_default_envs.sh >u-boot-initial-env
>  	$(MAKE) $(PARALLEL_BUILD) $(SET_CROSS_BUILD_TOOLS) NO_SDL=1 tools-only envtools
>  
>  override_dh_auto_install:
> diff --git a/meta/recipes-bsp/u-boot/u-boot-custom.inc b/meta/recipes-bsp/u-boot/u-boot-custom.inc
> index 41124fc359e8..3e4fc1b6ec3c 100644
> --- a/meta/recipes-bsp/u-boot/u-boot-custom.inc
> +++ b/meta/recipes-bsp/u-boot/u-boot-custom.inc
> @@ -11,6 +11,8 @@ DESCRIPTION ?= "Custom U-Boot"
>  
>  PROVIDES += "u-boot-${MACHINE} u-boot-${MACHINE}-dev"
>  PROVIDES += "${@'u-boot-tools' if d.getVar('U_BOOT_TOOLS_PACKAGE') == '1' else ''}"
> +PROVIDES += "${@('u-boot-config u-boot-' + d.getVar('MACHINE') + '-config') \
> +    if d.getVar('U_BOOT_CONFIG_PACKAGE') == '1' else ''}"
>  
>  inherit dpkg
>  
> @@ -22,6 +24,7 @@ TEMPLATE_FILES = "debian/control.tmpl"
>  TEMPLATE_VARS += "MACHINE BUILD_DEPENDS"
>  
>  U_BOOT_TOOLS_PACKAGE ?= "0"
> +U_BOOT_CONFIG_PACKAGE ?= "0"
>  
>  do_prepare_build() {
>      cp -r ${WORKDIR}/debian ${S}/
> @@ -41,6 +44,24 @@ Package: u-boot-tools
>  Architecture: linux-any
>  Depends: \${shlibs:Depends}, \${misc:Depends}
>  Description: ${DESCRIPTION}, companion tools
> +EOF
> +    fi
> +
> +    if [ "${U_BOOT_CONFIG_PACKAGE}" = "1" ]; then
> +        cp ${WORKDIR}/fw_env.config ${S}/ || \
> +            die "U_BOOT_CONFIG_PACKAGE requires a fw_env.config in SRC_URI"
> +
> +        cat <<EOF >>${S}/debian/control
> +
> +Package: u-boot-${MACHINE}-config
> +Provides: u-boot-config
> +Architecture: ${DISTRO_ARCH}
> +Description: ${DESCRIPTION}, environment configuration
> +EOF
> +
> +        cat <<EOF >>${S}/debian/u-boot-${MACHINE}-config.install
> +u-boot-initial-env /etc
> +fw_env.config      /etc
>  EOF
>      fi
>  }
> 

Looks good to me.

Thanks,
Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

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

end of thread, other threads:[~2020-06-18 14:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16 14:20 [PATCH] u-boot-custom: Add a config package for Linux user-space Harald Seiler
2020-06-18 14:09 ` Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox