mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2 1/3] startup: check for console before showing menu
@ 2025-10-28 15:43 Fabian Pflug
  2025-10-28 15:43 ` [PATCH v2 2/3] console_common: get_first_active: respect security policy Fabian Pflug
  2025-10-28 15:43 ` [PATCH 3/3] startup: mount ps only on policy FS_EXTERNAL Fabian Pflug
  0 siblings, 2 replies; 4+ messages in thread
From: Fabian Pflug @ 2025-10-28 15:43 UTC (permalink / raw)
  To: barebox; +Cc: Fabian Pflug

If there is no input available or possible due to policy settings, it
does not make sense to show a menu and ask for input.

Signed-off-by: Fabian Pflug <f.pflug@pengutronix.de>
---
v2:
Remove CONSOLE_DISABLE_INPUT from check
 common/startup.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/common/startup.c b/common/startup.c
index 8d36ffceb4..4313435f05 100644
--- a/common/startup.c
+++ b/common/startup.c
@@ -45,6 +45,7 @@
 #include <pbl/handoff-data.h>
 #include <libfile.h>
 #include <fuzz.h>
+#include <security/config.h>
 
 extern initcall_t __barebox_initcalls_start[], __barebox_early_initcalls_end[],
 		  __barebox_initcalls_end[];
@@ -361,14 +362,15 @@ static int run_init(void)
 		run_shell();
 	}
 
-	do {
-		/*
-		 * Let's run the command once at least, so an error
-		 * message is printed if the file doesn't exist
-		 */
-		run_command(MENUFILE);
-	} while (stat(MENUFILE, &s) == 0);
-
+	if(IS_ALLOWED(SCONFIG_CONSOLE_INPUT)) {
+		do {
+			/*
+			* Let's run the command once at least, so an error
+			* message is printed if the file doesn't exist
+			*/
+			run_command(MENUFILE);
+		} while (stat(MENUFILE, &s) == 0);
+	}
 	hang();
 }
 
-- 
2.47.3




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-29  7:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-28 15:43 [PATCH v2 1/3] startup: check for console before showing menu Fabian Pflug
2025-10-28 15:43 ` [PATCH v2 2/3] console_common: get_first_active: respect security policy Fabian Pflug
2025-10-29  7:04   ` Ahmad Fatoum
2025-10-28 15:43 ` [PATCH 3/3] startup: mount ps only on policy FS_EXTERNAL Fabian Pflug

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox