If I add to my dracut.conf: uefi=yes then dracut fails with: dracut: Can't find a uefi stub '/usr/lib/gummiboot/linuxx64.efi.stub' to create a UEFI executable However, according to the manpage it should just work™: --uefi-stub <FILE> Specifies the UEFI stub loader, which will load the attached kernel, initramfs and kernel command line and boots the kernel. The default is $prefix/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub or $prefix/lib/gummiboot/linux<EFI-MACHINE-TYPE-NAME>.efi.stub and /usr/lib/systemd/boot/efi/linuxx64.efi.stub does exist.
The relevant code in /usr/bin/dracut seems to be : if ! [[ -s $uefi_stub ]]; then for uefi_stub in \ $dracutsysrootdir"${systemdutildir}/boot/efi/linux${EFI_MACHINE_TYPE_NAME}.efi.stub" \ "$dracutsysrootdir/usr/lib/gummiboot/linux${EFI_MACHINE_TYPE_NAME}.efi.stub"; do [[ -s $uefi_stub ]] || continue break done fi where systemdutildir is: $ pkg-config systemd --variable=systemdutildir /lib/systemd
I am experiencing this as well, but on an openrc system. # dracut --uefi cat: /usr/lib/os-release: No such file or directory dracut: Executing: /usr/bin/dracut --uefi dracut: Can't find a uefi stub '/usr/lib/gummiboot/linuxx64.efi.stub' to create a UEFI executable # dracut --uefi --uefi-stub /usr/lib/systemd/boot/efi/linuxx64.efi.stub <...> dracut: *** Creating image file '/boot/EFI/Linux/linux-5.4.51-gentoo-x86_64-2bd880c4efdaa26032a95a625bcfa929.efi' *** dracut: Using UEFI kernel cmdline: ^C On my system, there is no systemd pkg-config file: # pkg-config systemd --variable=systemdutildir Package systemd was not found in the pkg-config search path. Perhaps you should add the directory containing `systemd.pc' to the PKG_CONFIG_PATH environment variable No package 'systemd' found Also, while investigating a related issue in ZFSBootMenu [1], a developer mentioned that dracut would try to look at [/usr]/lib/systemd/systemd-udevd to try to determine $systemdutildir. It turns out that I don't have that either: # ls /lib/systemd/systemd-udevd ls: cannot access '/lib/systemd/systemd-udevd': No such file or directory # ls /usr/lib/systemd/systemd-udevd ls: cannot access '/usr/lib/systemd/systemd-udevd': No such file or directory [1] https://github.com/zbm-dev/zfsbootmenu/issues/135#issuecomment-761728463
Created attachment 683770 [details, diff] Fix detection of UEFI stub on split-usr systems Here's a patch; please test it.
(In reply to Mike Gilbert from comment #3) > Created attachment 683770 [details, diff] [details, diff] > Fix detection of UEFI stub on split-usr systems > > Here's a patch; please test it. I can confirm that it works as expected.
The patch works for me as well (dracut-050-r2, /etc/portage/patches), thanks!
Created attachment 862671 [details, diff] Fix UEFI stub path Here's a new patch; please test. I will send this upstream if it works properly on a split-usr system.
The new patch does not apply to 057 nor 059, since set_global_var has only been added in 6f4a5c90ab993d2559720c2d4023d99ad43df00a, which has not been released, yet. That being said, the patch works nicely for dracut-9999. My testing environment: - booted official minimal install cd - chrooted into stage3-amd64-nomultilib-openrc - installed systemd-utils and gentoo-kernel - installed patched dracut - ran emerge --config gentoo-kernel I'll probably vary the test environment (using systemd) and test again in the near future.
(In reply to Sebastian Hamann from comment #7) Thanks! I'll send this upstream and work on a similar change for the released versions.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e8f8be11a5cb38c954d54615d0a31c0378bf88f5 commit e8f8be11a5cb38c954d54615d0a31c0378bf88f5 Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2023-05-26 20:02:07 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2023-05-26 20:02:07 +0000 sys-kernel/dracut: fix uefi stub path for split-usr Closes: https://bugs.gentoo.org/765208 Signed-off-by: Mike Gilbert <floppym@gentoo.org> .../{dracut-059.ebuild => dracut-059-r1.ebuild} | 1 + sys-kernel/dracut/files/059-uefi-split-usr.patch | 46 ++++++++++++++++++++++ 2 files changed, 47 insertions(+)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf4a09fa9787fab26223f3b5bb0619219f3ec6c9 commit bf4a09fa9787fab26223f3b5bb0619219f3ec6c9 Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2023-05-26 20:26:45 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2023-05-26 20:27:39 +0000 sys-kernel/dracut: add fallback in case systemd.pc is not installed Bug: https://bugs.gentoo.org/765208 Signed-off-by: Mike Gilbert <floppym@gentoo.org> .../dracut/{dracut-059-r1.ebuild => dracut-059-r2.ebuild} | 0 sys-kernel/dracut/files/059-uefi-split-usr.patch | 14 ++++++++------ 2 files changed, 8 insertions(+), 6 deletions(-)
The problem persists on dracut 059. I checked if the commit was pushed into 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 I'm using OpenRC on Gentoo.
Please file a ne wbug,
(In reply to Sam James from comment #12) > Please file a ne wbug, *a new bug
newb ug submitted here: https://bugs.gentoo.org/916144