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

Signed-off-by: Ricardo Simoes <[email protected]>
Signed-off-by: Mark Jonas <[email protected]>
---
 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

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#231968): 
https://lists.openembedded.org/g/openembedded-core/message/231968
Mute This Topic: https://lists.openembedded.org/mt/117997093/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to