Bug 12283

Summary: Building a fitImage including INITRAMFS_IMAGE (wo/ BUNDLE) cause the kernel to depend on rootfs which is bad
Product: [Yocto Project Subprojects] Kernel Reporter: Yannick Koehler <yannick.koehler>
Component: kernel-toolingAssignee: Unassigned <unassigned>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: adrian.freihofer, adrian.freihofer, otavio, ptsneves, randy.macleod, richard.purdie, tgamblin, yp.kernel.watcher, yp.watcher
Version: 2.0.3   
Target Milestone: Future   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

Description Yannick Koehler 2017-10-27 14:35:29 UTC
Building a fitImage that include an initramfs force the kernel to depends on
rootfs.  This in turn cause rebuilding anything on any change.

For example, if the image is not included, building an out-of-tree kernel module
require pretty much just building the kernel + the module.  Yet, when you 
enable fitImage, building the same out-of-tree kernel module force re-building 
all the user space application as well.

Also, the image creation, fit or wic should not be kernel specific.  The code
found in kernel-fitimage.bbclass create an ITS file and then call uboot-mkimage.
There is nothing there that is kernel specific.

This code should be done within the image recipe, once the kernel uImage and the rootfs has been built, as is other image type.

Now I understand that if INITRAMFS_IMAGE_BUNDLE is set to 1 that the kernel need to be involved, but when INITRAMFS_IMAGE_BUNDLE is set to 0, there are no valid reason to have the kernel create the image itself instead of the image recipe creating the image and removing that kernel/rootfs dependency.
Comment 1 Randy MacLeod 2022-05-12 15:26:57 UTC
We need someone to write some tests for the fitImage.
Comment 2 Paulo Neves 2022-05-27 11:06:57 UTC
There are multiple things mentioned in this bug report and it is hard to understand exactly what is wrong. Can you break down the single most important thing you want fixed, in a simple way?

@Randy we have quite a comprehensive self test at meta/lib/oeqa/selftest/cases/fitimage.py. Would this help?
Comment 3 Adrian 2024-12-11 22:29:48 UTC
This could probably be considered a duplicate of https://bugzilla.yoctoproject.org/show_bug.cgi?id=12912.

The “wrong architecture” of kernel-fitimage.bbclass and the flexibility to create both bundled and unbundled kernel images in combination with fitImages create the complexity and ultimately the problems.
Comment 4 Adrian Freihofer 2025-06-18 17:26:57 UTC
Let's assume this is fixed now. The FIT image related code has been completely rewritten. Also, the architecture is now different. See also https://bugzilla.yoctoproject.org/show_bug.cgi?id=12912.

If this is not the case, feel free to reopen this bug.