Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 916144 - sys-kernel/dracut: Can't find a uefi stub '/lib/systemd/boot/efi/linuxx64.efi.stub' to create a UEFI executable
Summary: sys-kernel/dracut: Can't find a uefi stub '/lib/systemd/boot/efi/linuxx64.efi...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Alexander Tsoy
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-23 01:28 UTC by avidseeker7
Modified: 2023-10-23 15:21 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description avidseeker7 2023-10-23 01:28:41 UTC
Related: https://bugs.gentoo.org/765208

Dracut version 059 is looking for systemd efi-related file in an OpenRC Gentoo system. I checked if the commit that was supposed to fix this issue is pushed to my system:

$ grep -r 'systemd_prefix=/usr'
sys-kernel/dracut/files/059-uefi-split-usr.patch:+[[ -n $systemd_prefix ]]
|| systemd_prefix=/usr


Here's the command that failed:

dracut: Executing: /usr/bin/dracut --uefi --kver=6.5.5-zen1
dracut: Can't find a uefi stub '/usr/lib/systemd/boot/efi/linuxx64.efi.stub' to create a UEFI executable

Reproducible: Always

Actual Results:  
.

Expected Results:  
.

.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-23 01:29:52 UTC
>$ grep -r 'systemd_prefix=/usr'
>sys-kernel/dracut/files/059-uefi-split-usr.patch:+[[ -n $systemd_prefix ]]
>|| systemd_prefix=/usr

Note that this part isn't proving much, just that the ebuild is on your system's copy of the ::gentoo repository. It doesn't mean you're using that version.

Please share emerge --info sys-kernel/dracut.
Comment 2 avidseeker7 2023-10-23 01:32:34 UTC
(In reply to Sam James from comment #1)
> >$ grep -r 'systemd_prefix=/usr'
> >sys-kernel/dracut/files/059-uefi-split-usr.patch:+[[ -n $systemd_prefix ]]
> >|| systemd_prefix=/usr
> 
> Note that this part isn't proving much, just that the ebuild is on your
> system's copy of the ::gentoo repository. It doesn't mean you're using that
> version.
> 
> Please share emerge --info sys-kernel/dracut.

=================================================================
                        Package Settings
=================================================================

sys-kernel/dracut-059-r4::gentoo was built with the following:
USE="(-selinux) (-test)" ABI_X86="(64)"
FEATURES="sandbox ebuild-locks collision-protect unmerge-orphans multilib-s
trict merge-sync sfperms sign strict binpkg-dostrip downgrade-backup fixlaf
iles config-protect-if-modified ipc-sandbox assume-digests binpkg-multi-ins
tance usersync buildpkg unmerge-logs pid-sandbox usersandbox qa-unresolved-
soname-deps network-sandbox preserve-libs xattr news binpkg-logs parallel-i
nstall buildpkg-live userpriv protect-owned unknown-features-warn pkgdir-in
dex-trusted parallel-fetch binpkg-docompress distlocks userfetch"
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-23 01:33:21 UTC
Thanks. Do you have sys-apps/systemd-utils[boot]?
Comment 4 avidseeker7 2023-10-23 01:45:06 UTC
(In reply to Sam James from comment #3)
> Thanks. Do you have sys-apps/systemd-utils[boot]?

=================================================================
                        Package Settings
=================================================================

sys-apps/systemd-utils-253.8::gentoo was built with the following:
USE="acl kmod (split-usr) tmpfiles udev -boot -secureboot (-selinux) -sysusers -test" ABI_X86="(64) -32 (-x32)"
FEATURES="multilib-strict preserve-libs binpkg-multi-instance downgrade-backup qa-unresolved-soname-deps unmerge-orphans binpkg-logs userpriv ebuild-locks sign distlocks fixlafiles merge-sync cgroup unmerge-logs binpkg-docompress pid-sandbox binpkg-dostrip collision-protect ipc-sandbox strict usersandbox parallel-fetch parallel-install userfetch config-protect-if-modified
usersync protect-owned buildpkg unknown-features-warn sandbox assume-digests xattr news network-sandbox sfperms buildpkg-live"
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-23 01:47:35 UTC
Please enable USE=boot on it and try Dracut again.
Comment 6 avidseeker7 2023-10-23 03:45:07 UTC
Now dracut generates UKI successfully, but booting from the resulting efi image returns an unresponsive screen with:

EFI stub: loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path.

I noticed that it dracut outputs many warnings of missing modules:

dracut: Executing: /usr/bin/dracut --kver=6.5.5-zen1
dracut: dracut module 'dash' will not be installed, because command 'dash' could not be found!
dracut: dracut module 'mksh' will not be installed, because command 'mksh' could not be found!
dracut: dracut module 'systemd' will not be installed, because command '/lib/systemd/systemd' could not be found!
dracut: dracut module 'systemd-ask-password' will not be installed, because command 'systemd-ask-password' could not be found!
...

---
Looks like I have to install them one by one as shown in the wiki: https://wiki.gentoo.org/wiki/Dracut#List_of_modules

Is there a Dracut alternative that doesn't depend on systemd? something like the Gentoo alternative of Arch's mkinitcpio.

I'm asking since OpenRC is supposed to be the default init system for Gentoo, and dracut is supposed to be the default initramfs generator for Gentoo. Yet both of them do not work together by default. This doesn't add up.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-23 03:56:48 UTC
(In reply to avidseeker7 from comment #6)
> Now dracut generates UKI successfully, but booting from the resulting efi
> image returns an unresponsive screen with:
> 
> EFI stub: loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path.
> 

Hanging at this point normally means some graphics drivers or EFI framebuffer stuff is misconfigured in the kernel.

> I noticed that it dracut outputs many warnings of missing modules:
> 
> dracut: Executing: /usr/bin/dracut --kver=6.5.5-zen1
> dracut: dracut module 'dash' will not be installed, because command 'dash'
> could not be found!
> dracut: dracut module 'mksh' will not be installed, because command 'mksh'
> could not be found!
> dracut: dracut module 'systemd' will not be installed, because command
> '/lib/systemd/systemd' could not be found!
> dracut: dracut module 'systemd-ask-password' will not be installed, because
> command 'systemd-ask-password' could not be found!
> ...
> 
> ---
> Looks like I have to install them one by one as shown in the wiki:
> https://wiki.gentoo.org/wiki/Dracut#List_of_modules

No, this is a misunderstanding because of dracut's poor UX. It lists every module which it couldn't use as an FYI even if it doesn't need them. It's telling you "I would've included this, but ...".

You only have to install the stuff for modules you want. Out of the box, it should work for most people already.

> 
> Is there a Dracut alternative that doesn't depend on systemd?

Dracut doesn't depend on systemd.

> [...] something like
> the Gentoo alternative of Arch's mkinitcpio.
> 

We also have genkernel. Someone is planning on packaging mkinitcpio for Gentoo as well.

> I'm asking since OpenRC is supposed to be the default init system for
> Gentoo, and dracut is supposed to be the default initramfs generator for
> Gentoo. Yet both of them do not work together by default. This doesn't add
> up.

"By default" -- keep in mind that UKIs are pretty new and the last Dracut release doesn't even work with them, we had to backport a bunch of stuff after Andrew fixed the bits upstream. UKIs are not built or used by default.

Dracut is also not the "default" initramfs generator for Gentoo (we don't have one). Nor is OpenRC our "default" init system. We just support both OpenRC and systemd, and people choose which to use.
Comment 8 avidseeker7 2023-10-23 14:35:30 UTC
>Dracut is also not the "default" initramfs generator...

I meant more specifically why is systemd-utils in @world of OpenRC without USE=boot? Wouldn't it make sense to turn this on by default?

Also, any idea about this?

>EFI stub: loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path.
Comment 9 Mike Gilbert gentoo-dev 2023-10-23 15:18:53 UTC
Reading through the comments, this report seems like a misunderstanding of dracut's output. I am therefore closing this as INVALID.
Comment 10 Mike Gilbert gentoo-dev 2023-10-23 15:21:15 UTC
(In reply to avidseeker7 from comment #8)
> I meant more specifically why is systemd-utils in @world of OpenRC without
> USE=boot? Wouldn't it make sense to turn this on by default?

There are several other EFI boot managers available in Gentoo. We don't enable/install any of them by default, instead leaving that decision to the system admin.