summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Liu <liu.ming50@gmail.com>2022-03-28 16:15:51 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-29 15:59:29 +0100
commit240e5ab3c4e17b476c15078da5b1262b35086d10 (patch)
tree2f85c112ca1cc93f2fc3db49f094e5d851c71559
parentdbedfdeed269d7f8d4a02d1d7e6eb0c4955a628f (diff)
downloadpoky-240e5ab3c4e17b476c15078da5b1262b35086d10.tar.gz
kernel-fitimage.bbclass: introduce FIT_SUPPORTED_INITRAMFS_FSTYPES
It was found when a end user wants to build a squashfs type initramfs into fitimage, it just fails without printing out any error or warning messages, which is not right. Introduce a FIT_SUPPORTED_INITRAMFS_FSTYPES variable to avoid hard-coding the supported initramfs types, and it could be overridden in config files. Also break the build when none of a supported initramfs type is found. (From OE-Core rev: b0f8d8a4c063936b50d3ec7c066b29157b3c3544) Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/kernel-fitimage.bbclass10
1 files changed, 9 insertions, 1 deletions
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
index 13af4daafc..7e09b075ff 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -65,6 +65,8 @@ FIT_SIGN_INDIVIDUAL ?= "0"
65FIT_CONF_PREFIX ?= "conf-" 65FIT_CONF_PREFIX ?= "conf-"
66FIT_CONF_PREFIX[doc] = "Prefix to use for FIT configuration node name" 66FIT_CONF_PREFIX[doc] = "Prefix to use for FIT configuration node name"
67 67
68FIT_SUPPORTED_INITRAMFS_FSTYPES ?= "cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz ext2.gz cpio"
69
68# Keys used to sign individually image nodes. 70# Keys used to sign individually image nodes.
69# The keys to sign image nodes must be different from those used to sign 71# The keys to sign image nodes must be different from those used to sign
70# configuration nodes, otherwise the "required" property, from 72# configuration nodes, otherwise the "required" property, from
@@ -566,16 +568,22 @@ fitimage_assemble() {
566 # 568 #
567 if [ "x${ramdiskcount}" = "x1" ] && [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then 569 if [ "x${ramdiskcount}" = "x1" ] && [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then
568 # Find and use the first initramfs image archive type we find 570 # Find and use the first initramfs image archive type we find
569 for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz ext2.gz cpio; do 571 found=
572 for img in ${FIT_SUPPORTED_INITRAMFS_FSTYPES}; do
570 initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.$img" 573 initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.$img"
571 if [ -e "$initramfs_path" ]; then 574 if [ -e "$initramfs_path" ]; then
572 bbnote "Found initramfs image: $initramfs_path" 575 bbnote "Found initramfs image: $initramfs_path"
576 found=true
573 fitimage_emit_section_ramdisk $1 "$ramdiskcount" "$initramfs_path" 577 fitimage_emit_section_ramdisk $1 "$ramdiskcount" "$initramfs_path"
574 break 578 break
575 else 579 else
576 bbnote "Did not find initramfs image: $initramfs_path" 580 bbnote "Did not find initramfs image: $initramfs_path"
577 fi 581 fi
578 done 582 done
583
584 if [ -z "$found" ]; then
585 bbfatal "Could not find a valid initramfs type for ${INITRAMFS_IMAGE_NAME}, the supported types are: ${FIT_SUPPORTED_INITRAMFS_FSTYPES}"
586 fi
579 fi 587 fi
580 588
581 fitimage_emit_section_maint $1 sectend 589 fitimage_emit_section_maint $1 sectend