From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Fabian Pflug <f.pflug@pengutronix.de>, barebox@lists.infradead.org
Subject: Re: [PATCH 2/3] startup: autoboot: disable on deactivated console
Date: Tue, 28 Oct 2025 13:49:51 +0100 [thread overview]
Message-ID: <5177583f-3b92-4d7e-b872-ff9a0a861187@pengutronix.de> (raw)
In-Reply-To: <20251028121820.1242298-2-f.pflug@pengutronix.de>
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@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 |
next prev parent reply other threads:[~2025-10-28 12:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-28 12:18 [PATCH 1/3] startup: check for console before showing menu Fabian Pflug
2025-10-28 12:18 ` [PATCH 2/3] startup: autoboot: disable on deactivated console Fabian Pflug
2025-10-28 12:49 ` Ahmad Fatoum [this message]
2025-10-28 12:18 ` [PATCH 3/3] startup: mount ps only on policy FS_EXTERNAL Fabian Pflug
2025-10-28 12:56 ` Ahmad Fatoum
2025-10-28 13:48 ` Fabian Pflug
2025-10-28 12:39 ` [PATCH 1/3] startup: check for console before showing menu Ahmad Fatoum
2025-10-28 13:43 ` Fabian Pflug
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5177583f-3b92-4d7e-b872-ff9a0a861187@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=f.pflug@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox