Skip to content

Commit

Permalink
UEFI: improve stub handling
Browse files Browse the repository at this point in the history
* Note the package requirement for Debian
* Improve error handling and messages in generate-zbm

Closes #394
  • Loading branch information
zdykstra committed Jan 5, 2023
1 parent ed203e6 commit d73fad8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
15 changes: 11 additions & 4 deletions bin/generate-zbm
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,10 @@ sub createUEFIBundle {

if ( nonempty $config{EFI}{Stub} ) {
$uefi_stub = $config{EFI}{Stub};
unless ( -f $uefi_stub ) {
print "UEFI stub loader '$uefi_stub' does not exist\n";
exit 1;
}
} else {
# For now, default stub locations are x86_64 only
my @uefi_stub_defaults = qw(
Expand All @@ -727,11 +731,14 @@ sub createUEFIBundle {
last;
}
}
}

unless ( defined $uefi_stub and -f $uefi_stub ) {
print "Cannot find kernel or initramfs to create UEFI bundle\n";
exit 1;
unless ( defined $uefi_stub and -f $uefi_stub ) {
print "Unable to find UEFI stub loader at default locations:\n";
foreach my $stubloc (@uefi_stub_defaults) {
print " $stubloc\n";
}
exit 1;
}
}

my @cmd = qw(objcopy);
Expand Down
1 change: 1 addition & 0 deletions docs/guides/debian/_include/zbm-install-deps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Install all packages required to build a ZFSBootMenu image on Debian:
kexec-tools \
dracut-core \
efibootmgr \
systemd-boot-efi \
bsdextrautils
.. note::
Expand Down

0 comments on commit d73fad8

Please sign in to comment.