[RFC 0/2] printk: Official way to mute consoles

From: Petr Mladek
Date: Thu Oct 22 2020 - 07:42:45 EST


The long discussion about handling empty console= came up with several
problems. This patchset tries to solve the two original problems
with empty console="" parameter:

+ Prevent the potential crash by registering console for /dev/console.
+ Prevent the performance regression by muting the consoles.

IMHO, the patchset makes sense on its own. It fixes a regression. It seems
that people want this functionality [1][2][3].

Note that there are still some problems that might be solved later:

+ Invalid console=bla name might still prevent registering any console.

+ The kernel should not crash even when /dev/console does not point
to any real console.

+ Should we add some fallback for stdin, stdout, and stderr when /dev/console
can't be opened? For example, /dev/null?

+ How user space handle missing none-console associated with /dev/console?

[1] https://www.programmersought.com/article/19374022450/
[2] https://developer.toradex.com/knowledge-base/how-to-disable-enable-debug-messages-in-linux
[3] https://unix.stackexchange.com/questions/117926/try-to-disable-console-output-console-null-doesnt-work


Petr Mladek (2):
printk: Add kernel parameter: mute_console
printk: Restore and document obsolete ways to disable console output

.../admin-guide/kernel-parameters.txt | 11 +++++++
kernel/printk/printk.c | 30 +++++++++++++++++--
2 files changed, 39 insertions(+), 2 deletions(-)

--
2.26.2