diff mbox series

[master/kirkstone,v2] uboot: Handle UBOOT_CONFIG for multiple R5 defconfigs

Message ID 20231005183629.1820821-1-ggiordano@phytec.com
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series [master/kirkstone,v2] uboot: Handle UBOOT_CONFIG for multiple R5 defconfigs | expand

Commit Message

Garrett Giordano Oct. 5, 2023, 6:36 p.m. UTC
From: Garrett Giordano <ggiordano@phytec.com>

Currently the do_compile step fails if we try to implement UBOOT_CONFIG
in an attempt to build U-Boot with multiple R5 defconfigs.

This commit adds a condition to handle linking the UBOOT_BINARY if
UBOOT_CONFIG is used in place of UBOOT_MACHINE.

Signed-off-by: Garrett Giordano <ggiordano@phytec.com>
---
 v2
  - updated commit subject. Changed from machine:k3r5 to uboot.
---
 meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc | 22 ++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
diff mbox series

Patch

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 2c4ddcc2..327a31d8 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
@@ -103,8 +103,26 @@  UBOOT_HS_2ND_IMAGE = "u-boot-spl_HS_2ND-${MACHINE}-${PV}-${PR}"
 UBOOT_HS_2ND_SYMLINK = "u-boot-spl_HS_2ND-${MACHINE}"
 
 do_compile:append:k3r5 () {
-	if ! [ -f ${B}/${UBOOT_BINARY} ]; then
-		ln -s spl/u-boot-spl.${UBOOT_SUFFIX} ${B}/${UBOOT_BINARY}
+	if [ -n "${UBOOT_CONFIG}" ];
+	then
+		for config in ${UBOOT_MACHINE}; do
+			i=$(expr $i + 1);
+			for type in ${UBOOT_CONFIG}; do
+				j=$(expr $j + 1);
+				if [ $j -eq $i ];
+				then
+					if ! [ -L ${B}/${config}/${UBOOT_BINARY} ] && ! [ -f ${B}/${config}/${UBOOT_BINARY} ]; then
+						ln -s ${B}/${config}/spl/u-boot-spl.${UBOOT_SUFFIX} ${B}/${config}/${UBOOT_BINARY}
+					fi
+				fi
+			done
+			unset  j
+		done
+		unset  i
+	else
+		if ! [ -f ${B}/${UBOOT_BINARY} ]; then
+			ln -s spl/u-boot-spl.${UBOOT_SUFFIX} ${B}/${UBOOT_BINARY}
+		fi
 	fi
 }