]> Git Repo - linux.git/blobdiff - init/main.c
Merge tag 'drm-next-2020-12-18' of git://anongit.freedesktop.org/drm/drm
[linux.git] / init / main.c
index 3024c4db17a92d585b0cb2fc0074acbf9d5b70a9..6feee7f11eafca4de9fb4dd2101edeb4d1125bef 100644 (file)
@@ -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);
This page took 0.032281 seconds and 4 git commands to generate.