66 lines
2.0 KiB
Diff
66 lines
2.0 KiB
Diff
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
|
|
|