Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fallback: Add build flag to always try to chain-load the new boot entry #445

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ ifneq ($(origin FALLBACK_NONINTERACTIVE), undefined)
CFLAGS += -DFALLBACK_NONINTERACTIVE
endif

ifneq ($(origin FALLBACK_NEVER_REBOOT), undefined)
CFLAGS += -DFALLBACK_NEVER_REBOOT
endif

ifneq ($(origin FALLBACK_VERBOSE_WAIT), undefined)
CFLAGS += -DFALLBACK_VERBOSE_WAIT=$(FALLBACK_VERBOSE_WAIT)
endif
Expand Down
12 changes: 11 additions & 1 deletion fallback.c
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,9 @@ try_start_first_option(EFI_HANDLE parent_image_handle)
static UINT32
get_fallback_no_reboot(void)
{
#ifdef FALLBACK_NEVER_REBOOT
return 1;
#else
EFI_STATUS efi_status;
UINT32 no_reboot;
UINTN size = sizeof(UINT32);
Expand All @@ -1069,6 +1072,7 @@ get_fallback_no_reboot(void)
return no_reboot;
}
return 0;
#endif
}

#ifndef FALLBACK_NONINTERACTIVE
Expand Down Expand Up @@ -1184,7 +1188,13 @@ efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
try_start_first_option(image);
} else {
if (get_fallback_no_reboot() == 1) {
VerbosePrint(L"NO_REBOOT is set, starting the first image\n");
#ifdef FALLBACK_NEVER_REBOOT
const CHAR16 *reason = L"FALLBACK_NEVER_REBOOT";
#else
const CHAR16 *reason = L"NO_REBOOT";
#endif
VerbosePrint(L"%s is set, starting the first image\n",
reason);
try_start_first_option(image);
}

Expand Down