morty migration: image_types_digi: fix initramfs Trustfence signing

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 <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2017-02-20 16:50:53 +01:00
parent 187ee9bdcd
commit 41b3631934
1 changed files with 6 additions and 5 deletions

View File

@ -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"