Skip to contentSkip to conversation

Preventing kernel from recompiling when bundling into initramfs

DISCUSSION Ernast 2 participants 2 messages Oct 1, 2024

lore
Share & tools
lore

Ernast

author
#0 lore raw

Hello,

I have been looking into improving the build time of my yocto build and following some of the recommendations regarding debugging long build times, I have traced the issue back to dynamic data in my rootfs which causes misses in the sstate cache. I believe the dynamic data causes the following rebuild chain: do_rootfs -> kernel do_compile -> do_bundle_initramfs.

I understand why do_rootfs/do_bundle_initramfs must be rerun but in this particular case there shouldn't be a need to recompile the kernel. As far as I can tell, this is only happening because the final initramfs (which needs rebuilt) and the bzImage are part of the same sstate artifact (which is invalidated as a result of the dynamic data in the rootfs). I'm wondering if there is an opportunity to improve this and keep the kernel from recompiling each time only the rootfs changes.

Unfortunately the dynamic data in the rootfs is a hard requirement for me and cannot be removed.

Thanks,

Ernast

#1 lore raw

Hi Ernast

A few weeks ago I sent a patch series that tries to solve this problem. But refactoring the kernel and especially the kernel-fitimage and u-boot classes is not easy. My patches solve the problem with rebuilding, but they are really hard to review, so they were rejected here:
https://lists.openembedded.org/g/openembedded-core/topic/107982760#msg203695
.

The next idea is to split fitImage into separate recipes, hoping that this will simplify the situation and allow us to better utilize the sstate-cache. So far I have not tackled this yet.
Thanks for bringing this up.

Regards,
Adrian

Am Di., 1. Okt. 2024 um 15:29 Uhr schrieb Ernast via lists.yoctoproject.org <[email protected]>:

Quoted 34 lines

Hello,

I have been looking into improving the build time of my yocto build and
following some of the recommendations regarding debugging long build times, I have traced the issue back to dynamic data in my rootfs which causes misses in the sstate cache. I believe the dynamic data causes the following rebuild chain: do_rootfs -> kernel do_compile -> do_bundle_initramfs.

I understand why do_rootfs/do_bundle_initramfs must be rerun but in this particular case there shouldn't be a need to recompile the kernel. As far as I can tell, this is only happening because the final initramfs (which needs rebuilt) and the bzImage are part of the same sstate artifact (which is invalidated as a result of the dynamic data in the rootfs). I'm wondering if there is an opportunity to improve this and keep the kernel from recompiling each time only the rootfs changes.

Unfortunately the dynamic data in the rootfs is a hard requirement for me and cannot be removed.

Thanks,

Ernast

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#63920):
https://lists.yoctoproject.org/g/yocto/message/63920
Mute This Topic: https://lists.yoctoproject.org/mt/108758712/4454582
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-