summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoão Paulo Rechi Vita <jprvita@endlessos.org>2021-03-09 14:07:56 -0800
committerPeter Jones <pjones@redhat.com>2021-03-10 15:59:07 -0500
commit298cac6d8486998a531aacd901cd3ce30c0faedf (patch)
treeb63890c3ebb069772a9c6dead3c8f7bba25be2a0
parent38fb09e4a1ed8b54d69f65c9901bf940e154386b (diff)
downloadefi-boot-shim-298cac6d8486998a531aacd901cd3ce30c0faedf.tar.gz
efi-boot-shim-298cac6d8486998a531aacd901cd3ce30c0faedf.zip
fallback: Make verbose mode's wait time configurable
Make it possible to configure at build time for how long fallback will wait before moving to the next step when in verbose mode. Also remind the user they can press the Pause key to pause the boot process at that point. Signed-off-by: João Paulo Rechi Vita <jprvita@endlessos.org>
-rw-r--r--Makefile4
-rw-r--r--fallback.c20
2 files changed, 20 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 7c0fbb11..be5611e2 100644
--- a/Makefile
+++ b/Makefile
@@ -54,6 +54,10 @@ SOURCES = $(foreach source,$(ORIG_SOURCES),$(TOPDIR)/$(source)) version.c
MOK_SOURCES = $(foreach source,$(ORIG_MOK_SOURCES),$(TOPDIR)/$(source))
FALLBACK_SRCS = $(foreach source,$(ORIG_FALLBACK_SRCS),$(TOPDIR)/$(source))
+ifneq ($(origin FALLBACK_VERBOSE_WAIT), undefined)
+ CFLAGS += -DFALLBACK_VERBOSE_WAIT=$(FALLBACK_VERBOSE_WAIT)
+endif
+
all: $(TARGETS)
update :
diff --git a/fallback.c b/fallback.c
index 4a7a8eea..79d736c2 100644
--- a/fallback.c
+++ b/fallback.c
@@ -942,8 +942,14 @@ try_start_first_option(EFI_HANDLE parent_image_handle)
EFI_HANDLE image_handle;
if (get_fallback_verbose()) {
- console_print(L"Verbose enabled, sleeping for half a second\n");
- msleep(500000);
+ int fallback_verbose_wait = 500000; /* default to 0.5s */
+#ifdef FALLBACK_VERBOSE_WAIT
+ fallback_verbose_wait = FALLBACK_VERBOSE_WAIT;
+#endif
+ console_print(L"Verbose enabled, sleeping for %d mseconds... "
+ L"Press the Pause key now to hold for longer.\n",
+ fallback_verbose_wait);
+ msleep(fallback_verbose_wait);
}
if (!first_new_option) {
@@ -1137,8 +1143,14 @@ reset:
console_print(L"Reset System\n");
if (get_fallback_verbose()) {
- console_print(L"Verbose enabled, sleeping for half a second\n");
- msleep(500000);
+ int fallback_verbose_wait = 500000; /* default to 0.5s */
+#ifdef FALLBACK_VERBOSE_WAIT
+ fallback_verbose_wait = FALLBACK_VERBOSE_WAIT;
+#endif
+ console_print(L"Verbose enabled, sleeping for %d mseconds... "
+ L"Press the Pause key now to hold for longer.\n",
+ fallback_verbose_wait);
+ msleep(fallback_verbose_wait);
}
gRT->ResetSystem(EfiResetCold, EFI_SUCCESS, 0, NULL);