summaryrefslogtreecommitdiffstats
path: root/zarb-ml/mageia-dev/attachments/20111218/d36a25cc/attachment-0002.bin
blob: 50bfc115444cdd1196c27e5d2e5915553e344e4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
>From 83cb8160a3bd07138adc6a8938d6067f44a6cf22 Mon Sep 17 00:00:00 2001
From: Anssi Hannula <anssi.hannula@iki.fi>
Date: Sun, 18 Dec 2011 12:24:04 +0200
Subject: [PATCH] set default console as vt7 (proof-of-concept)

---
 drivers/tty/vt/vc_screen.c |    3 +--
 drivers/tty/vt/vt.c        |    8 ++++----
 include/linux/vt.h         |    2 +-
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c
index 7a367ff..8d7dd54 100644
--- a/drivers/tty/vt/vc_screen.c
+++ b/drivers/tty/vt/vc_screen.c
@@ -660,7 +660,6 @@ int __init vcs_init(void)
 
 	device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 0), NULL, "vcs");
 	device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 128), NULL, "vcsa");
-	for (i = 0; i < MIN_NR_CONSOLES; i++)
-		vcs_make_sysfs(i);
+	vcs_make_sysfs(DEFAULT_CONSOLE);
 	return 0;
 }
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index e716839..af6b932 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -1018,7 +1018,7 @@ void vc_deallocate(unsigned int currcons)
 		put_pid(vc->vt_pid);
 		module_put(vc->vc_sw->owner);
 		kfree(vc->vc_screenbuf);
-		if (currcons >= MIN_NR_CONSOLES)
+		if (currcons != DEFAULT_CONSOLE)
 			kfree(vc);
 		vc_cons[currcons].d = NULL;
 	}
@@ -2914,7 +2914,7 @@ static int __init con_init(void)
 		mod_timer(&console_timer, jiffies + (blankinterval * HZ));
 	}
 
-	for (currcons = 0; currcons < MIN_NR_CONSOLES; currcons++) {
+	currcons = DEFAULT_CONSOLE;
 		vc_cons[currcons].d = vc = kzalloc(sizeof(struct vc_data), GFP_NOWAIT);
 		INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK);
 		tty_port_init(&vc->port);
@@ -2922,8 +2922,8 @@ static int __init con_init(void)
 		vc->vc_screenbuf = kzalloc(vc->vc_screenbuf_size, GFP_NOWAIT);
 		vc_init(vc, vc->vc_rows, vc->vc_cols,
 			currcons || !vc->vc_sw->con_save_screen);
-	}
-	currcons = fg_console = 0;
+
+	fg_console = currcons;
 	master_display_fg = vc = vc_cons[currcons].d;
 	set_origin(vc);
 	save_screen(vc);
diff --git a/include/linux/vt.h b/include/linux/vt.h
index 30a8dd9..6abf4fb 100644
--- a/include/linux/vt.h
+++ b/include/linux/vt.h
@@ -6,7 +6,7 @@
  * These constants are also useful for user-level apps (e.g., VC
  * resizing).
  */
-#define MIN_NR_CONSOLES 1       /* must be at least 1 */
+#define DEFAULT_CONSOLE 6
 #define MAX_NR_CONSOLES	63	/* serial lines start at 64 */
 #define MAX_NR_USER_CONSOLES 63	/* must be root to allocate above this */
 		/* Note: the ioctl VT_GETSTATE does not work for
-- 
1.7.7.2