From swell.k@gmail.com Mon Dec 27 00:19:34 2010 Return-Path: Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27E57106566C for ; Mon, 27 Dec 2010 00:19:34 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id D98428FC12 for ; Mon, 27 Dec 2010 00:19:33 +0000 (UTC) Received: by ywp6 with SMTP id 6so3860303ywp.13 for ; Sun, 26 Dec 2010 16:19:33 -0800 (PST) Received: by 10.150.230.19 with SMTP id c19mr16148026ybh.2.1293409173106; Sun, 26 Dec 2010 16:19:33 -0800 (PST) Received: from localhost (ip24-56-60-42.ph.ph.cox.net [24.56.60.42]) by mx.google.com with ESMTPS id u5sm11570301yba.10.2010.12.26.16.19.28 (version=SSLv3 cipher=RC4-MD5); Sun, 26 Dec 2010 16:19:32 -0800 (PST) Message-Id: <86oc88dq6b.fsf@gmail.com> Date: Mon, 27 Dec 2010 03:18:04 +0300 From: Anonymous To: FreeBSD-gnats-submit@freebsd.org Subject: [kbdmux][patch] add option to specify built-in keymap >Number: 153459 >Category: kern >Synopsis: [kbdmux][patch] add option to specify built-in keymap >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Dec 27 00:20:08 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Anonymous >Release: FreeBSD 9.0-CURRENT amd64 >Organization: >Environment: - single user mode - a user unable to use anything but his custom dvorak keymap - the code/comments are borrowed from atkbd/ukbd >Description: A user has to rely on kbdmux(4) for - ddb(4) - newcons(4) - sysutils/uhidd, cc_attach So, provide a way similar to (ATKBD|SUNKBD|UKBD)_DFLT_KEYMAP to specify default keymap(5) for kbdmux(4) to reduce pain when switching drivers. >How-To-Repeat: >Fix: --- a.diff begins here --- Index: sys/conf/files =================================================================== --- sys/conf/files (revision 216710) +++ sys/conf/files (working copy) @@ -107,6 +107,10 @@ compile-with "${AWK} -f $S/teken/gensequences $S/teken/sequences > teken_state.h" \ no-obj no-implicit-rule before-depend \ clean "teken_state.h" +kbdmuxmap.h optional kbdmux_dflt_keymap \ + compile-with "/usr/sbin/kbdcontrol -L ${KBDMUX_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > kbdmuxmap.h" \ + no-obj no-implicit-rule before-depend \ + clean "kbdmuxmap.h" usbdevs.h optional usb \ dependency "$S/tools/usbdevs2h.awk $S/dev/usb/usbdevs" \ compile-with "${AWK} -f $S/tools/usbdevs2h.awk $S/dev/usb/usbdevs -h" \ Index: sys/conf/options =================================================================== --- sys/conf/options (revision 216710) +++ sys/conf/options (working copy) @@ -754,6 +757,8 @@ KBD_MAXWAIT opt_kbd.h KBD_RESETDELAY opt_kbd.h KBDIO_DEBUG opt_kbd.h + +KBDMUX_DFLT_KEYMAP opt_kbdmux.h # options for the Atheros driver ATH_DEBUG opt_ath.h Index: sys/dev/kbdmux/kbdmux.c =================================================================== --- sys/dev/kbdmux/kbdmux.c (revision 216710) +++ sys/dev/kbdmux/kbdmux.c (working copy) @@ -33,6 +33,7 @@ #include "opt_compat.h" #include "opt_kbd.h" +#include "opt_kbdmux.h" #include #include @@ -54,6 +55,14 @@ #include #include #include + +/* the initial key map, accent map and fkey strings */ +#ifdef KBDMUX_DFLT_KEYMAP +#define KBD_DFLT_KEYMAP +#include "kbdmuxmap.h" +#endif + +/* the following file must be included after "kbdmuxmap.h" */ #include #define KEYBOARD_NAME "kbdmux" Index: sys/modules/kbdmux/Makefile =================================================================== --- sys/modules/kbdmux/Makefile (revision 216710) +++ sys/modules/kbdmux/Makefile (working copy) @@ -4,7 +4,7 @@ .PATH: ${.CURDIR}/../../dev/kbdmux KMOD= kbdmux -SRCS= kbdmux.c opt_compat.h opt_kbd.h bus_if.h device_if.h +SRCS= kbdmux.c opt_compat.h opt_kbd.h opt_kbdmux.h bus_if.h device_if.h .if !defined(KERNBUILDDIR) opt_compat.h: Index: sys/conf/NOTES =================================================================== --- sys/conf/NOTES (revision 216710) +++ sys/conf/NOTES (working copy) @@ -1373,6 +1373,10 @@ options KBD_DISABLE_KEYMAP_LOAD # refuse to load a keymap options KBD_INSTALL_CDEV # install a CDEV entry in /dev +device kbdmux # keyboard multiplexer +options KBDMUX_DFLT_KEYMAP # specify the built-in keymap +makeoptions KBDMUX_DFLT_KEYMAP=it.iso + options FB_DEBUG # Frame buffer debugging device splash # Splash screen and screen saver support --- a.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: