diff options
author | Ming Liu <ming.liu@toradex.com> | 2022-03-28 15:23:55 +0200 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2022-04-03 11:58:39 +0200 |
commit | 0472f407a38eaf4445e6287e70151b7c2d6add2a (patch) | |
tree | 317f1f0836dfd238cfe9761ec7b13f615ca9f860 /classes | |
parent | 66605462196ef8235a367ff49315e32d97782438 (diff) |
toradex-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.
A similar change has been merged into OE, reference:
https://lore.kernel.org/all/20220328141551.571676-1-liu.ming50@gmail.com
Related-to: TEI-1005
Signed-off-by: Ming Liu <ming.liu@toradex.com>
(cherry picked from commit 4d2ad76efd531a274375f81a7e3e4c0da65411f9)
Diffstat (limited to 'classes')
-rw-r--r-- | classes/toradex-fitimage.bbclass | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/classes/toradex-fitimage.bbclass b/classes/toradex-fitimage.bbclass index 24fb2fc..f3ad492 100644 --- a/classes/toradex-fitimage.bbclass +++ b/classes/toradex-fitimage.bbclass @@ -7,6 +7,8 @@ inherit kernel-fitimage +FIT_SUPPORTED_INITRAMFS_FSTYPES ?= "cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz ext2.gz cpio squashfs" + # # Override fitimage_assemble in kernel-fitimage.bbclass # @@ -81,14 +83,20 @@ fitimage_assemble() { # if [ "x${ramdiskcount}" = "x1" ] ; then # Find and use the first initramfs image archive type we find - for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz ext2.gz cpio; do + found= + for img in ${FIT_SUPPORTED_INITRAMFS_FSTYPES}; do initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${img}" echo "Using $initramfs_path" if [ -e "${initramfs_path}" ]; then + found=true fitimage_emit_section_ramdisk ${1} "${ramdiskcount}" "${initramfs_path}" break 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 |