From 41b36319348517701aaabfeb41f4c4d16852d857 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Mon, 20 Feb 2017 16:50:53 +0100 Subject: [PATCH] morty migration: image_types_digi: fix initramfs Trustfence signing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As of Yocto 2.2, the way to generate images has changed. Now the image fstypes have a basetype and then conversion types that define functions that apply sequentially. So implement the TrustFence initramfs sign process as a conversion type of the base initramfs type (cpio). This fixes following build issue: mv: cannot stat ‘dey-image-recovery-initramfs-ccimx6ulstarter-20170220152625.rootfs.cpio.gz.u-boot’ https://jira.digi.com/browse/DEL-3451 Signed-off-by: Javier Viguera --- meta-digi-arm/classes/image_types_digi.bbclass | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/meta-digi-arm/classes/image_types_digi.bbclass b/meta-digi-arm/classes/image_types_digi.bbclass index 3210922b6..568f0f415 100644 --- a/meta-digi-arm/classes/image_types_digi.bbclass +++ b/meta-digi-arm/classes/image_types_digi.bbclass @@ -195,7 +195,7 @@ IMAGE_CMD_recovery.ubifs() { rm -rf ${TMP_RECOVERYDIR} } -IMAGE_CMD_cpio.gz.u-boot.tf() { +trustence_sign_cpio() { # # Image generation code for image type 'cpio.gz.u-boot.tf' # (signed/encrypted ramdisk) @@ -207,14 +207,15 @@ IMAGE_CMD_cpio.gz.u-boot.tf() { [ -n "${TRUSTFENCE_DEK_PATH}" ] && [ "${TRUSTFENCE_DEK_PATH}" != "0" ] && export CONFIG_DEK_PATH="${TRUSTFENCE_DEK_PATH}" # Sign/encrypt the ramdisk - "${STAGING_BINDIR_NATIVE}/trustfence-sign-kernel.sh" -p "${DIGI_FAMILY}" -i "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio.gz.u-boot" "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio.gz.u-boot.tf" + trustfence-sign-kernel.sh -p "${DIGI_FAMILY}" -i "${1}" "${1}.tf" else # Rename image - mv "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio.gz.u-boot" "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio.gz.u-boot.tf" + mv "${1}" "${1}.tf" fi } - -IMAGE_TYPEDEP_cpio.gz.u-boot.tf = "cpio.gz.u-boot" +CONVERSIONTYPES += "gz.u-boot.tf" +CONVERSION_CMD_gz.u-boot.tf = "${CONVERSION_CMD_gz.u-boot}; trustence_sign_cpio ${IMAGE_NAME}.rootfs.${type}.gz.u-boot" +IMAGE_TYPES += "cpio.gz.u-boot.tf" # Set alignment to 4MB [in KiB] IMAGE_ROOTFS_ALIGNMENT = "4096"