Bug 153459 - [kbdmux][patch] add option to specify built-in keymap
Summary: [kbdmux][patch] add option to specify built-in keymap
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 9.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: Ed Maste
URL:
Keywords: vt
: 194744 (view as bug list)
Depends on:
Blocks: 203349
  Show dependency treegraph
 
Reported: 2010-12-27 00:20 UTC by swell.k
Modified: 2016-04-21 19:26 UTC (History)
6 users (show)

See Also:
op: mfc-stable10?


Attachments
a.diff (2.81 KB, patch)
2010-12-27 00:20 UTC, swell.k
no flags Details | Diff
Patch for kbdmux_dflt_keymap.patch to add dual-constype keymap location awareness. (1.13 KB, patch)
2014-09-26 07:53 UTC, Harald Schmalzbauer
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description swell.k 2010-12-27 00:20:08 UTC
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.
Comment 1 Harald Schmalzbauer 2014-09-23 10:12:42 UTC
This highly appreciated enhancement needs comitting!
Some problems with _DFLT_KEYMAP option and dual console types showed up in the mean time, please see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193865
To adopt the same here, the following path to the patch should fit:

--- kbdmux_dflt_keymap.patch    2014-09-23 11:48:42.000000000 +0200
+++ kbdmux_dflt_keymap-dual-constype.patch      2014-09-23 12:05:54.000000000 +0200
 @@ -52,6 +52,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"                   \
++      compile-with    "unset KEYMAP_PATH; for kmpath in ${S:S/sys$/share/}/vt/keymaps ${S:S/sys$/share/}/syscons/keymaps; do kmapfile=$${kmpath}/${KBDMUX_DFLT_KEYMAP:C/\.kbd$$//}.kbd; if [ -r $${kmapfile} ]; then KEYMAP_PATH=$${kmpath}; fi; done; if [ X$${KEYMAP_PATH} != X ]; then env KEYMAP_PATH=$${KEYMAP_PATH} /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; else echo Error: kbdmux_dflt_keymap not found; exit 1; fi"
 +      no-obj no-implicit-rule before-depend                           \
 +      clean           "kbdmuxmap.h"
  usbdevs.h                     optional usb                               \
Comment 2 Harald Schmalzbauer 2014-09-26 07:53:12 UTC
Created attachment 147682 [details]
Patch for kbdmux_dflt_keymap.patch to add dual-constype keymap location awareness.

Please ignore the pasted patch-patch, there's a newline-escape "\" missing at the and of "kbdmux_dflt_keymap not found; exit 1; fi"
Comment 3 op 2016-03-15 20:08:58 UTC
Ahh, sorry, looked into wrong PR. Yes, it's a dup of 153459.
Comment 4 Ed Maste freebsd_committer 2016-03-21 17:42:34 UTC
*** Bug 194744 has been marked as a duplicate of this bug. ***
Comment 5 Ed Maste freebsd_committer 2016-03-22 20:36:33 UTC
In https://reviews.freebsd.org/D5708 there's a simplification of the compile-time keymap generation command line. Once that's complete I plan to commit a version of this change.
Comment 6 commit-hook freebsd_committer 2016-04-07 20:13:08 UTC
A commit references this bug:

Author: emaste
Date: Thu Apr  7 20:12:46 UTC 2016
New revision: 297685
URL: https://svnweb.freebsd.org/changeset/base/297685

Log:
  Add option to specify built-in keymap for kbdmux

  PR:		153459
  Submitted by:	swell.k@gmail.com

Changes:
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/options
  head/sys/dev/kbdmux/kbdmux.c
  head/sys/modules/kbdmux/Makefile
Comment 7 commit-hook freebsd_committer 2016-04-21 19:25:54 UTC
A commit references this bug:

Author: emaste
Date: Thu Apr 21 19:25:34 UTC 2016
New revision: 298430
URL: https://svnweb.freebsd.org/changeset/base/298430

Log:
  MFC r297685: Add option to specify built-in keymap for kbdmux

  PR:		153459
  Submitted by:	swell.k@gmail.com

Changes:
_U  stable/10/
  stable/10/sys/conf/NOTES
  stable/10/sys/conf/files
  stable/10/sys/conf/options
  stable/10/sys/dev/kbdmux/kbdmux.c
  stable/10/sys/modules/kbdmux/Makefile