Skip to content

Commit 13bdd63

Browse files
nathan-omearavathpela
authored andcommitted
Fall back to default loader when encountering errors on network boot
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 rhboot#649 that prevents boot on some models of PC. Signed-off-by: Nathan O'Meara <[email protected]>
1 parent 3caa75e commit 13bdd63

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

shim.c

+8-3
Original file line numberDiff line numberDiff line change
@@ -1222,10 +1222,15 @@ EFI_STATUS init_grub(EFI_HANDLE image_handle)
12221222
use_fb ? FALLBACK : second_stage);
12231223
}
12241224

1225-
// If the filename is invalid, or the file does not exist,
1226-
// just fallback to the default loader.
1225+
/*
1226+
* If the filename is invalid, or the file does not exist, just fall
1227+
* back to the default loader. Also fall back to the default loader
1228+
* if we get a TFTP error or HTTP error.
1229+
*/
12271230
if (!use_fb && (efi_status == EFI_INVALID_PARAMETER ||
1228-
efi_status == EFI_NOT_FOUND)) {
1231+
efi_status == EFI_NOT_FOUND ||
1232+
efi_status == EFI_HTTP_ERROR ||
1233+
efi_status == EFI_TFTP_ERROR)) {
12291234
console_print(
12301235
L"start_image() returned %r, falling back to default loader\n",
12311236
efi_status);

0 commit comments

Comments
 (0)