summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tags/2.6.20-5/50003_console-tty-fix.patch')
-rw-r--r--tags/2.6.20-5/50003_console-tty-fix.patch75
1 files changed, 75 insertions, 0 deletions
diff --git a/tags/2.6.20-5/50003_console-tty-fix.patch b/tags/2.6.20-5/50003_console-tty-fix.patch
new file mode 100644
index 0000000..72a90a8
--- /dev/null
+++ b/tags/2.6.20-5/50003_console-tty-fix.patch
@@ -0,0 +1,75 @@
+diff -rup linux-2.6.20-xen.orig/drivers/char/tty_io.c linux-2.6.20-xen/drivers/char/tty_io.c
+--- linux-2.6.20-xen.orig/drivers/char/tty_io.c 2007-07-16 11:14:52.000000000 -0700
++++ linux-2.6.20-xen/drivers/char/tty_io.c 2007-07-16 15:57:19.000000000 -0700
+@@ -133,6 +133,8 @@ LIST_HEAD(tty_drivers); /* linked list
+ DEFINE_MUTEX(tty_mutex);
+ EXPORT_SYMBOL(tty_mutex);
+
++int console_use_vt = 1;
++
+ #ifdef CONFIG_UNIX98_PTYS
+ extern struct tty_driver *ptm_driver; /* Unix98 pty masters; for /dev/ptmx */
+ extern int pty_limit; /* Config limit on Unix98 ptys */
+@@ -2518,7 +2520,7 @@ retry_open:
+ goto got_driver;
+ }
+ #ifdef CONFIG_VT
+- if (device == MKDEV(TTY_MAJOR,0)) {
++ if (console_use_vt && (device == MKDEV(TTY_MAJOR,0))) {
+ extern struct tty_driver *console_driver;
+ driver = console_driver;
+ index = fg_console;
+@@ -3910,6 +3912,8 @@ static int __init tty_init(void)
+ #endif
+
+ #ifdef CONFIG_VT
++ if (!console_use_vt)
++ goto out_vt;
+ cdev_init(&vc0_cdev, &console_fops);
+ if (cdev_add(&vc0_cdev, MKDEV(TTY_MAJOR, 0), 1) ||
+ register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0)
+@@ -3917,6 +3921,7 @@ static int __init tty_init(void)
+ device_create(tty_class, NULL, MKDEV(TTY_MAJOR, 0), "tty0");
+
+ vty_init();
++ out_vt:
+ #endif
+ return 0;
+ }
+diff -rup linux-2.6.20-xen.orig/drivers/xen/console/console.c linux-2.6.20-xen/drivers/xen/console/console.c
+--- linux-2.6.20-xen.orig/drivers/xen/console/console.c 2007-07-16 11:14:52.000000000 -0700
++++ linux-2.6.20-xen/drivers/xen/console/console.c 2007-07-16 16:02:26.000000000 -0700
+@@ -86,23 +86,30 @@ static unsigned long sysrq_requested;
+
+ void xencons_early_setup(void)
+ {
+- if (is_initial_xendomain())
++ extern int console_use_vt;
++
++ if (is_initial_xendomain()) {
+ xc_mode = XC_SERIAL;
+- else
+- xc_mode = XC_XVC;
++ } else {
++ xc_mode = XC_TTY;
++ console_use_vt = 0;
++ }
+ }
+
+ static int __init xencons_setup(char *str)
+ {
+ char *q;
+ int n;
++ extern int console_use_vt;
+
++ console_use_vt = 1;
+ if (!strncmp(str, "ttyS", 4)) {
+ xc_mode = XC_SERIAL;
+ str += 4;
+ } else if (!strncmp(str, "tty", 3)) {
+ xc_mode = XC_TTY;
+ str += 3;
++ console_use_vt = 0;
+ } else if (!strncmp(str, "xvc", 3)) {
+ xc_mode = XC_XVC;
+ str += 3;