Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2e8ecb9db0bcc19e1cc8bb51e9252fe6a86a9863
Commit:     2e8ecb9db0bcc19e1cc8bb51e9252fe6a86a9863
Parent:     430d275a399175c7c0673459738979287ec1fd22
Author:     Bill Nottingham <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 23:29:38 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Oct 17 08:42:56 2007 -0700

    add CONFIG_VT_UNICODE
    
    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 <[EMAIL PROTECTED]>
    Cc: Samuel Thibault <[EMAIL PROTECTED]>
    Cc: Dmitry Torokhov <[EMAIL PROTECTED]>
    Cc: Jiri Kosina <[EMAIL PROTECTED]>
    Cc: Alan Cox <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/char/Kconfig    |   17 +++++++++++++++++
 drivers/char/keyboard.c |    2 +-
 drivers/char/sysrq.c    |    4 ++--
 drivers/char/vt.c       |    6 +++++-
 drivers/char/vt_ioctl.c |    2 +-
 include/linux/vt_kern.h |    1 +
 6 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index f6f8c03..1232ace 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -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
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c
index 5ae2a32..212276a 100644
--- a/drivers/char/keyboard.c
+++ b/drivers/char/keyboard.c
@@ -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);
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c
index 179fa36..78d1493 100644
--- a/drivers/char/sysrq.c
+++ b/drivers/char/sysrq.c
@@ -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
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 0d56f8f..645ad98 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -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);
 
 /*
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
index 6c7384a..e6f89e8 100644
--- a/drivers/char/vt_ioctl.c
+++ b/drivers/char/vt_ioctl.c
@@ -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;
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index 699b7e9..feb5e99 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -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;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to