]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
add CONFIG_VT_UNICODE
authorBill Nottingham <notting@redhat.com>
Wed, 17 Oct 2007 06:29:38 +0000 (23:29 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 17 Oct 2007 15:42:56 +0000 (08:42 -0700)
As of now, the kernel defaults to non-unicode and XLATE for the keyboard.
We've been changing this in Fedora, but that requires patching the defaults
in the kernel.

The attached introduces CONFIG_VT_UNICODE, which sets the console in
unicode mode by default on boot, including both the virtual terminal and
the keyboard driver.

Signed-off-by: Bill Nottingham <notting@redhat.com>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/Kconfig
drivers/char/keyboard.c
drivers/char/sysrq.c
drivers/char/vt.c
drivers/char/vt_ioctl.c
include/linux/vt_kern.h

index f6f8c03047fa8b44f0b8aa751c331e6677c820a9..1232ace097e167989fd4b958dec491cee3534c55 100644 (file)
@@ -36,6 +36,23 @@ config VT
          If unsure, say Y, or else you won't be able to do much with your new
          shiny Linux system :-)
 
+config VT_UNICODE
+       bool "Virtual console is Unicode by default"
+       depends on VT
+       default n
+       ---help---
+         If you say Y here, the virtual terminal will be in UTF-8 by default,
+         and the keyboard will run in unicode mode.
+
+         If you say N here, the virtual terminal will not be in UTF-8 by
+         default, and the keyboard will run in XLATE mode.
+
+         This can also be changed by passing 'default_utf8=<0|1>' on the
+         kernel command line.
+
+         Historically, the kernel has defaulted to non-UTF8 and XLATE mode.
+         If unsure, say N here.
+
 config VT_CONSOLE
        bool "Support for console on virtual terminal" if EMBEDDED
        depends on VT
index 5ae2a3250c50dcdf1aa987800dd30a73dc1d275f..212276affa1f5c887233cdd3c14e987a6941fd22 100644 (file)
@@ -1381,7 +1381,7 @@ int __init kbd_init(void)
                kbd_table[i].lockstate = KBD_DEFLOCK;
                kbd_table[i].slockstate = 0;
                kbd_table[i].modeflags = KBD_DEFMODE;
-               kbd_table[i].kbdmode = VC_XLATE;
+               kbd_table[i].kbdmode = default_utf8 ? VC_UNICODE : VC_XLATE;
        }
 
        error = input_register_handler(&kbd_handler);
index 179fa36ce485a33b194edf044778be1801e84882..78d14935f2b8c4b1dbb4678f0d918858c6a15832 100644 (file)
@@ -108,12 +108,12 @@ static void sysrq_handle_unraw(int key, struct tty_struct *tty)
        struct kbd_struct *kbd = &kbd_table[fg_console];
 
        if (kbd)
-               kbd->kbdmode = VC_XLATE;
+               kbd->kbdmode = default_utf8 ? VC_UNICODE : VC_XLATE;
 }
 static struct sysrq_key_op sysrq_unraw_op = {
        .handler        = sysrq_handle_unraw,
        .help_msg       = "unRaw",
-       .action_msg     = "Keyboard mode set to XLATE",
+       .action_msg     = "Keyboard mode set to system default",
        .enable_mask    = SYSRQ_ENABLE_KEYBOARD,
 };
 #else
index 0d56f8fc105c9314fb9b9e73b539d8acbb7ddfe1..645ad9808982526cf8f7ae4fdf682e2a433ed72e 100644 (file)
@@ -158,7 +158,11 @@ static void blank_screen_t(unsigned long dummy);
 static void set_palette(struct vc_data *vc);
 
 static int printable;          /* Is console ready for printing? */
-static int default_utf8;
+#ifdef CONFIG_VT_UNICODE
+int default_utf8 = 1;
+#else
+int default_utf8;
+#endif
 module_param(default_utf8, int, S_IRUGO | S_IWUSR);
 
 /*
index 6c7384afff13ceeba11c6f4d8cdbfc15e959b0a4..e6f89e8b9258429fc99754ec492918d94089bcfd 100644 (file)
@@ -1125,7 +1125,7 @@ int vt_waitactive(int vt)
 void reset_vc(struct vc_data *vc)
 {
        vc->vc_mode = KD_TEXT;
-       kbd_table[vc->vc_num].kbdmode = VC_XLATE;
+       kbd_table[vc->vc_num].kbdmode = default_utf8 ? VC_UNICODE : VC_XLATE;
        vc->vt_mode.mode = VT_AUTO;
        vc->vt_mode.waitv = 0;
        vc->vt_mode.relsig = 0;
index 699b7e9864fa8c675c5c9d3d677bf59a1a872c21..feb5e99a1079c97c0854669fcf46fcca595ab5f3 100644 (file)
@@ -87,6 +87,7 @@ extern int unbind_con_driver(const struct consw *csw, int first, int last,
 extern char con_buf[CON_BUF_SIZE];
 extern struct mutex con_buf_mtx;
 extern char vt_dont_switch;
+extern int default_utf8;
 
 struct vt_spawn_console {
        spinlock_t lock;