From dc9ea91c8271f43fb58ce142000dcd5c32822c42 Mon Sep 17 00:00:00 2001 From: Andrew Ammerlaan Date: Fri, 16 Jun 2023 22:51:00 +0200 Subject: [PATCH] dist-kernel-utils.eclass: skip initrd installation when using uki Gets rid of a hack that prevents 50-dracut.install from regenerating the initrd when calling kernel-install. Instead instruct kernel-install to simply not run this plugin. Signed-off-by: Andrew Ammerlaan Closes: https://github.com/gentoo/gentoo/pull/31358 Signed-off-by: Andrew Ammerlaan --- eclass/dist-kernel-utils.eclass | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/eclass/dist-kernel-utils.eclass b/eclass/dist-kernel-utils.eclass index c6892c2f01278..cfb6f40ac6fae 100644 --- a/eclass/dist-kernel-utils.eclass +++ b/eclass/dist-kernel-utils.eclass @@ -106,10 +106,20 @@ dist-kernel_install_kernel() { # install the combined executable in place of kernel image=${initrd}.efi mv "${initrd}" "${image}" || die - # put an empty file in place of initrd. installing a duplicate - # file would waste disk space, and removing it entirely provokes - # kernel-install to regenerate it via dracut. - > "${initrd}" + # We moved the generated initrd, prevent dracut from running again + # https://github.com/dracutdevs/dracut/pull/2405 + shopt -s nullglob + local plugins=() + for file in "${EROOT}"/usr/lib/kernel/install.d/*.install; do + if ! has "${file##*/}" 50-dracut.install 51-dracut-rescue.install; then + plugins+=( "${file}" ) + fi + done + for file in "${EROOT}"/etc/kernel/install.d/*.install; do + plugins+=( "${file}" ) + done + shopt -u nullglob + export KERNEL_INSTALL_PLUGINS="${KERNEL_INSTALL_PLUGINS} ${plugins[@]}" fi ebegin "Installing the kernel via installkernel"