summaryrefslogtreecommitdiff
path: root/config/u-boot/x86_64/patches/0004-Add-an-8sec-autoboot-timeout-on-the-bootflow-menu.patch
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-12-03 21:40:15 +0000
committerLeah Rowe <leah@libreboot.org>2024-12-03 21:40:15 +0000
commit7a6e47c24fe88f44138a8e6e3360fc796445c933 (patch)
tree2db277c0ee51d91f2762853f0120778a14532be4 /config/u-boot/x86_64/patches/0004-Add-an-8sec-autoboot-timeout-on-the-bootflow-menu.patch
parent90850eb859c644f12abc641c1e62c974cad72bcd (diff)
8-sec auto-boot timeout for U-Boot's bootflow menu
Otherwise, you have to press enter to boot, which is unacceptable for headless operation. Pressing anything other than enter an an option, such as the arrow keys, will disable the timeout. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'config/u-boot/x86_64/patches/0004-Add-an-8sec-autoboot-timeout-on-the-bootflow-menu.patch')
-rw-r--r--config/u-boot/x86_64/patches/0004-Add-an-8sec-autoboot-timeout-on-the-bootflow-menu.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/config/u-boot/x86_64/patches/0004-Add-an-8sec-autoboot-timeout-on-the-bootflow-menu.patch b/config/u-boot/x86_64/patches/0004-Add-an-8sec-autoboot-timeout-on-the-bootflow-menu.patch
new file mode 100644
index 00000000..3790e6ed
--- /dev/null
+++ b/config/u-boot/x86_64/patches/0004-Add-an-8sec-autoboot-timeout-on-the-bootflow-menu.patch
@@ -0,0 +1,65 @@
+From 1b1673e76dae73885089415132284e9a14ecd4ac Mon Sep 17 00:00:00 2001
+From: Leah Rowe <info@minifree.org>
+Date: Tue, 3 Dec 2024 20:31:32 +0000
+Subject: [PATCH 1/1] Add an 8sec autoboot timeout on the bootflow menu
+
+Otherwise, you have to press enter to load from a boot option,
+which is unacceptable on headless setups.
+
+If you press the arrow keys to interrupt it, the timer will stop
+and you must then press enter to boot an option.
+
+Otherwise, if you just leave U-Boot to do its thing, it will
+automatically boot what was selected, e.g. installed OS.
+
+Signed-off-by: Leah Rowe <info@minifree.org>
+---
+ boot/bootflow_menu.c | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/boot/bootflow_menu.c b/boot/bootflow_menu.c
+index 9d0dc352f9..c788b86cdc 100644
+--- a/boot/bootflow_menu.c
++++ b/boot/bootflow_menu.c
+@@ -59,7 +59,7 @@ int bootflow_menu_new(struct expo **expp)
+ ret = scene_menu(scn, "main", OBJ_MENU, &menu);
+ ret |= scene_obj_set_pos(scn, OBJ_MENU, MARGIN_LEFT, 100);
+ ret |= scene_txt_str(scn, "title", OBJ_MENU_TITLE, STR_MENU_TITLE,
+- "U-Boot - Boot Menu", NULL);
++ "**** The selected menu item will autoboot in a few seconds unless interrupted! ****", NULL);
+ ret |= scene_menu_set_title(scn, OBJ_MENU, OBJ_PROMPT);
+
+ logo = video_get_u_boot_logo();
+@@ -185,6 +185,8 @@ int bootflow_menu_run(struct bootstd_priv *std, bool text_mode,
+ uint sel_id;
+ bool done;
+ int ret;
++ int bootflow_delay=8000;
++ bool bootflow_countdown=true;
+
+ cli_ch_init(cch);
+
+@@ -231,6 +233,12 @@ int bootflow_menu_run(struct bootstd_priv *std, bool text_mode,
+ schedule();
+ mdelay(2);
+ ichar = cli_ch_process(cch, -ETIMEDOUT);
++ if (bootflow_countdown == true) {
++ bootflow_delay -= 2;
++ if (bootflow_delay <= 0) {
++ ichar='\n';
++ }
++ }
+ }
+ if (!ichar) {
+ ichar = getchar();
+@@ -265,6 +273,7 @@ int bootflow_menu_run(struct bootstd_priv *std, bool text_mode,
+ break;
+ }
+ }
++ bootflow_countdown = false;
+ } while (!done);
+
+ if (ret)
+--
+2.39.5
+