kernel: rework Initramfs locking logic
authorChristian Marangi <ansuelsmth@gmail.com>
Mon, 16 Sep 2024 16:34:09 +0000 (18:34 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Tue, 17 Sep 2024 10:12:38 +0000 (12:12 +0200)
commit52cc9d82f1138e28dcf590fbe60c8a69635abcea
tree90f2d7d8f1594ac02dcc698d4d06b87e59a45b5f
parent802be2457f41cebcf8a48b90d26d609009328294
kernel: rework Initramfs locking logic

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 <ansuelsmth@gmail.com>
include/kernel-defaults.mk