From 8ccafb949276306bc973cadcf336a253d15fd656 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Mon, 18 Jul 2016 11:35:09 +0200 Subject: [PATCH] u-boot: disable TF initramfs for CC6UL At the moment there is no support for rootfs encryption for the CC6UL, so there is not a ramdisk in the boot image. But with the initial addition of TF support, the u-boot boot script was being on-the-fly updated for TF regardless of the platform, making the CC6UL unable to boot when TF was enabled. This commit fixes the problem, by just changing the u-boot boot script when TF is enabled only for the CC6. https://jira.digi.com/browse/DEL-2754 Signed-off-by: Javier Viguera --- .../recipes-bsp/u-boot/u-boot-dey_2015.04.bb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2015.04.bb b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2015.04.bb index 6a46528ab..5c88ffd79 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2015.04.bb +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2015.04.bb @@ -96,6 +96,13 @@ do_compile () { } +TF_BOOTSCRIPT_SEDFILTER = "" +TF_BOOTSCRIPT_SEDFILTER_ccimx6 = "${@tf_bootscript_sedfilter(d)}" + +def tf_bootscript_sedfilter(d): + tf_initramfs = d.getVar('TRUSTFENCE_INITRAMFS_IMAGE',True) or "" + return "/^dboot linux/i\setenv boot_initrd true\\nsetenv initrd_file %s-${MACHINE}.cpio.gz.u-boot" % tf_initramfs if tf_initramfs else "" + do_deploy_append() { # Remove canonical U-Boot symlinks for ${UBOOT_CONFIG} currently in the form: # u-boot-.imx- @@ -142,13 +149,7 @@ do_deploy_append() { # Boot script for DEY images (reconfigure on-the-fly if TRUSTFENCE is enabled) TMP_BOOTSCR="$(mktemp ${WORKDIR}/bootscr.XXXXXX)" - cat ${WORKDIR}/boot.txt > ${TMP_BOOTSCR} - if [ -n "${TRUSTFENCE_INITRAMFS_IMAGE}" ]; then - sed -i -e '/^dboot linux/{ - i\setenv boot_initrd true - i\setenv initrd_file ${TRUSTFENCE_INITRAMFS_IMAGE}-${MACHINE}.cpio.gz.u-boot - }' ${TMP_BOOTSCR} - fi + sed -e "${TF_BOOTSCRIPT_SEDFILTER}" ${WORKDIR}/boot.txt > ${TMP_BOOTSCR} mkimage -T script -n bootscript -C none -d ${TMP_BOOTSCR} ${DEPLOYDIR}/boot.scr rm -f ${TMP_BOOTSCR} }