summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-03-01 10:19:06 +0100
committerMichał Górny <mgorny@gentoo.org>2021-03-01 10:40:49 +0100
commitf44731832a54b0eb0c179297446a971183470ae5 (patch)
tree7c167a997f24cabb12d5dd49a8fe4a2a55e284da /eclass/kernel-install.eclass
parentdev-python/aiorpcX: Remove old (diff)
downloadgentoo-f44731832a54b0eb0c179297446a971183470ae5.tar.gz
gentoo-f44731832a54b0eb0c179297446a971183470ae5.tar.bz2
gentoo-f44731832a54b0eb0c179297446a971183470ae5.zip
kernel-install.eclass: Fix initrd cleanup for uefi=yes
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/kernel-install.eclass')
-rw-r--r--eclass/kernel-install.eclass5
1 files changed, 2 insertions, 3 deletions
diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index 56d407605575..231dce2de6a4 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