aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/printk
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.com>2020-12-14 15:14:57 +0100
committerPetr Mladek <pmladek@suse.com>2020-12-14 15:14:57 +0100
commit5f3b8d398601055f29f32986a94d55955cd48f09 (patch)
tree9d1ccae747f39c27ecaff8e23f8e760d996ae2ee /kernel/printk
parentprintk: remove logbuf_lock writer-protection of ringbuffer (diff)
parentprintk/console: Allow to disable console output by using console="" or console=null (diff)
downloadlinux-dev-5f3b8d398601055f29f32986a94d55955cd48f09.tar.xz
linux-dev-5f3b8d398601055f29f32986a94d55955cd48f09.zip
Merge branch 'for-5.11-null-console' into for-linus
Diffstat (limited to 'kernel/printk')
-rw-r--r--kernel/printk/printk.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index c8847ee571f0..ccbdac579bd0 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2236,8 +2236,15 @@ static int __init console_setup(char *str)
char *s, *options, *brl_options = NULL;
int idx;
- if (str[0] == 0)
+ /*
+ * console="" or console=null have been suggested as a way to
+ * disable console output. Use ttynull that has been created
+ * for exacly this purpose.
+ */
+ if (str[0] == 0 || strcmp(str, "null") == 0) {
+ __add_preferred_console("ttynull", 0, NULL, NULL, true);
return 1;
+ }
if (_braille_console_setup(&str, &brl_options))
return 1;