[PATCH 20/20] netconsole: suppress log message when opening console file

Ahmad Fatoum a.fatoum at barebox.org
Sun May 3 01:33:22 PDT 2026


As is already being done for the framebuffer console, suppress log
messages when the device is briefly opened via echo.

Otherwise, a netconsole not activated for a CONSOLE_STD* stream,
would each time result in a log message.

We do not replay the dmesg, because if the output path works, the remote
side should be able to input a dmesg command.

This is unlike fbconsole, which has no input.

Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
 net/netconsole.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/netconsole.c b/net/netconsole.c
index f2e9447526bf..62dd60806ebd 100644
--- a/net/netconsole.c
+++ b/net/netconsole.c
@@ -118,7 +118,8 @@ static int nc_open(struct console_device *cdev, unsigned activate)
 
 	net_udp_bind(priv->con, priv->port);
 
-	pr_info("netconsole initialized with %pI4:%d\n", &priv->ip, priv->port);
+	if (activate)
+		pr_info("netconsole initialized with %pI4:%d\n", &priv->ip, priv->port);
 
 	return 0;
 }
-- 
2.47.3




More information about the barebox mailing list