mirror of
https://github.com/Fishwaldo/build.git
synced 2025-03-23 07:11:26 +00:00
21 lines
765 B
Diff
21 lines
765 B
Diff
diff --git a/init/main.c b/init/main.c
|
|
index 9484f4b..db55edd 100644
|
|
--- a/init/main.c
|
|
+++ b/init/main.c
|
|
@@ -880,8 +880,14 @@ static noinline void __init kernel_init_freeable(void)
|
|
do_basic_setup();
|
|
|
|
/* Open the /dev/console on the rootfs, this should never fail */
|
|
- if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
|
|
- printk(KERN_WARNING "Warning: unable to open an initial console.\n");
|
|
+ char *console = "/dev_console";
|
|
+
|
|
+ if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) {
|
|
+ sys_mknod(console, S_IFCHR|0600, (TTYAUX_MAJOR<<8)|1);
|
|
+ if (sys_open(console, O_RDWR, 0) < 0)
|
|
+ printk(KERN_WARNING "Warning: unable to open an initial console.\n");
|
|
+ sys_unlink(console);
|
|
+ }
|
|
|
|
(void) sys_dup(0);
|
|
(void) sys_dup(0);
|