From 657e19f8f2dd279d3db6744d3d6859952d67c8c9 Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Mon, 31 Mar 2025 14:23:19 +0200 Subject: cli_hush: support running bootcmd on boot retry Introduce a new config option: RETRY_BOOTCMD. When enabled this causes hush shell to re-run "bootcmd" when the auto-boot counter times out. Tested-by: Danila Tikhonov # google-sunfish Tested-by: Jens Reidel # xiaomi-davinci Link: https://lore.kernel.org/r/20250331-qcom-phones-v4-2-f52e57d3b8c6@linaro.org Signed-off-by: Caleb Connolly --- boot/Kconfig | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'boot') diff --git a/boot/Kconfig b/boot/Kconfig index f101200ba7a..fb37d912bc9 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -1704,6 +1704,13 @@ config RESET_TO_RETRY After the countdown timed out, the board will be reset to restart again. +config RETRY_BOOTCMD + bool "Run bootcmd on retry" + depends on BOOT_RETRY && HUSH_PARSER && !RESET_TO_RETRY + help + If this option is enabled, the "bootcmd" will be run after the + countdown times out. + endmenu menu "Image support" -- cgit v1.3.1 From aa5ef3c0a752701abffe071690a6246193be9d1c Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Mon, 31 Mar 2025 14:23:20 +0200 Subject: bootretry: check for bootretry variable changes To enable more complex sequencing of the bootmenu, autoboot, and bootretry, handle changes to the bootretry variable between tries. This makes it possible to turn bootretry off (e.g. to drop to a shell) and then back on again. This makes it possible to have a persistent bootmenu (the only way to navigate U-Boot on devices like smartphones which lack a physical keyboard) by having bootcmd be defined to launch the bootmenu. This allows for menu options like enabling USB mass storage gadget to return back to the boot menu once the gadget is shut down. Reviewed-by: Tom Rini Tested-by: Danila Tikhonov # google-sunfish Tested-by: Jens Reidel # xiaomi-davinci Link: https://lore.kernel.org/r/20250331-qcom-phones-v4-3-f52e57d3b8c6@linaro.org Signed-off-by: Caleb Connolly --- boot/bootretry.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'boot') diff --git a/boot/bootretry.c b/boot/bootretry.c index 587b2de7d6b..a60767eaa2e 100644 --- a/boot/bootretry.c +++ b/boot/bootretry.c @@ -37,6 +37,8 @@ void bootretry_init_cmd_timeout(void) */ void bootretry_reset_cmd_timeout(void) { + /* Parse changes to bootretry */ + bootretry_init_cmd_timeout(); endtime = endtick(retry_time); } -- cgit v1.3.1