diff options
author | Petr Mladek <pmladek@suse.com> | 2020-12-14 15:14:57 +0100 |
---|---|---|
committer | Petr Mladek <pmladek@suse.com> | 2020-12-14 15:14:57 +0100 |
commit | 5f3b8d398601055f29f32986a94d55955cd48f09 (patch) | |
tree | 9d1ccae747f39c27ecaff8e23f8e760d996ae2ee /init | |
parent | b031a684bfd01d633c79d281bd0cf11c2f834ada (diff) | |
parent | 3cffa06aeef7ece30f6b5ac0ea51f264e8fea4d0 (diff) | |
download | linux-stable-5f3b8d398601055f29f32986a94d55955cd48f09.tar.gz linux-stable-5f3b8d398601055f29f32986a94d55955cd48f09.tar.bz2 linux-stable-5f3b8d398601055f29f32986a94d55955cd48f09.zip |
Merge branch 'for-5.11-null-console' into for-linus
Diffstat (limited to 'init')
-rw-r--r-- | init/main.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/init/main.c b/init/main.c index 20baced721ad..08cd3a52a7e8 100644 --- a/init/main.c +++ b/init/main.c @@ -1480,8 +1480,14 @@ void __init console_on_rootfs(void) struct file *file = filp_open("/dev/console", O_RDWR, 0); if (IS_ERR(file)) { - pr_err("Warning: unable to open an initial console.\n"); - return; + pr_err("Warning: unable to open an initial console. Fallback to ttynull.\n"); + register_ttynull_console(); + + file = filp_open("/dev/console", O_RDWR, 0); + if (IS_ERR(file)) { + pr_err("Warning: Failed to add ttynull console. No stdin, stdout, and stderr for the init process!\n"); + return; + } } init_dup(file); init_dup(file); |