Cleanup a few incorrect issues with the current file naming under the
config looping code.

1) Since binman is creating the tiboot3 files and signing them, when we
   are trying to create the named version of the files, we do not want
   to link against the spl/uboot-spl.bin file.  We need to figure out
   what the tiboot3.bin is pointing at and make this named version point
   at the same thing.

2) When deploying the tiboot3 files, if we are deploying something that
   is a link, then we should point the deployed link to the same named
   target.  This should help with figuring out what all of the links
   actually point to from the build dir instead of running into .bin
   file that has lost the audit trail.

Signed-off-by: Ryan Eatmon <[email protected]>
---
 meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc | 44 ++++++++++++++------
 1 file changed, 32 insertions(+), 12 deletions(-)

diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc 
b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc
index 92ec5ca8..04a784d5 100644
--- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc
+++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc
@@ -150,13 +150,17 @@ uboot_compile_config_copy_binary:k3r5 () {
 
     builddir="${builddir}"
 
-    if ! [ -L ${B}/${builddir}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ] 
&& ! [ -f ${B}/${builddir}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ]; then
-        ln -s ${B}/${builddir}/spl/u-boot-spl.${UBOOT_SUFFIX} 
${B}/${builddir}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX}
-    fi
-
     if ! [ -L ${B}/${builddir}/${binary} ] && ! [ -f 
${B}/${builddir}/${binary} ]; then
         ln -s ${B}/${builddir}/spl/u-boot-spl.${UBOOT_SUFFIX} 
${B}/${builddir}/${binary}
     fi
+
+    if ! [ -L ${B}/${builddir}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ] 
&& ! [ -f ${B}/${builddir}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ]; then
+        tgt="${B}/${builddir}/${binary}"
+        if [ -L ${B}/${builddir}/${binary} ]; then
+            tgt=$(realpath ${B}/${builddir}/${binary})
+        fi
+        ln -s ${tgt} 
${B}/${builddir}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX}
+    fi
 }
 
 uboot_install_config:append () {
@@ -230,18 +234,32 @@ do_deploy:append:k3r5 () {
 
 uboot_deploy_config:append:k3r5 () {
        for f in ${B}/${builddir}/tiboot3-*.bin; do
-               if [ -f "$f" ]; then
+               if [ -L "$f" ]; then
                        f_base=$(basename $f)
-                       install -m 644 $f ${DEPLOYDIR}/${f_base}-${type}
-                       ln -sf ${f_base}-${type} ${DEPLOYDIR}/${f_base}
+                       tgt=$(realpath $f)
+                       tgt_base=$(basename $tgt)
+                       ln -sf ${tgt_base}-${type} 
${DEPLOYDIR}/${f_base}-${type}
+               else
+                       if [ -f "$f" ]; then
+                               f_base=$(basename $f)
+                               install -m 644 $f ${DEPLOYDIR}/${f_base}-${type}
+                               ln -sf ${f_base}-${type} ${DEPLOYDIR}/${f_base}
+                       fi
                fi
        done
 
        for f in ${B}/${builddir}/sysfw*.itb; do
-               if [ -f "$f" ]; then
+               if [ -L "$f" ]; then
                        f_base=$(basename $f)
-                       install -m 644 $f ${DEPLOYDIR}/${f_base}-${type}
-                       ln -sf ${f_base}-${type} ${DEPLOYDIR}/${f_base}
+                       tgt=$(realpath $f)
+                       tgt_base=$(basename $tgt)
+                       ln -sf ${tgt_base}-${type} 
${DEPLOYDIR}/${f_base}-${type}
+               else
+                       if [ -f "$f" ]; then
+                               f_base=$(basename $f)
+                               install -m 644 $f ${DEPLOYDIR}/${f_base}-${type}
+                               ln -sf ${f_base}-${type} ${DEPLOYDIR}/${f_base}
+                       fi
                fi
        done
 }
@@ -259,13 +277,15 @@ uboot_deploy_config:append:am62lxx () {
 uboot_deploy:append:k3r5 () {
     for f in ${B}/tiboot3-*.bin; do
                if [ -f "$f" ]; then
-                       install -m 644 $f ${DEPLOYDIR}/
+                       f_base=$(basename $f)
+                       install -m 644 $f ${DEPLOYDIR}/${f_base}
                fi
        done
 
        for f in ${B}/sysfw*.itb; do
                if [ -f "$f" ]; then
-                       install -m 644 $f ${DEPLOYDIR}/
+                       f_base=$(basename $f)
+                       install -m 644 $f ${DEPLOYDIR}/${f_base}
                fi
        done
 }
-- 
2.43.0

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

Reply via email to