summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Ammerlaan <andrewammerlaan@gentoo.org>2023-06-16 22:51:00 +0200
committerAndrew Ammerlaan <andrewammerlaan@gentoo.org>2023-06-20 20:57:37 +0200
commitdc9ea91c8271f43fb58ce142000dcd5c32822c42 (patch)
tree74115636b454907b9030408acd70169b3ef9e221 /eclass/dist-kernel-utils.eclass
parentdist-kernel-utils.eclass: fix extension of generated efi file (diff)
downloadgentoo-dc9ea91c8271f43fb58ce142000dcd5c32822c42.tar.gz
gentoo-dc9ea91c8271f43fb58ce142000dcd5c32822c42.tar.bz2
gentoo-dc9ea91c8271f43fb58ce142000dcd5c32822c42.zip
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>
Diffstat (limited to 'eclass/dist-kernel-utils.eclass')
-rw-r--r--eclass/dist-kernel-utils.eclass18
1 files changed, 14 insertions, 4 deletions
diff --git a/eclass/dist-kernel-utils.eclass b/eclass/dist-kernel-utils.eclass
index c6892c2f0127..cfb6f40ac6fa 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"