From 3eed042d80aac1786220691d357afabf3c022253 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 27 Feb 2024 17:00:26 +0100 Subject: [PATCH] image_types_digi: restrict boot image artifacts using KERNEL_IMAGETYPE When we use a fitImage kernel type, all the boot artifacts are inside the FIT image, so there is no need to add them to the boot image additionally. We were using TRUSTFENCE_FIT_IMG to do this filtering, which uses a fitImage kernel type underneath. This commit uses KERNEL_IMAGETYPE instead, as this way, we can use kernel FIT images out of Trustfence and still prevent polluting the boot images with not-needed artifacts. Signed-off-by: Javier Viguera --- meta-digi-arm/classes/image_types_digi.bbclass | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/meta-digi-arm/classes/image_types_digi.bbclass b/meta-digi-arm/classes/image_types_digi.bbclass index db641ac69..0b677fe44 100644 --- a/meta-digi-arm/classes/image_types_digi.bbclass +++ b/meta-digi-arm/classes/image_types_digi.bbclass @@ -22,7 +22,7 @@ IMAGE_CMD:boot.vfat() { BOOTIMG_FILES="$(readlink -e ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin)" BOOTIMG_FILES_SYMLINK="${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin" # Exclude DTB and DTBO from VFAT image when creating a FIT image - if [ "${TRUSTFENCE_FIT_IMG}" != "1" ]; then + if [ "${KERNEL_IMAGETYPE}" != "fitImage" ]; then if [ -n "${KERNEL_DEVICETREE}" ]; then for DTB in ${KERNEL_DEVICETREE}; do # Remove potential sub-folders @@ -61,7 +61,7 @@ IMAGE_CMD:boot.vfat() { mcopy -i ${IMGDEPLOYDIR}/${IMAGE_NAME}.boot.vfat ${BOOTIMG_FILES_SYMLINK} ::/ # Exclude boot scripts from VFAT image when creating a FIT image - if [ "${TRUSTFENCE_FIT_IMG}" != "1" ]; then + if [ "${KERNEL_IMAGETYPE}" != "fitImage" ]; then # Copy boot scripts into the VFAT image for item in ${BOOT_SCRIPTS}; do src=`echo $item | awk -F':' '{ print $1 }'` @@ -90,7 +90,7 @@ do_image_boot_ubifs[depends] += " \ IMAGE_CMD:boot.ubifs() { BOOTIMG_FILES_SYMLINK="${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin" # Exclude DTB and DTBO from UBIFS image when creating a FIT image - if [ "${TRUSTFENCE_FIT_IMG}" != "1" ]; then + if [ "${KERNEL_IMAGETYPE}" != "fitImage" ]; then if [ -n "${KERNEL_DEVICETREE}" ]; then for DTB in ${KERNEL_DEVICETREE}; do # Remove potential sub-folders @@ -117,7 +117,7 @@ IMAGE_CMD:boot.ubifs() { done # Exclude boot scripts from UBIFS image when creating a FIT image - if [ "${TRUSTFENCE_FIT_IMG}" != "1" ]; then + if [ "${KERNEL_IMAGETYPE}" != "fitImage" ]; then # Hard-link boot scripts into the temporary folder for item in ${BOOT_SCRIPTS}; do src="$(echo ${item} | awk -F':' '{ print $1 }')" @@ -148,7 +148,7 @@ IMAGE_CMD:recovery.vfat() { cp --remove-destination ${IMGDEPLOYDIR}/${IMAGE_NAME}.boot.vfat ${IMGDEPLOYDIR}/${IMAGE_NAME}.recovery.vfat # Exclude initRAMFS from VFAT image when creating a FIT image - if [ "${TRUSTFENCE_FIT_IMG}" != "1" ]; then + if [ "${KERNEL_IMAGETYPE}" != "fitImage" ]; then # Copy the recovery initramfs into the VFAT image mcopy -i ${IMGDEPLOYDIR}/${IMAGE_NAME}.recovery.vfat -s ${DEPLOY_DIR_IMAGE}/${RECOVERY_INITRAMFS_IMAGE}-${MACHINE}.cpio.gz.u-boot.tf ::/uramdisk-recovery.img fi @@ -169,7 +169,7 @@ do_image_recovery_ubifs[depends] += " \ IMAGE_CMD:recovery.ubifs() { RECOVERYIMG_FILES_SYMLINK="${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin" # Exclude DTB and DTBO from VFAT image when creating a FIT image - if [ "${TRUSTFENCE_FIT_IMG}" != "1" ]; then + if [ "${KERNEL_IMAGETYPE}" != "fitImage" ]; then if [ -n "${KERNEL_DEVICETREE}" ]; then for DTB in ${KERNEL_DEVICETREE}; do # Remove potential sub-folders @@ -191,7 +191,7 @@ IMAGE_CMD:recovery.ubifs() { done # Exclude bootscript from VFAT image when creating a FIT image - if [ "${TRUSTFENCE_FIT_IMG}" != "1" ]; then + if [ "${KERNEL_IMAGETYPE}" != "fitImage" ]; then # Hard-link boot scripts into the temporary folder for item in ${BOOT_SCRIPTS}; do src="$(echo ${item} | awk -F':' '{ print $1 }')"