1 Subject: add console_use_vt
8 drivers/char/tty_io.c | 7 ++++++-
9 include/linux/console.h | 1 +
10 2 files changed, 7 insertions(+), 1 deletion(-)
12 --- a/drivers/char/tty_io.c
13 +++ b/drivers/char/tty_io.c
14 @@ -136,6 +136,8 @@ LIST_HEAD(tty_drivers); /* linked list
15 DEFINE_MUTEX(tty_mutex);
16 EXPORT_SYMBOL(tty_mutex);
18 +int console_use_vt = 1;
20 #ifdef CONFIG_UNIX98_PTYS
21 extern struct tty_driver *ptm_driver; /* Unix98 pty masters; for /dev/ptmx */
22 static int ptmx_open(struct inode *, struct file *);
23 @@ -2200,7 +2202,7 @@ retry_open:
27 - if (device == MKDEV(TTY_MAJOR, 0)) {
28 + if (console_use_vt && device == MKDEV(TTY_MAJOR, 0)) {
29 extern struct tty_driver *console_driver;
30 driver = console_driver;
32 @@ -3729,6 +3731,8 @@ static int __init tty_init(void)
36 + if (!console_use_vt)
38 cdev_init(&vc0_cdev, &console_fops);
39 if (cdev_add(&vc0_cdev, MKDEV(TTY_MAJOR, 0), 1) ||
40 register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0)
41 @@ -3736,6 +3740,7 @@ static int __init tty_init(void)
42 device_create_drvdata(tty_class, NULL, MKDEV(TTY_MAJOR, 0), NULL, "tty0");
49 --- a/include/linux/console.h
50 +++ b/include/linux/console.h
51 @@ -63,6 +63,7 @@ extern const struct consw dummy_con; /*
52 extern const struct consw vga_con; /* VGA text console */
53 extern const struct consw newport_con; /* SGI Newport console */
54 extern const struct consw prom_con; /* SPARC PROM console */
55 +extern int console_use_vt;
57 int con_is_bound(const struct consw *csw);
58 int register_con_driver(const struct consw *csw, int first, int last);