From 2a5c484f314ddc75cab5f0d01b0215d7fc405b6b Mon Sep 17 00:00:00 2001 From: Ting Liu Date: Wed, 15 Jun 2016 23:01:10 +0800 Subject: u-boot: extend UBOOT_CONFIG format to support different binary name When using UBOOT_CONFIG format, the final u-boot binary for each config may have different names. Extend UBOOT_CONFIG format to support different binary to be copied. The new format is supposed to be compatible with old one as ${UBOOT_BINARY} is copied by default, and images,binary can be empty. An example format to specify it, in the machine, is: UBOOT_CONFIG ??= "sdcard-ifc sdcard-qspi lpuart qspi secure-boot nor" UBOOT_CONFIG[nor] = "ls1021atwr_nor_config,,u-boot-dtb.bin" UBOOT_CONFIG[sdcard-ifc] = "ls1021atwr_sdcard_ifc_config,,u-boot-with-spl-pbl.bin" UBOOT_CONFIG[sdcard-qspi] = "ls1021atwr_sdcard_qspi_config,,u-boot-with-spl-pbl.bin" UBOOT_CONFIG[lpuart] = "ls1021atwr_nor_lpuart_config,,u-boot-dtb.bin" UBOOT_CONFIG[qspi] = "ls1021atwr_qspi_config,,u-boot-dtb.bin" UBOOT_CONFIG[secure-boot] = "ls1021atwr_nor_SECURE_BOOT_config" Signed-off-by: Ting Liu Signed-off-by: Ross Burton --- meta/recipes-bsp/u-boot/u-boot.inc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'meta/recipes-bsp/u-boot') diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc index 1071d1f270..1f64faa6f6 100644 --- a/meta/recipes-bsp/u-boot/u-boot.inc +++ b/meta/recipes-bsp/u-boot/u-boot.inc @@ -32,7 +32,6 @@ UBOOT_LOCALVERSION ?= "" # but enable individual recipes to change this value. UBOOT_SUFFIX ??= "bin" UBOOT_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.${UBOOT_SUFFIX}" -UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}" UBOOT_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_SUFFIX}" UBOOT_MAKE_TARGET ?= "all" @@ -82,15 +81,22 @@ do_compile () { if [ -n "${UBOOT_CONFIG}" ] then + unset i j k for config in ${UBOOT_MACHINE}; do i=$(expr $i + 1); - for type in ${UBOOT_CONFIG}; do + for type in ${UBOOT_CONFIG}; do j=$(expr $j + 1); if [ $j -eq $i ] then oe_runmake O=${config} ${config} oe_runmake O=${config} ${UBOOT_MAKE_TARGET} - cp ${S}/${config}/${UBOOT_BINARY} ${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX} + for binary in ${UBOOT_BINARIES}; do + k=$(expr $k + 1); + if [ $k -eq $i ]; then + cp ${S}/${config}/${binary} ${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX} + fi + done + unset k fi done unset j -- cgit 1.2.3-korg