public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH] u-boot: Copy U-Boot script to B when suffix is not scr
@ 2026-02-25 16:27 mark.jonas
  0 siblings, 0 replies; only message in thread
From: mark.jonas @ 2026-02-25 16:27 UTC (permalink / raw)
  To: openembedded-core
  Cc: Leon Anavi, Richard Purdie, Ryan Eatmon, Mathieu Dubois-Briand,
	Ricardo Simoes, Mark Jonas

From: Ricardo Simoes <ricardo.simoes@pt.bosch.com>

With the introduction of the UNPACKDIR variable, commit [1] changed the
expected location of UBOOT_ENV_BINARY to B. This works fine when
UBOOT_ENV_SUFFIX is "scr" but it does not copy the script when it is
not. As documented in [2], it is expected that with any other value of
UBOOT_ENV_SUFFIX the script gets installed verbatim.

This commit fixes that by copying UNPACKDIR/UBOOT_ENV_SRC to
B/UBOOT_ENV_BINARY when UBOOT_ENV_SUFFIX is not "scr", as documented.

[1] https://git.openembedded.org/openembedded-core/commit/?id=62ff94ff40e823065178318133d54e44a3d8a46d

[2] https://docs.yoctoproject.org/ref-manual/variables.html#term-UBOOT_ENV

Signed-off-by: Ricardo Simoes <ricardo.simoes@pt.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
---
 meta/recipes-bsp/u-boot/u-boot.inc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index a58bba2160..01137cb495 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -65,9 +65,15 @@ do_compile () {
         uboot_compile
     fi
 
-    if [ -n "${UBOOT_ENV}" ] && [ "${UBOOT_ENV_SUFFIX}" = "scr" ]
+    if [ -n "${UBOOT_ENV}" ]
     then
-        ${UBOOT_MKIMAGE} -C none -A ${UBOOT_ARCH} -T script -d ${UNPACKDIR}/${UBOOT_ENV_SRC} ${B}/${UBOOT_ENV_BINARY}
+        # If UBOOT_ENV_SUFFIX is set to scr the script is packaged as a uImage otherwise it gets installed verbatim.
+        if [ "${UBOOT_ENV_SUFFIX}" = "scr" ]
+        then
+            ${UBOOT_MKIMAGE} -C none -A ${UBOOT_ARCH} -T script -d ${UNPACKDIR}/${UBOOT_ENV_SRC} ${B}/${UBOOT_ENV_BINARY}
+        else
+            install -m 644 ${UNPACKDIR}/${UBOOT_ENV_SRC} ${B}/${UBOOT_ENV_BINARY}
+        fi
     fi
 }
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-02-25 16:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-25 16:27 [PATCH] u-boot: Copy U-Boot script to B when suffix is not scr mark.jonas

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