summaryrefslogtreecommitdiff
path: root/eclass/kernel-install.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-03-03 10:28:17 +0000
committerV3n3RiX <venerix@redcorelinux.org>2021-03-03 10:28:17 +0000
commitd99093fb4bb5652015c06274d64083daa2439e4f (patch)
treecf61513204d97974179580065e85df5c8009087c /eclass/kernel-install.eclass
parent463397cf1e064185110fe57c568d73f99a06f5d1 (diff)
gentoo resync : 03.03.2021
Diffstat (limited to 'eclass/kernel-install.eclass')
-rw-r--r--eclass/kernel-install.eclass21
1 files changed, 16 insertions, 5 deletions
diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index b8109f47d0bf..231dce2de6a4 100644
--- a/eclass/kernel-install.eclass
+++ b/eclass/kernel-install.eclass
@@ -58,6 +58,12 @@ RDEPEND="
sys-kernel/installkernel-systemd-boot
)
initramfs? ( >=sys-kernel/dracut-049-r3 )"
+# needed by objtool that is installed along with the kernel and used
+# to build external modules
+# NB: linux-mod.eclass also adds this dep but it's cleaner to have
+# it here, and resolves QA warnings: https://bugs.gentoo.org/732210
+RDEPEND+="
+ virtual/libelf"
BDEPEND="
test? (
dev-tcltk/expect
@@ -211,9 +217,15 @@ kernel-install_test() {
local qemu_arch=$(kernel-install_get_qemu_arch)
+ # NB: if you pass a path that does not exist or is not a regular
+ # file/directory, dracut will silently ignore it and use the default
+ # https://github.com/dracutdevs/dracut/issues/1136
+ > "${T}"/empty-file || die
+ mkdir -p "${T}"/empty-directory || die
+
dracut \
- --conf /dev/null \
- --confdir /dev/null \
+ --conf "${T}"/empty-file \
+ --confdir "${T}"/empty-directory \
--no-hostonly \
--kmoddir "${modules}" \
"${T}/initrd" "${version}" || die
@@ -402,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} "${@}"
@@ -411,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