From e8f721a0b2eefd21956100e5ef5e918d4f5d76f6 Mon Sep 17 00:00:00 2001 From: Gonzalo Ruiz Date: Sun, 14 Jun 2020 12:37:01 +0200 Subject: [PATCH] trustfence: use correct imx-boot image for sdcard When the Bootloader is an 'imx-boot', select the correct imx-boot signed image to compose the sdcard artifact. https://jira.digi.com/browse/DEL-7024 Signed-off-by: Gonzalo Ruiz --- meta-digi-arm/classes/image_types_digi.bbclass | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/meta-digi-arm/classes/image_types_digi.bbclass b/meta-digi-arm/classes/image_types_digi.bbclass index b982091ec..c695d2e44 100644 --- a/meta-digi-arm/classes/image_types_digi.bbclass +++ b/meta-digi-arm/classes/image_types_digi.bbclass @@ -280,14 +280,19 @@ IMAGE_CMD_sdcard() { parted -s ${SDIMG} -- unit KiB mkpart primary ext2 $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED}) -1s parted -s ${SDIMG} unit KiB print - # FIXME: adapt trustfence handling for imx-boot # Set u-boot image to flash depending on whether TRUSTFENCE_SIGN is enabled if [ "${TRUSTFENCE_SIGN}" = "1" ]; then - SDIMG_BOOTLOADER="$(readlink -e ${SDIMG_BOOTLOADER} | sed -e 's,u-boot-,u-boot-signed-,g')" + if [ "${BOOTLOADER_IMAGE_RECIPE}" = "u-boot" ]; then + SDIMG_BOOT="$(readlink -e ${SDIMG_BOOTLOADER} | sed -e 's,u-boot-,u-boot-signed-,g')" + else + SDIMG_BOOT="$(readlink -e ${SDIMG_BOOTLOADER} | sed -e 's,imx-boot-,imx-boot-signed-,g')" + fi + else + SDIMG_BOOT="$(readlink -e ${SDIMG_BOOTLOADER})" fi # Burn bootloader, boot and rootfs partitions - dd if=${SDIMG_BOOTLOADER} of=${SDIMG} conv=notrunc,fsync seek=${BOOTLOADER_SEEK} bs=1K + dd if=${SDIMG_BOOT} of=${SDIMG} conv=notrunc,fsync seek=${BOOTLOADER_SEEK} bs=1K dd if=${SDIMG_BOOTFS} of=${SDIMG} conv=notrunc,fsync seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) dd if=${SDIMG_ROOTFS} of=${SDIMG} conv=notrunc,fsync seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024 + ${BOOT_SPACE_ALIGNED} \* 1024) }