kern/153459: [kbdmux][patch] add option to specify built-in keymap

Anonymous swell.k at gmail.com
Mon Dec 27 00:20:09 UTC 2010


>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 <sys/param.h>
 #include <sys/bus.h>
@@ -54,6 +55,14 @@
 #include <sys/taskqueue.h>
 #include <sys/uio.h>
 #include <dev/kbd/kbdreg.h>
+
+/* 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 <dev/kbd/kbdtables.h>
 
 #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:


More information about the freebsd-bugs mailing list