Blob Blame History Raw
Subject: add console_use_vt
From: kraxel@suse.de
Patch-mainline: no

$subject says all

--- head.orig/drivers/tty/tty_io.c	2012-04-10 14:24:25.000000000 +0200
+++ head/drivers/tty/tty_io.c	2012-04-10 14:49:49.000000000 +0200
@@ -137,6 +137,8 @@ EXPORT_SYMBOL(tty_mutex);
 /* Spinlock to protect the tty->tty_files list */
 DEFINE_SPINLOCK(tty_files_lock);
 
+bool __read_mostly console_use_vt = true;
+
 static ssize_t tty_read(struct file *, char __user *, size_t, loff_t *);
 static ssize_t tty_write(struct file *, const char __user *, size_t, loff_t *);
 ssize_t redirected_tty_write(struct file *, const char __user *,
@@ -1841,6 +1843,10 @@ static struct tty_driver *tty_lookup_dri
 #ifdef CONFIG_VT
 	case MKDEV(TTY_MAJOR, 0): {
 		extern struct tty_driver *console_driver;
+
+		if (!console_use_vt)
+			return get_tty_driver(device, index)
+			       ?: ERR_PTR(-ENODEV);
 		driver = tty_driver_kref_get(console_driver);
 		*index = fg_console;
 		*noctty = 1;
@@ -3390,7 +3396,8 @@ int __init tty_init(void)
 		WARN_ON(device_create_file(consdev, &dev_attr_active) < 0);
 
 #ifdef CONFIG_VT
-	vty_init(&console_fops);
+	if (console_use_vt)
+		vty_init(&console_fops);
 #endif
 	return 0;
 }
--- head.orig/include/linux/console.h	2012-03-19 00:15:34.000000000 +0100
+++ head/include/linux/console.h	2011-01-31 14:30:58.000000000 +0100
@@ -73,6 +73,7 @@ extern const struct consw dummy_con;	/* 
 extern const struct consw vga_con;	/* VGA text console */
 extern const struct consw newport_con;	/* SGI Newport console  */
 extern const struct consw prom_con;	/* SPARC PROM console */
+extern bool console_use_vt;
 
 int con_is_bound(const struct consw *csw);
 int register_con_driver(const struct consw *csw, int first, int last);