summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan O'Meara <Nathan.OMeara@tanium.com>2024-06-20 12:20:22 -0400
committerPeter Jones <pjones@redhat.com>2025-01-21 11:27:34 -0500
commit98173f05b67e9de1e4ea4291b26d982b62fe56aa (patch)
tree18a5aaa979e6beb70040e6f45daebb1977dc0325
parentf99749a9a6b5a9f987fbf5fdf1b084c1db97711a (diff)
downloadefi-boot-shim-98173f05b67e9de1e4ea4291b26d982b62fe56aa.tar.gz
efi-boot-shim-98173f05b67e9de1e4ea4291b26d982b62fe56aa.zip
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 https://github.com/rhboot/shim/issues/649 that prevents boot on some models of PC. Signed-off-by: Nathan O'Meara <Nathan.OMeara@tanium.com>
-rw-r--r--shim.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/shim.c b/shim.c
index d387a01d..68456656 100644
--- a/shim.c
+++ b/shim.c
@@ -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);