Skip to content

Commit

Permalink
Fall back to default loader when encountering errors on network boot
Browse files Browse the repository at this point in the history
Only certain errors trigger fall back to the default loader name.  This
change allows fall back when encountering `EFI_TFTP_ERROR` and
`EFI_HTTP_ERROR`.

This fixes the issue reported in
#649 that prevents boot on some
models of PC.

Signed-off-by: Nathan O'Meara <Nathan.OMeara@tanium.com>
  • Loading branch information
nathan-omeara authored and vathpela committed Jan 21, 2025
1 parent 3caa75e commit 13bdd63
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions shim.c
Original file line number Diff line number Diff line change
Expand Up @@ -1222,10 +1222,15 @@ EFI_STATUS init_grub(EFI_HANDLE image_handle)
use_fb ? FALLBACK : second_stage);
}

// If the filename is invalid, or the file does not exist,
// just fallback to the default loader.
/*
* If the filename is invalid, or the file does not exist, just fall
* back to the default loader. Also fall back to the default loader
* if we get a TFTP error or HTTP error.
*/
if (!use_fb && (efi_status == EFI_INVALID_PARAMETER ||
efi_status == EFI_NOT_FOUND)) {
efi_status == EFI_NOT_FOUND ||
efi_status == EFI_HTTP_ERROR ||
efi_status == EFI_TFTP_ERROR)) {
console_print(
L"start_image() returned %r, falling back to default loader\n",
efi_status);
Expand Down

0 comments on commit 13bdd63

Please sign in to comment.