]> code.ossystems Code Review - meta-freescale.git/commitdiff
imx-base.inc: Provide a default value for SPL_BINARY topic/fix-spl-binary 723/head
authorOtavio Salvador <otavio@ossystems.com.br>
Wed, 14 Apr 2021 17:58:39 +0000 (14:58 -0300)
committerOtavio Salvador <otavio@ossystems.com.br>
Wed, 14 Apr 2021 18:30:24 +0000 (15:30 -0300)
This fixes the build case when machine does not use SPL and does not set
it. We couldn't use dynamic expansion or we trigger a recursive
expansion so we opted to use an utility function to do the proper logic.

Fixes: f98059fe ("imx-base.inc: Allow use of SPL_BINARY variable inside wic images")
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
conf/machine/include/imx-base.inc
conf/machine/include/utilities.inc

index 2b434133ba037477fb87e63f71d47519907841f8..14008927cf129dba5d65399c670d8aef1efc0912 100644 (file)
@@ -65,7 +65,7 @@ UBOOT_SUFFIX ?= "${UBOOT_SUFFIX_pn-${IMX_DEFAULT_BOOTLOADER}}"
 
 # We need to export the original variable to allow it to be used when generating
 # wic based images.
-SPL_BINARY ?= "${SPL_BINARY_pn-${IMX_DEFAULT_BOOTLOADER}}"
+SPL_BINARY ??= "${@get_spl_binary(d)}"
 
 IMX_DEFAULT_UBOOTTOOLS = "${@bb.utils.contains('IMX_DEFAULT_BOOTLOADER', 'u-boot-imx','u-boot-imx-tools', 'u-boot-tools', d)}"
 IMX_DEFAULT_MFGTOOL = "${@bb.utils.contains('IMX_DEFAULT_BOOTLOADER', 'u-boot-imx','u-boot-imx-mfgtool', 'u-boot-fslc', d)}"
index e9695bde0bb00a66a7f5acdccb2434bdf697fa1b..f11b588bbe5d2bf1d7ab2c06ce2192e549b29f0e 100644 (file)
@@ -20,3 +20,9 @@ def make_dtb_boot_files(d):
         return os.path.basename(dtb)
 
     return ' '.join([transform(dtb) for dtb in alldtbs.split() if dtb])
+
+def get_spl_binary(d):
+    imx_default_bootloader = d.get('IMX_DEFAULT_BOOTLOADER')
+    spl_binary = d.getVar("SPL_BINARY_pn-%s" % imx_default_bootloader)
+
+    return spl_binary or ""