<feed xmlns='http://www.w3.org/2005/Atom'>
<title>staging/pepe2k/include/kernel-defaults.mk, branch v24.10.1</title>
<subtitle>Staging tree of Piotr Dymacz</subtitle>
<id>https://git.openwrt.org/openwrt/staging/pepe2k/atom?h=v24.10.1</id>
<link rel='self' href='https://git.openwrt.org/openwrt/staging/pepe2k/atom?h=v24.10.1'/>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/'/>
<updated>2025-01-20T16:22:53Z</updated>
<entry>
<title>kernel: fix rootfs initramfs not updating on subsequent single build</title>
<updated>2025-01-20T16:22:53Z</updated>
<author>
<name>Christian Marangi</name>
</author>
<published>2025-01-20T16:14:47Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=96ff9c3353b70f2b025a6fedb32bd99e458cff05'/>
<id>urn:sha1:96ff9c3353b70f2b025a6fedb32bd99e458cff05</id>
<content type='text'>
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 &lt;ansuelsmth@gmail.com&gt;
(cherry picked from commit 334c649a8d9b191c0282f9104b3997b090628f56)
</content>
</entry>
<entry>
<title>kernel: rework Initramfs compile cpio handling</title>
<updated>2024-09-18T23:07:25Z</updated>
<author>
<name>Christian Marangi</name>
</author>
<published>2024-09-18T23:01:27Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=bfb2e099e41172d4cf8884a97058ff6d495b9976'/>
<id>urn:sha1:bfb2e099e41172d4cf8884a97058ff6d495b9976</id>
<content type='text'>
Now that we copy and then delete the Per-Device rootfs linux directory,
it's not valid anymore placing the generated cpio there as artifacts
or subsequent commands need the generated cpio.

To handle this, rework Initramfs compile cpio handling by placing them in
the KERNEL_BUILD_DIR but add to the name the rootfs HASH ID.

To also prevent race condition, generate and access these file under a
lock to prevent fit command to reference a cpio while a parallel
execution is genereting it.

Fixes: 52cc9d82f113 ("kernel: rework Initramfs locking logic")
Signed-off-by: Christian Marangi &lt;ansuelsmth@gmail.com&gt;
</content>
</entry>
<entry>
<title>kernel: fix flock name for gen-initramfs lock</title>
<updated>2024-09-18T23:07:20Z</updated>
<author>
<name>Christian Marangi</name>
</author>
<published>2024-09-18T22:58:44Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=98a62f7c8c099de724318cdbdd74a1df659df619'/>
<id>urn:sha1:98a62f7c8c099de724318cdbdd74a1df659df619</id>
<content type='text'>
Fix flock name for gen-initramfs lock as $(2) starts with .HASH making
the lock name gen-initramfs-.HASH.flock

Fix this to a better name of gen-initramfs.HASH.flock

Fixes: 52cc9d82f113 ("kernel: rework Initramfs locking logic")
Signed-off-by: Christian Marangi &lt;ansuelsmth@gmail.com&gt;
</content>
</entry>
<entry>
<title>kernel: fix wrong rework for Initramfs cpio xz compression</title>
<updated>2024-09-18T22:56:32Z</updated>
<author>
<name>Christian Marangi</name>
</author>
<published>2024-09-18T22:56:32Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=15de20d286055221c5b7a4113066e80c4279af6a'/>
<id>urn:sha1:15de20d286055221c5b7a4113066e80c4279af6a</id>
<content type='text'>
Fix wrong rework for Initramfs cpio xz compression where it was wrongly
dropped the Per-Device linux directory if condition.

Fixes: 52cc9d82f113 ("kernel: rework Initramfs locking logic")
Signed-off-by: Christian Marangi &lt;ansuelsmth@gmail.com&gt;
</content>
</entry>
<entry>
<title>kernel: copy kernel build dir on Per-Device Initramfs compilation</title>
<updated>2024-09-17T10:12:38Z</updated>
<author>
<name>Christian Marangi</name>
</author>
<published>2024-09-16T16:38:16Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=d78dec3e19e3f2ab0f14ba6819357d50156b30b8'/>
<id>urn:sha1:d78dec3e19e3f2ab0f14ba6819357d50156b30b8</id>
<content type='text'>
To speedup compilation of Per-Device Initramfs, copy the kernel build
directory for each rootfs ID.

This permits concurrent execution of kernel build without conflicting
with each other at the expense of additional disk space usage.

To limit disk space usage, the copied kernel directory is deleted after
the Per-Device Initramfs image is generated and saved.

Link: https://github.com/openwrt/openwrt/pull/16404
Signed-off-by: Christian Marangi &lt;ansuelsmth@gmail.com&gt;
</content>
</entry>
<entry>
<title>kernel: rework Initramfs locking logic</title>
<updated>2024-09-17T10:12:38Z</updated>
<author>
<name>Christian Marangi</name>
</author>
<published>2024-09-16T16:34:09Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=52cc9d82f1138e28dcf590fbe60c8a69635abcea'/>
<id>urn:sha1:52cc9d82f1138e28dcf590fbe60c8a69635abcea</id>
<content type='text'>
Rework CompileImage/Initramfs locking logic to fix race condition on
concurrent access/compilation.

Rework each intermediate step and group them under one single execution
block. Protect this with a new lock, 'gen-initramfs' and rename the
compile initramfs to compile-initramfs lock name.

This is done to handle corner case scenario where a rootfs with the same
hash ID is generated at the same time. To handle this, we execute
everything under lock and use a specific hash ID lock to prevent
concurrent access/compilation.

Link: https://github.com/openwrt/openwrt/pull/16404
Signed-off-by: Christian Marangi &lt;ansuelsmth@gmail.com&gt;
</content>
</entry>
<entry>
<title>kernel: fix broken initramfs images for Separate cpio</title>
<updated>2024-07-09T06:43:16Z</updated>
<author>
<name>Christian Marangi</name>
</author>
<published>2024-07-09T02:27:11Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=3c95641366f78e34bbf147da5840d7d3217ac4e1'/>
<id>urn:sha1:3c95641366f78e34bbf147da5840d7d3217ac4e1</id>
<content type='text'>
Commit 0137fbd74bff ("kernel: skip rebuilding kernel with
ROOTFS_INITRAMFS_SEPARATE") had a logic error error and didn't account
that the generic initramfs is still needed to be built to enable support
for the cpio compression and other config specific to initramfs. With
that commit we completely skip rebuilding the kernel with those new
options.

To better handle this, skip kernel build ONLY when we are handling Per
Device Rootfs, permitting the first generic build to be actually called
with the new options.

Fixes: 0137fbd74bff ("kernel: skip rebuilding kernel with ROOTFS_INITRAMFS_SEPARATE")
Link: https://github.com/openwrt/openwrt/pull/15912
Signed-off-by: Christian Marangi &lt;ansuelsmth@gmail.com&gt;
</content>
</entry>
<entry>
<title>kernel: aldo fix CopyImage for Separate Initramfs</title>
<updated>2024-07-08T11:23:26Z</updated>
<author>
<name>Christian Marangi</name>
</author>
<published>2024-07-07T17:28:35Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=0122fd7929d0971e2286518b2da3d307b677c683'/>
<id>urn:sha1:0122fd7929d0971e2286518b2da3d307b677c683</id>
<content type='text'>
Also fix CopyImage for Separate Initramfs with Per Device Rootfs.

Fixes: 7bffb3f72bbf ("kernel: fix CopyImage function with Per Device Rootfs")
Signed-off-by: Christian Marangi &lt;ansuelsmth@gmail.com&gt;
</content>
</entry>
<entry>
<title>kernel: fix CopyImage function with Per Device Rootfs</title>
<updated>2024-07-07T16:24:24Z</updated>
<author>
<name>Christian Marangi</name>
</author>
<published>2024-07-07T16:24:24Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=7bffb3f72bbfa06db5c61351f074533ac2d035a4'/>
<id>urn:sha1:7bffb3f72bbfa06db5c61351f074533ac2d035a4</id>
<content type='text'>
Some target define custom kernel images with KERNEL_INITRAMFS_NAME to
reference .elf variant of vmlinux.

With Per Device Rootfs, the expected format is
image.suffix.extension.ROOTFS_ID, while in CopyImage we are currently
generating images with image.suffix.ROOTFS_ID.extension making some
target failing.

Fix CopyImage function to correctly follow the expected pattern.

Fixes: 97fd059e7e6a ("image: respect TARGET_PER_DEVICE_ROOTFS for initramfs")
Signed-off-by: Christian Marangi &lt;ansuelsmth@gmail.com&gt;
</content>
</entry>
<entry>
<title>kernel: skip rebuilding kernel with ROOTFS_INITRAMFS_SEPARATE</title>
<updated>2024-07-06T14:20:07Z</updated>
<author>
<name>Christian Marangi</name>
</author>
<published>2024-07-06T11:40:40Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=0137fbd74bff2ca3273da3725eb27d2262e3973d'/>
<id>urn:sha1:0137fbd74bff2ca3273da3725eb27d2262e3973d</id>
<content type='text'>
With PER_DEVICE_ROOTFS, rebuilding kernel is needed to embed the cpio
image in the kernel image. With ROOTFS_INITRAMFS_SEPARATE, the cpio
image is external hence we can reuse the same kernel image without
rebuilding it.

Link: https://github.com/openwrt/openwrt/pull/12959
Signed-off-by: Christian Marangi &lt;ansuelsmth@gmail.com&gt;
</content>
</entry>
</feed>
