diff options
author | Ming Liu <liu.ming50@gmail.com> | 2022-03-28 16:15:51 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-29 15:58:39 +0100 |
commit | b0f8d8a4c063936b50d3ec7c066b29157b3c3544 (patch) | |
tree | 1ecc825d2617b19b4d401925aea823b27eed0b91 /meta/classes/kernel-fitimage.bbclass | |
parent | 3d05ba04824c7f08e42b1972bc0de538164b61ea (diff) | |
download | openembedded-core-contrib-b0f8d8a4c063936b50d3ec7c066b29157b3c3544.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.
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>
Diffstat (limited to 'meta/classes/kernel-fitimage.bbclass')
-rw-r--r-- | meta/classes/kernel-fitimage.bbclass | 10 |
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" FIT_CONF_PREFIX ?= "conf-" FIT_CONF_PREFIX[doc] = "Prefix to use for FIT configuration node name" +FIT_SUPPORTED_INITRAMFS_FSTYPES ?= "cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz ext2.gz cpio" + # Keys used to sign individually image nodes. # The keys to sign image nodes must be different from those used to sign # configuration nodes, otherwise the "required" property, from @@ -566,16 +568,22 @@ fitimage_assemble() { # if [ "x${ramdiskcount}" = "x1" ] && [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then # Find and use the first initramfs image archive type we find - for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz ext2.gz cpio; do + found= + for img in ${FIT_SUPPORTED_INITRAMFS_FSTYPES}; do initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.$img" if [ -e "$initramfs_path" ]; then bbnote "Found initramfs image: $initramfs_path" + found=true fitimage_emit_section_ramdisk $1 "$ramdiskcount" "$initramfs_path" break else bbnote "Did not find initramfs image: $initramfs_path" fi done + + if [ -z "$found" ]; then + bbfatal "Could not find a valid initramfs type for ${INITRAMFS_IMAGE_NAME}, the supported types are: ${FIT_SUPPORTED_INITRAMFS_FSTYPES}" + fi fi fitimage_emit_section_maint $1 sectend |