/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

  1. diff -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. /* Open the /dev/console on the rootfs, this should never fail */
  7. - if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
  8. - printk(KERN_WARNING "Warning: unable to open an initial console.\n");
  9. + char *console = "/dev_console";
  10. +
  11. + if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) {
  12. + sys_mknod(console, S_IFCHR|0600, (TTYAUX_MAJOR<<8)|1);
  13. + if (sys_open(console, O_RDWR, 0) < 0)
  14. + printk(KERN_WARNING "Warning: unable to open an initial console.\n");
  15. + sys_unlink(console);
  16. + }
  17. (void) sys_dup(0);
  18. (void) sys_dup(0);