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!