From 4a0f408ed58c36002ded30e0b0b702ecf5d147e4 Mon Sep 17 00:00:00 2001 From: Nowa Ammerlaan Date: Sun, 2 Mar 2025 09:58:22 +0100 Subject: [PATCH] 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 --- eclass/kernel-install.eclass | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass index cf34007844a80..67143278f3680 100644 --- a/eclass/kernel-install.eclass +++ b/eclass/kernel-install.eclass @@ -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