[PATCH 1/2] autoboot: allow custom prompt without requiring AUTOBOOT_KEYED

Ferass El Hafidi funderscore at postmarketos.org
Sun Apr 5 12:49:04 CEST 2026


The autoboot prompt used to only be customizable in Kconfig when
AUTOBOOT_KEYED was enabled. For a usecase such as having a nicer
autoboot prompt alongside a splash screen, there is no reason for
AUTOBOOT_KEYED to be required for this.

Remove the dependency to AUTOBOOT_KEYED, and use AUTOBOOT_PROMPT in
print_boot_delay() instead of a hardcoded string.

Signed-off-by: Ferass El Hafidi <funderscore at postmarketos.org>
---
 boot/Kconfig      | 31 ++++++++++++++++---------------
 common/autoboot.c |  4 +++-
 2 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/boot/Kconfig b/boot/Kconfig
index bfed452d77e..6c8ec356996 100644
--- a/boot/Kconfig
+++ b/boot/Kconfig
@@ -1560,6 +1560,22 @@ config AUTOBOOT
 	help
 	  This enables the autoboot.  See doc/README.autoboot for detail.
 
+config AUTOBOOT_PROMPT
+	string "Autoboot stop prompt"
+	default "Autoboot in %d seconds\\n" if AUTOBOOT_KEYED
+	default "\\rHit any key to stop autoboot: %d"
+	help
+	  This string is displayed before the boot delay selected by
+	  CONFIG_BOOTDELAY starts. If it is not defined	there is no
+	  output indicating that autoboot is in progress.
+
+	  Note that this define is used as the (only) argument to a
+	  printf() call, so it may contain '%' format specifications,
+	  provided that it also includes, separated by commas exactly
+	  like in a printf statement, the required arguments. It is
+	  the responsibility of the user to select only such arguments
+	  that are valid in the given context.
+
 if AUTOBOOT
 
 config BOOTDELAY
@@ -1597,21 +1613,6 @@ config AUTOBOOT_FLUSH_STDIN
 	  This can't be enabled for the sandbox as flushing stdin would
 	  break the autoboot unit tests.
 
-config AUTOBOOT_PROMPT
-	string "Autoboot stop prompt"
-	default "Autoboot in %d seconds\\n"
-	help
-	  This string is displayed before the boot delay selected by
-	  CONFIG_BOOTDELAY starts. If it is not defined	there is no
-	  output indicating that autoboot is in progress.
-
-	  Note that this define is used as the (only) argument to a
-	  printf() call, so it may contain '%' format specifications,
-	  provided that it also includes, separated by commas exactly
-	  like in a printf statement, the required arguments. It is
-	  the responsibility of the user to select only such arguments
-	  that are valid in the given context.
-
 config AUTOBOOT_ENCRYPTION
 	bool "Enable encryption in autoboot stopping"
 	help
diff --git a/common/autoboot.c b/common/autoboot.c
index 1783ef92c94..d12d618fea3 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -379,7 +379,9 @@ static int abortboot_key_sequence(int bootdelay)
 
 static void print_boot_delay(int bootdelay)
 {
-	printf(ANSI_CLEAR_LINE "\rHit any key to stop autoboot: %d", bootdelay);
+#ifdef CONFIG_AUTOBOOT_PROMPT
+	printf(ANSI_CLEAR_LINE CONFIG_AUTOBOOT_PROMPT, bootdelay);
+#endif
 }
 
 static int abortboot_single_key(int bootdelay)

-- 
2.53.0



More information about the U-Boot mailing list