* [PATCH] console: print banner on every fully activated console
@ 2025-10-27 6:08 Ahmad Fatoum
2025-10-28 8:25 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2025-10-27 6:08 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
On systems with multiple consoles, the first console is usually
activated via device trees and the others later via board code.
The later consoles don't get previous log replayed and it can thus be
hard to determine when the log starts when the console remains open
between reboots.
Improve upon this by printing out the barebox prompt whenever a console
is switching from deactivated to ioe. We don't actually require input,
but checking for input allows users to disable this by first switching
to oe, then ioe.
Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
common/console.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/common/console.c b/common/console.c
index 95e5fb4df33c..aa2013c51522 100644
--- a/common/console.c
+++ b/common/console.c
@@ -83,6 +83,7 @@ int console_close(struct console_device *cdev)
int console_set_active(struct console_device *cdev, unsigned flag)
{
+ unsigned flag_new = flag & ~cdev->f_active;
int ret;
if (!cdev->getc)
@@ -117,6 +118,10 @@ int console_set_active(struct console_device *cdev, unsigned flag)
barebox_banner();
while (kfifo_getc(console_output_fifo, &ch) == 0)
console_putc(CONSOLE_STDOUT, ch);
+ } else if (IS_ENABLED(CONFIG_BANNER) && cdev->puts &&
+ flag_new == CONSOLE_STDIOE) {
+ cdev->puts(cdev, version_string, strlen(version_string));
+ cdev->puts(cdev, "\n\n", 2);
}
return 0;
--
2.47.3
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-10-28 8:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-27 6:08 [PATCH] console: print banner on every fully activated console Ahmad Fatoum
2025-10-28 8:25 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox