At Wed, 02 Apr 2014 10:01:43 +0200, Jean Delvare wrote:
Hi Takashi, Andreas,
Le Tuesday 01 April 2014 à 15:19 +0200, Takashi Iwai a écrit :
At Mon, 31 Mar 2014 12:33:46 +0200, Andreas Schwab wrote:
Would it make sense to enable TTY_PRINTK? It can be used to redirect the system console to the same channel printk uses (write-only, of course), eg. it can be used to capture user-level console messages via netconsole (which doesn't provide a tty device on its own).
I wonder why this can't be a module.
No good reason that I can see. I tried turning TTY_PRINTK into a tristate option and building it as a module, and did not get any error. I didn't actually test it though, and won't have time for that.
Ditto, I did make a quick fix patch and load/unload without real testing, too :) FWIW, my patch is attached below.
Should I push that experimental patch to our master kernel branch for someone else to test it? Or I can just share the patch if someone wants to test it first.
I guess it's better to submit to upstream at first. I see that Andreas' question came from the LKML thread: https://lkml.org/lkml/2014/3/29/34
Otherwise we'll have to build it into kernel always although its usage must be pretty rare.
It's fairly small so not necessarily a big deal, unless there are security concerns.
Right, but it'd be better if this could be integrated as a module from the beginning.
Anyway we could always enable it in our debug kernel flavors only.
True.
thanks,
Takashi
---
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 1386749b48ff..97816b133c7f 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -40,7 +40,7 @@ config SGI_MBCS
source "drivers/tty/serial/Kconfig"
config TTY_PRINTK
- bool "TTY driver to output user messages via printk"
+ tristate "TTY driver to output user messages via printk"
depends on EXPERT && TTY
default n
---help---
diff --git a/drivers/char/ttyprintk.c b/drivers/char/ttyprintk.c
index daea84c41743..4ae77317a937 100644
--- a/drivers/char/ttyprintk.c
+++ b/drivers/char/ttyprintk.c
@@ -17,7 +17,7 @@
#include