Skip to content

Commit a6e02c0

Browse files
committed
Only specify --uefi-stub when EFI.Stub is configured
When `--uefi` is passed to dracut without a `--uefi-stub` argument, it looks first for a stub provided by systemd-boot and, if one isn't found, for a stub provided by gummiboot. The gummiboot location agrees with our default location at /usr/lib/gummiboot/linuxx64.efi.stub. By dropping the `--uefi-stub` unless the `generate-zbm` configuration explicitly specifies a value, `generate-zbm` should work out of the box on systems that use gummiboot as well as its successor, systemd-boot. If a user specifies a value in EFI.Stub, the `--uefi-stub` argument will be passed with the configured value. Fixes: #135. Closes: #138.
1 parent 893cbe9 commit a6e02c0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

bin/generate-zbm

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -648,13 +648,11 @@ sub createInitramfs {
648648

649649
# If $kernfile is provided, make a unified EFI image with the named kernel
650650
if ( defined $kernfile ) {
651-
my $efi_stub = $config{EFI}{Stub} || "/usr/lib/gummiboot/linuxx64.efi.stub";
652-
653-
unless ( -e $efi_stub ) {
654-
die "Missing EFI stub: $efi_stub";
651+
if ( nonempty $config{EFI}{Stub} ) {
652+
push( @cmd, ( qq(--uefi-stub), $config{EFI}{Stub} ) );
655653
}
656654

657-
push( @cmd, ( qw(--uefi --uefi-stub), $efi_stub, qq(--kernel-image), $kernfile ) );
655+
push( @cmd, ( qw(--uefi --kernel-image), $kernfile ) );
658656

659657
if ( nonempty $runConf{cmdline} ) {
660658
push( @cmd, qq(--kernel-cmdline=\"$runConf{cmdline}\") );

0 commit comments

Comments
 (0)