commit: f44731832a54b0eb0c179297446a971183470ae5
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 1 09:19:06 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Mar 1 09:40:49 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f4473183
kernel-install.eclass: Fix initrd cleanup for uefi=yes
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/kernel-install.eclass | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index 56d40760557..231dce2de6a 100644
--- a/eclass/kernel-install.eclass
+++ b/eclass/kernel-install.eclass
@@ -414,8 +414,7 @@ kernel-install_pkg_prerm() {
# @FUNCTION: kernel-install_pkg_postrm
# @DESCRIPTION:
-# No-op at the moment. Will be used to remove obsolete kernels
-# in the future.
+# Clean up the generated initramfs from the removed kernel directory.
kernel-install_pkg_postrm() {
debug-print-function ${FUNCNAME} "${@}"
@@ -423,7 +422,7 @@ kernel-install_pkg_postrm() {
local ver="${PV}${KV_LOCALVERSION}"
local image_path=$(dist-kernel_get_image_path)
ebegin "Removing initramfs"
- rm -f "${EROOT}/usr/src/linux-${ver}/${image_path%/*}/initrd" &&
+ rm -f
"${EROOT}/usr/src/linux-${ver}/${image_path%/*}"/initrd{,.uefi} &&
find "${EROOT}/usr/src/linux-${ver}" -depth -type d
-empty -delete
eend ${?}
fi