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@gentoo.org>
This commit is contained in:
Nowa Ammerlaan 2025-07-25 10:14:53 +02:00
parent e6212f917f
commit 42eddd2bb0
No known key found for this signature in database
GPG Key ID: A2E2304370447E8E

View File

@ -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}"