From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id CDADE158009 for ; Sat, 17 Jun 2023 18:21:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DE012E08FA; Sat, 17 Jun 2023 18:21:51 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A7496E089B for ; Sat, 17 Jun 2023 18:21:51 +0000 (UTC) Message-ID: <5c62b67f-077d-1be3-655e-a72e56a60332@gentoo.org> Date: Sat, 17 Jun 2023 20:21:48 +0200 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [gentoo-dev] [PATCH 2/2] dist-kernel-utils.eclass: skip initrd installation when using the uki layout Content-Language: en-US, nl-NL To: gentoo-dev@lists.gentoo.org References: From: Andrew Ammerlaan Organization: Gentoo Linux In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Archives-Salt: 8d9cde6b-617a-431e-aafc-83b314c46402 X-Archives-Hash: 0539a400481c555a3e714994da7e594e This replaces a workaround with a better one. Instead of tricking 50-dracut.install with an empty inird file we instruct kernel-install to simply skip this plugin. This way we don't end up with a bunch of confusing empty initrd files in /boot. End result is the same. I've got an upstream PR open to fix the underlying issue (i.e make 50-dracut.install work properly with uefi=yes and layout=uki): https://github.com/dracutdevs/dracut/pull/2405 From c2d6ecb074d25c70677fa9c371801a0002c9a216 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 --- eclass/dist-kernel-utils.eclass | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/eclass/dist-kernel-utils.eclass b/eclass/dist-kernel-utils.eclass index c6892c2f01278..e371e035c8565 100644 --- a/eclass/dist-kernel-utils.eclass +++ b/eclass/dist-kernel-utils.eclass @@ -106,10 +106,21 @@ 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 + local plugins=() + for file in "${EROOT}"/usr/lib/kernel/install.d/*; do + if [[ ${file} != */50-dracut.install && \ + ${file} != */51-dracut-rescue.install && \ + ${file} == *.install ]]; then + plugins+=( "${file}" ) + fi + done + for file in "${EROOT}"/etc/kernel/install.d/*; do + if [[ ${file} == *.install ]]; then + plugins+=( "${file}" ) + fi + done + export KERNEL_INSTALL_PLUGINS="${KERNEL_INSTALL_PLUGINS} ${plugins[@]}" fi ebegin "Installing the kernel via installkernel"