diff --git a/Makefile b/Makefile index c9aeb863d..c35068d32 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/fallback.c b/fallback.c index 8e6327be8..44d9916bc 100644 --- a/fallback.c +++ b/fallback.c @@ -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); @@ -1069,6 +1072,7 @@ get_fallback_no_reboot(void) return no_reboot; } return 0; +#endif } #ifndef FALLBACK_NONINTERACTIVE @@ -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); }