kernel-install.eclass: cleanup dead symlinks after removal

Since we remove /usr/src/linux-KV_FULL but by design keep the
/lib/modules/KV_FULL, we end up with some dead symlinks after
depcleaning a dist-kernel. This has the unfortunate side effect of
tricking systemd's kernel-install into thinking that a kernel image
for this kernel still exists. Which leads to some ugliness further
down the line. We can easily resolve the problem by cleaning up these
dead symlinks.

Signed-off-by: Nowa Ammerlaan <nowa@gentoo.org>
This commit is contained in:
Nowa Ammerlaan
2025-03-02 09:58:22 +01:00
parent bb7b3f56b8
commit 4a0f408ed5

View File

@@ -808,6 +808,9 @@ kernel-install_pkg_postrm() {
find "${kernel_dir}" -depth -type d -empty -delete
eend ${?}
fi
# Clean up dead symlinks
find -L "${EROOT}/lib/modules/${KV_FULL}" -type l -delete
}
# @FUNCTION: kernel-install_pkg_config