Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Sat, 25 Jan 2020 18:29:29
Message-Id: 1579976957.904b2a23c2aacdab32af335d9875aec391ee0268.mgorny@gentoo
1 commit: 904b2a23c2aacdab32af335d9875aec391ee0268
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 25 18:01:50 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 25 18:29:17 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=904b2a23
7
8 kernel-install.eclass: Remove initramfs in postrm
9
10 Closes: https://bugs.gentoo.org/706332
11 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
12
13 eclass/kernel-install.eclass | 8 +++++++-
14 1 file changed, 7 insertions(+), 1 deletion(-)
15
16 diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
17 index 7e64f44c8c3..1fdeb1bf4dc 100644
18 --- a/eclass/kernel-install.eclass
19 +++ b/eclass/kernel-install.eclass
20 @@ -302,7 +302,13 @@ kernel-install_pkg_prerm() {
21 kernel-install_pkg_postrm() {
22 debug-print-function ${FUNCNAME} "${@}"
23
24 - # (no-op at the moment)
25 + if [[ -z ${ROOT} ]] && use initramfs; then
26 + local image_path=$(kernel-install_get_image_path)
27 + ebegin "Removing initramfs"
28 + rm -f "${EROOT}/usr/src/linux-${PV}/${image_path%/*}/initrd" &&
29 + find "${EROOT}/usr/src/linux-${PV}" -depth -type d -empty -delete
30 + eend ${?}
31 + fi
32 }
33
34 _KERNEL_INSTALL_ECLASS=1