Created attachment 147589 [details] dual-constype keymap lookup for XXX_DFLT_KEYMAP, from sources Currently, when compiling a kernel for non-default (US) keyboard layouts, the instructions for generating the keymap header files for various keyboard types are defined in a way, that the process depends on the kbdcontrol(1) utility from the building host, which leads to the problem described in the next paragraph, but is unavoidable. But also the keymap files are referenced to the ones installed on the building machine, instead of those from the sources. This can be easily fixed. The attached patch incorporates that. More severe is the problem with keymap name limitations due to the dependency of the build machine's kbdcontrol(1) utility. If the keymap name, defined by the XXX_DFLT_KEYMAP config option, can't be found in the path corresponding to the build machine's active console, kernel compilation failes since no header file was generated! This means we cannot compile a vt keymap into a kernel on a machine that runs the sc console and vice versa. At compile time, it's not possible to determine which console (vt or sc) will be used later, so it's the responsibility of the operator to choose the matching keymap, which currently doesn't work. Defining _DFLT_KEYMAP option must not depend on the build host! Like mentioned above, it's the operator's responsibility defining the correct keymap name, but the header file generation must work independent of the active console type, so the lookup for the keymap file has to be done in both paths, vt's and sc's (share/vt/keymaps and share/syscons/keymaps)! The attached patch enhances the keymap file lookup and also fixes the usage of the keymap files installed (or not) on the host system, instead it uses the keymaps from sources.
Same problem at PR ports/193817 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193817
Bump to request review/commiting to head?
Updated to 11-CURRENT the affected version.
See also r270652, which removed the "band aid" that had kbdcontrol searching the syscons path also under vt.
A commit references this bug: Author: emaste Date: Tue Mar 15 13:38:16 UTC 2016 New revision: 296899 URL: https://svnweb.freebsd.org/changeset/base/296899 Log: Fix atkbdmap.h generation for sc/vt consoles Keymap header files have historically been generated using the build host's /usr/sbin/kbdcontrol and using the host's keymap files. However, that introduces an issue when building a kernel to use vt(4) on a system using sc(4), or vice versa: kbdcontrol searches for keymap files in the /usr/share subdirectory appropriate for the host, not the target. With this change the build searches both the and sc keymap directories from the source tree. PR: 193865 Submitted by: Harald Schmalzbauer Changes: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 head/sys/conf/files.sparc64
Thanks for taking care! Unforutnately, there seems to be a copy'n'paste error in my patch, affecting PC98. Note that I don't know anything about PC98, but for ukbdmak.h it's clear that it should read kmapfile=$${kmpath}/${UKBD_DFLT_KEYMAP:C/\.kbd$$//}.kbd instead of kmapfile=$${kmpath}/${ATKBD_DFLT_KEYMAP:C/\.kbd$$//}.kbd I'll attach a post-commit-patch which fixes that. Sorry for the poor quality patch.
Created attachment 168242 [details] Fix PC98 kmapfile vraiable after original patch was commited
A commit references this bug: Author: emaste Date: Tue Mar 15 17:32:30 UTC 2016 New revision: 296914 URL: https://svnweb.freebsd.org/changeset/base/296914 Log: Fix copy-n-pasteo in r296899 ukbdmap.h header generation for pc98 The ukbd default is specified by UKBD_DFLT_KEYMAP not ATKBD_DFLT_KEYMAP. PR: 193865 Submitted by: Harald Schmalzbauer Changes: head/sys/conf/files.pc98
> Thanks for taking care! > Unforutnately, there seems to be a copy'n'paste error in my patch, affecting PC98. Thanks for the followup and sorry it took so long to get to this. I have a proposed patch to kbdcontrol in review (https://reviews.freebsd.org/D5645) to add a -P <path> option that should allow a subsequent refinement of this change. Please look it over and comment if you have a chance.
*** Bug 193817 has been marked as a duplicate of this bug. ***
A commit references this bug: Author: emaste Date: Wed Mar 16 04:05:03 UTC 2016 New revision: 296926 URL: https://svnweb.freebsd.org/changeset/base/296926 Log: kbdcontrol: add -P path option to add keymap search paths PR: 193865 Reviewed by: cem Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5645 Changes: head/usr.sbin/kbdcontrol/kbdcontrol.1 head/usr.sbin/kbdcontrol/kbdcontrol.c
Please see https://reviews.freebsd.org/D5708 for a simplification of the compile-time keyboard map generation.
A commit references this bug: Author: emaste Date: Mon Mar 28 19:51:46 UTC 2016 New revision: 297363 URL: https://svnweb.freebsd.org/changeset/base/297363 Log: simplify compile-time default keyboard map generation In r296926 the -P <path> option was added to kbdcontrol, which enables this change for a simplified compile-time default keymap build process. PR: 193865 Reviewed by: Oliver Pinter Tested by: Oliver Pinter MFC After: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5708 Changes: head/Makefile.inc1 head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 head/sys/conf/files.sparc64
A commit references this bug: Author: emaste Date: Tue Apr 19 20:56:02 UTC 2016 New revision: 298297 URL: https://svnweb.freebsd.org/changeset/base/298297 Log: MFC r296926: kbdcontrol: add -P path option to add keymap search paths PR: 193865 Sponsored by: The FreeBSD Foundation Changes: _U stable/10/ stable/10/usr.sbin/kbdcontrol/kbdcontrol.1 stable/10/usr.sbin/kbdcontrol/kbdcontrol.c
A commit references this bug: Author: emaste Date: Thu Apr 21 19:24:37 UTC 2016 New revision: 298429 URL: https://svnweb.freebsd.org/changeset/base/298429 Log: Fix compiled-in keymap generation for sc/vt consoles In r298297 kbdcontrol's -P <path> option was MFC'd to stable/10, which enables this change for a simplified compile-time default keymap build process. PR: 193865 MFC of: r296899, r296914, r297363, r298402 Changes: _U stable/10/ stable/10/Makefile.inc1 stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/conf/files.pc98 stable/10/sys/conf/files.sparc64