summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-01-25 19:01:50 +0100
committerMichał Górny <mgorny@gentoo.org>2020-01-25 19:29:17 +0100
commit904b2a23c2aacdab32af335d9875aec391ee0268 (patch)
treea4c3d52aa6b260a32973b64a06bffca3dd3e01e9 /eclass/kernel-install.eclass
parentmedia-video/vdrtools-genindex: eapi 7; license, homepage fixed (diff)
downloadgentoo-904b2a23c2aacdab32af335d9875aec391ee0268.tar.gz
gentoo-904b2a23c2aacdab32af335d9875aec391ee0268.tar.bz2
gentoo-904b2a23c2aacdab32af335d9875aec391ee0268.zip
kernel-install.eclass: Remove initramfs in postrm
Closes: https://bugs.gentoo.org/706332 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/kernel-install.eclass')
-rw-r--r--eclass/kernel-install.eclass8
1 files changed, 7 insertions, 1 deletions
diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index 7e64f44c8c33..1fdeb1bf4dc7 100644
--- a/eclass/kernel-install.eclass
+++ b/eclass/kernel-install.eclass
@@ -302,7 +302,13 @@ kernel-install_pkg_prerm() {
kernel-install_pkg_postrm() {
debug-print-function ${FUNCNAME} "${@}"
- # (no-op at the moment)
+ if [[ -z ${ROOT} ]] && use initramfs; then
+ local image_path=$(kernel-install_get_image_path)
+ ebegin "Removing initramfs"
+ rm -f "${EROOT}/usr/src/linux-${PV}/${image_path%/*}/initrd" &&
+ find "${EROOT}/usr/src/linux-${PV}" -depth -type d -empty -delete
+ eend ${?}
+ fi
}
_KERNEL_INSTALL_ECLASS=1