From c038b653ac1fed329c8577df3b19bad8d594c98a Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 4 Dec 2024 06:55:48 +0000 Subject: Add auto-boot timeout for U-Boot's bootflow menu Otherwise, you have to press enter to boot your distro. With this, a timeout is created. After a number of seconds, which can be reconfigured, the first option selected will be booted, when generating a bootflow menu. The timeout is disabled when you navigate the menu; it only kicks in if you don't input anything on the keyboard. More information about how this works is in the U-Boot patches, within this patch. I've set the timeout to 8 seconds. Signed-off-by: Leah Rowe --- ...sec-autoboot-timeout-on-the-bootflow-menu.patch | 65 ---------------------- 1 file changed, 65 deletions(-) delete mode 100644 config/u-boot/x86_64/patches/0004-Add-an-8sec-autoboot-timeout-on-the-bootflow-menu.patch (limited to 'config/u-boot/x86_64/patches/0004-Add-an-8sec-autoboot-timeout-on-the-bootflow-menu.patch') 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 deleted file mode 100644 index 3790e6ed..00000000 --- a/config/u-boot/x86_64/patches/0004-Add-an-8sec-autoboot-timeout-on-the-bootflow-menu.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 1b1673e76dae73885089415132284e9a14ecd4ac Mon Sep 17 00:00:00 2001 -From: Leah Rowe -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 ---- - 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 - -- cgit v1.2.1