kernel: fix rootfs initramfs not updating on subsequent single build
authorChristian Marangi <ansuelsmth@gmail.com>
Mon, 20 Jan 2025 16:14:47 +0000 (17:14 +0100)
committerChristian Marangi <ansuelsmth@gmail.com>
Mon, 20 Jan 2025 16:22:53 +0000 (17:22 +0100)
commit96ff9c3353b70f2b025a6fedb32bd99e458cff05
tree863303f32ecf649d1f1e6dcfb2bf12623f8fa691
parenta252c56b4b0e452930cce99a8769616755ab630d
kernel: fix rootfs initramfs not updating on subsequent single build

There is currently a problem where the rootfs in an initramfs image for
single target build is not updated on subsequent run. This is caused by
a bug introduced in d78dec3e19e3 ("kernel: copy kernel build dir on
Per-Device Initramfs compilation") where the initramfs_data.cpio rm was
moved to PrepareConfigPerRootfs. This caused the side effect of dropping
the rm call for single target build making the kernel reusing the
previous generated initramfs_data.cpio.

To correctly handle this, restore the original location of this call
right after the touch /init call. This way the kernel will always
regenerate the initramfs embedded rootfs ALSO for single target build.

Fixes: d78dec3e19e3 ("kernel: copy kernel build dir on Per-Device Initramfs compilation")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 334c649a8d9b191c0282f9104b3997b090628f56)
include/kernel-defaults.mk