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 <andrewammerlaan@gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/31358
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
This commit is contained in:
Andrew Ammerlaan
2023-06-20 20:57:37 +02:00
parent 200888d283
commit dc9ea91c82
+14 -4
View File
@@ -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"