Skip to contentSkip to conversation

u-boot: Copy U-Boot script to B when suffix is not scr

PATCH New [email protected] 1 participant 1 message Feb 25

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 u-boot: Copy U-Boot script to B when suffix is not scr

From: Ricardo Simoes <[email protected]>

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

---
 meta/recipes-bsp/u-boot/u-boot.inc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
meta/recipes-bsp/u-boot/u-boot.inc +8 -2
index a58bba2160..01137cb495 100644
@@ -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
 }
 
Signature · 1 line
2.34.1