[PATCH 2/3] startup: autoboot: disable on deactivated console
Ahmad Fatoum
a.fatoum at pengutronix.de
Tue Oct 28 05:49:51 PDT 2025
On 10/28/25 1:18 PM, Fabian Pflug wrote:
> If the console input is deactivated either globally or through a
> security policy, then it does not make sense to wait for user input, but
> instead boot the system directly.
CONFIG_CONSOLE_DISABLE_INPUT is unneeded here as it removed the input
flag from the consoles and so console_get_first_active would return NULL.
I think console_get_first_active() should maybe return NULL if
SCONFIG_CONSOLE_INPUT is disabled. In that case, we should probably
rename it, e.g. console_get_first_interactive.
>
> Signed-off-by: Fabian Pflug <f.pflug at pengutronix.de>
> ---
> common/startup.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/common/startup.c b/common/startup.c
> index 3bc2609006..ea5436afa6 100644
> --- a/common/startup.c
> +++ b/common/startup.c
> @@ -188,9 +188,11 @@ enum autoboot_state do_autoboot_countdown(void)
> if (autoboot_state != AUTOBOOT_UNKNOWN)
> return autoboot_state;
>
> - if (!console_get_first_active() &&
> - global_autoboot_state != AUTOBOOT_ABORT &&
> - global_autoboot_state != AUTOBOOT_HALT) {
> + if ((!console_get_first_active() &&
> + global_autoboot_state != AUTOBOOT_ABORT &&
> + global_autoboot_state != AUTOBOOT_HALT) ||
> + !IS_ALLOWED(SCONFIG_CONSOLE_INPUT) ||
> + IS_ENABLED(CONFIG_CONSOLE_DISABLE_INPUT)) {
> printf("\nNon-interactive console, booting system\n");
> return autoboot_state = AUTOBOOT_BOOT;
> }
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list