commit:     42eddd2bb0c152f2247810e74d2a643358b7ad66
Author:     Nowa Ammerlaan <nowa <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 25 08:14:53 2025 +0000
Commit:     Nowa Ammerlaan <nowa <AT> gentoo <DOT> org>
CommitDate: Fri Jul 25 08:21:16 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=42eddd2b

dist-kernel-utils.eclass: reinstall_initramfs() zboot support

If the config still exists, check it for CONFIG_EFI_ZBOOT, if it is
then the name of the kernel image will be different. We already
introduced the KERNEL_EFI_ZBOOT=1 variable to instruct the
dist-kernel_get_image_path() function to look for this different name.

We however forgot to add some logic to set it for the
reinstall_initramfs() path which is called via linux-mod-r1.eclass
by for example sys-fs/zfs-kmod[dist-kernel,initramfs]. This ebuild
has no information on whether the target kernel was built with ZBOOT
enabled or not. So we add now some logic to the eclass to check this.

Closes: https://bugs.gentoo.org/960603
Signed-off-by: Nowa Ammerlaan <nowa <AT> gentoo.org>

 eclass/dist-kernel-utils.eclass | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/eclass/dist-kernel-utils.eclass b/eclass/dist-kernel-utils.eclass
index 49977c18795a..975efd2d63c8 100644
--- a/eclass/dist-kernel-utils.eclass
+++ b/eclass/dist-kernel-utils.eclass
@@ -180,7 +180,14 @@ dist-kernel_reinstall_initramfs() {
        local kernel_dir=${1:-${KV_DIR}}
        local ver=${2:-${KV_FULL}}
 
+       # If this is set it will have an effect on the name of the output
+       # image. Set this variable to track this setting.
+       if grep -q "CONFIG_EFI_ZBOOT=y" "${kernel_dir}/.config"; then
+               KERNEL_EFI_ZBOOT=1
+       fi
+
        local image_path=${kernel_dir}/$(dist-kernel_get_image_path)
+
        if [[ ! -f ${image_path} ]]; then
                eerror "Kernel install missing, image not found:"
                eerror "  ${image_path}"

Reply via email to