PageRenderTime 20ms CodeModel.GetById 14ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/packages/linux/patches/linux-3.1.4-003-no_dev_console.patch

http://github.com/OpenELEC/OpenELEC.tv
Patch | 20 lines | 18 code | 2 blank | 0 comment | 0 complexity | 00a334e29e5ae8b07f277e88020a0e1c MD5 | raw file
 1diff -Naur linux-2.6.34-rc7/init/main.c linux-2.6.34-rc7.patch/init/main.c
 2--- linux-2.6.34-rc7/init/main.c	2010-05-10 03:36:28.000000000 +0200
 3+++ linux-2.6.34-rc7.patch/init/main.c	2010-05-15 12:28:34.767241760 +0200
 4@@ -886,8 +886,14 @@
 5 	do_basic_setup();
 6 
 7 	/* Open the /dev/console on the rootfs, this should never fail */
 8-	if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
 9-		printk(KERN_WARNING "Warning: unable to open an initial console.\n");
10+	char *console = "/dev_console";
11+
12+	if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) {
13+		sys_mknod(console, S_IFCHR|0600, (TTYAUX_MAJOR<<8)|1);
14+		if (sys_open(console, O_RDWR, 0) < 0)
15+			printk(KERN_WARNING "Warning: unable to open an initial console.\n");
16+		sys_unlink(console);
17+	}
18 
19 	(void) sys_dup(0);
20 	(void) sys_dup(0);