Open ubergeek77 opened 1 year ago
Ah, this is an oversight because people usually do not pass --efi-stub
at all I assume. Thanks for looking into it :)
I got this error message to on Gentoo
args
sbctl bundle -s -i /lib/firmware/amd-ucode/microcode_amd_fam17h.bin \ -k /boot/vmlinuz-6.3.9-gentoo-dist \
-f /boot/initramfs-6.3.9-gentoo-dist.img \
-e /usr/lib/systemd/boot/efi/linuxx64.efi.stub \
-c /etc/kernel/cmdline /efi/gentoo.efi
no EFISTUB file found. Please install systemd-boot or gummiboot! no EFI stub found
I have installed systemd-boot with gnuefi use flag and I also checked that this file exists in my system
I am trying to use
sbctl
to create a bundle using my own EFI stub loader provided by the stubby project.It's not exactly a standardized location, but I have my loader saved to:
Here is the stbctl command I tried to use:
This results in the following error:
Interestingly, if I purposely give
-e
/--efi-stub
a path to a file that doesn't exist, it will fail with this error first:So it does check the path of
--efi-stub
, but then it never gets used again.From reading the code, here's what I think happens:
sbctl
reads the path provided by-e
and makes sure it existssbctl
callsNewBundle
to initialize a new bundle objectNewBundle
function unconditionally callsGetEfistub
, and does not consider user-provided value of--efi-stub
GetEfiStub
goes through it's regular process of checking the standard candidate paths, which fails in this case, since my system does not have either.I do not have a Go environment set up, so unfortunately I don't think I'll make a PR for this. However, I can provide my two cents on a potential fix:
Since
sbctl
is overriding the result of NewBundle anyway, it might be a good idea to pass those variables intoNewBundle
, so that NewBundle can just return them alongside any defaults it needs to detect.