diff mbox series

[v2,22/22] kernel-fit-image.bbclass: ignore INITRAMFS_IMAGE_BUNDLE

Message ID 20250513213834.87830-23-adrian.freihofer@siemens.com
State New
Headers show
Series FIT image improvements | expand

Commit Message

AdrianF May 13, 2025, 9:37 p.m. UTC
From: Adrian Freihofer <adrian.freihofer@siemens.com>

The new recipe includes the initramfs unbundled anyway. Remove the code
which does not work in the context of a recipe which takes the kernel
artifacts from recipe-sysroot. The kernel in the recipe-sysroot is
exported by the do_install function of the kernel which runs before
do_bundle_initramfs.

It would be possible to support the bundled in FIT image use case if the
recipe would take the kernel artifacts from the deploy folder where also
the bundled kernel artifact could be found. But what's the use case of a
bundled artifact included in a FIT image? Rather than supporting
something which does not work well with the sstate-cache lets guide the
users to a better implementation and simplify the code where possible.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
---
 meta/classes-recipe/kernel-fit-image.bbclass | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/kernel-fit-image.bbclass b/meta/classes-recipe/kernel-fit-image.bbclass
index f4620aa0f86..dd8a6200328 100644
--- a/meta/classes-recipe/kernel-fit-image.bbclass
+++ b/meta/classes-recipe/kernel-fit-image.bbclass
@@ -14,7 +14,7 @@  DEPENDS += "\
 
 python () {
     image = d.getVar('INITRAMFS_IMAGE')
-    if image and not bb.utils.to_boolean(d.getVar('INITRAMFS_IMAGE_BUNDLE')):
+    if image:
         if d.getVar('INITRAMFS_MULTICONFIG'):
             mc = d.getVar('BB_CURRENT_MC')
             d.appendVarFlag('do_compile', 'mcdepends', ' mc:' + mc + ':${INITRAMFS_MULTICONFIG}:${INITRAMFS_IMAGE}:do_image_complete')
@@ -107,7 +107,7 @@  python do_compile() {
 
     # Prepare a ramdisk section.
     initramfs_image = d.getVar('INITRAMFS_IMAGE')
-    if initramfs_image and not oe.types.boolean(d.getVar("INITRAMFS_IMAGE_BUNDLE")):
+    if initramfs_image:
         # Find and use the first initramfs image archive type we find
         found = False
         for img in d.getVar("FIT_SUPPORTED_INITRAMFS_FSTYPES").split():
@@ -156,11 +156,9 @@  do_deploy() {
     install -m 0644 "${B}/fitImage" "$deploy_dir/fitImage"
     install -m 0644 "${B}/fit-image.its" "$deploy_dir/fit-image.its"
 
-    if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then
-        ln -snf fit-image.its "$deploy_dir/fitImage-its-${KERNEL_FIT_NAME}.its"
-        if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then
-            ln -snf fit-image.its "$deploy_dir/fitImage-its-${KERNEL_FIT_LINK_NAME}"
-        fi
+    ln -snf fit-image.its "$deploy_dir/fitImage-its-${KERNEL_FIT_NAME}.its"
+    if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then
+        ln -snf fit-image.its "$deploy_dir/fitImage-its-${KERNEL_FIT_LINK_NAME}"
     fi
 
     if [ -n "${INITRAMFS_IMAGE}" ]; then
@@ -169,11 +167,9 @@  do_deploy() {
             ln -snf fit-image.its "$deploy_dir/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}"
         fi
 
-        if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then
-            ln -snf fitImage "$deploy_dir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}${KERNEL_FIT_BIN_EXT}"
-            if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then
-                ln -snf fitImage "$deploy_dir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}"
-            fi
+        ln -snf fitImage "$deploy_dir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}${KERNEL_FIT_BIN_EXT}"
+        if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then
+            ln -snf fitImage "$deploy_dir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}"
         fi
     fi
 }