summaryrefslogtreecommitdiff
path: root/recipes-bsp
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2017-09-03 16:05:10 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2017-12-23 22:15:42 +0100
commite60ead11df7cabee4e186f96430c2cb9e9599d44 (patch)
tree1be6da7824a22127f9e8fcc44810c47db1b09803 /recipes-bsp
parente3b3388b1e9d96e9b0818b2de9aaf0a953ab6acf (diff)
u-boot-toradex: allow to build a spl and non spl u-boot
With UBOOT_CONFIG one can build several U-Boot configs, however the current code does fail if these build mixed spl and non spl based U-Boots. This works around the issue by generating a fake SPL file and delete it after its presence is no longer needed. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Diffstat (limited to 'recipes-bsp')
-rw-r--r--recipes-bsp/u-boot/u-boot-toradex_2016.11.bbappend53
1 files changed, 53 insertions, 0 deletions
diff --git a/recipes-bsp/u-boot/u-boot-toradex_2016.11.bbappend b/recipes-bsp/u-boot/u-boot-toradex_2016.11.bbappend
index c3cbbe2..403196e 100644
--- a/recipes-bsp/u-boot/u-boot-toradex_2016.11.bbappend
+++ b/recipes-bsp/u-boot/u-boot-toradex_2016.11.bbappend
@@ -6,3 +6,56 @@ SRCREV = "52259cf22a165c0721bb26c723c0dc5e2659eaa7"
SRCBRANCH = "2016.11-toradex"
SRCREV_use-head-next = "${AUTOREV}"
SRCBRANCH_use-head-next = "2016.11-toradex-next"
+
+# Hack around building two U-Boot configurations, one with, one without SPL
+# if using UBOOT_CONFIG to build more than one configuration, the current code in
+# u-boot.inc assumes all are either with or without SPL.
+compile_add() {
+ if [ -n "${UBOOT_CONFIG}" ]
+ then
+ for config in ${UBOOT_MACHINE}; do
+ touch ${B}/${config}/${SPL_BINARY}
+ done
+ fi
+}
+deploy_add() {
+ # if SPL is zero sized file, remove all deployed artefacts
+ if [ -n "${SPL_BINARY}" ]
+ then
+ 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 [ ! -s ${DEPLOYDIR}/${SPL_IMAGE}-${type}-${PV}-${PR} ]
+ then
+ rm -f ${DEPLOYDIR}/${SPL_IMAGE}-${type}-${PV}-${PR}
+ rm -f ${DEPLOYDIR}/${SPL_BINARYNAME}-${type}
+ rm -f ${DEPLOYDIR}/${SPL_SYMLINK}-${type}
+ rm -f ${DEPLOYDIR}/${SPL_SYMLINK}
+ else
+ ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${SPL_BINARYNAME}
+ fi
+ fi
+ done
+ unset j
+ done
+ unset i
+ fi
+ fi
+}
+do_compile_append_mx6() {
+ compile_add
+}
+do_compile_append_use-mainline-bsp() {
+ compile_add
+}
+do_deploy_append_mx6() {
+ deploy_add
+}
+do_deploy_append_use-mainline-bsp() {
+ deploy_add
+}