]> code.ossystems Code Review - openembedded-core.git/commitdiff
uboot-sign: fix the concatenation when multiple U-BOOT configurations are specified
authorThomas Perrot <thomas.perrot@bootlin.com>
Wed, 27 Oct 2021 14:04:12 +0000 (16:04 +0200)
committerAnuj Mittal <anuj.mittal@intel.com>
Fri, 10 Dec 2021 03:38:17 +0000 (11:38 +0800)
Some BSPs, especially those of meta-freescale and meta-ti allow to build U-Boot
binaries using different configuration for a given target, for example:
- UBOOT_CONFIG ??= "tfa-secure-boot tfa"
- UBOOT_CONFIG ??= "nand sdcard spi nor"

When this is the case the public key wasn't concatenated to all U-Boot binaries
built.

Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit dfd71ae3d102f3010c6117d774e9739a322930f6)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
meta/classes/uboot-sign.bbclass

index fdf153248c886251edce6d95427f2303c7d0886d..c39b30f43b2e83bc5feeb3b847de4afb0843c121 100644 (file)
@@ -131,6 +131,20 @@ concat_dtb_helper() {
                elif [ -e "${DEPLOYDIR}/${UBOOT_NODTB_IMAGE}" -a -e "$deployed_uboot_dtb_binary" ]; then
                        cd ${DEPLOYDIR}
                        cat ${UBOOT_NODTB_IMAGE} $deployed_uboot_dtb_binary | tee ${B}/${CONFIG_B_PATH}/${UBOOT_BINARY} > ${UBOOT_IMAGE}
+
+                       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
+                                                       cp ${UBOOT_IMAGE} ${B}/${CONFIG_B_PATH}/u-boot-$type.${UBOOT_SUFFIX}
+                                               fi
+                                       done
+                               done
+                       fi
                else
                        bbwarn "Failure while adding public key to u-boot binary. Verified boot won't be available."
                fi
@@ -205,7 +219,7 @@ install_helper() {
        fi
 }
 
-# Install SPL dtb and u-boot nodtb to datadir, 
+# Install SPL dtb and u-boot nodtb to datadir,
 install_spl_helper() {
        if [ -f "${SPL_DIR}/${SPL_DTB_BINARY}" ]; then
                install -Dm 0644 ${SPL_DIR}/${SPL_DTB_BINARY} ${D}${datadir}/${SPL_DTB_IMAGE}