From 270b7b64452679fdd3d83963ce468a89de86be21 Mon Sep 17 00:00:00 2001 From: Ryan Eatmon Date: Fri, 19 Dec 2025 18:12:08 -0600 Subject: [PATCH] u-boot-ti: Clean up config looping code 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 --- meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc | 46 +++++++++++++++----- 1 file changed, 34 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..9801ffbe 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,34 @@ 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} + ln -sf ${tgt_base}-${type} ${DEPLOYDIR}/${f_base} + 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} + ln -sf ${tgt_base}-${type} ${DEPLOYDIR}/${f_base} + 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 +279,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 }