On 12/17/2015 16:44, Trond Endrestøl wrote:
On Thu, 17 Dec 2015 13:56+0100, Trond Endrestøl wrote:

On Thu, 17 Dec 2015 12:51+0100, Claude Buisson wrote:

On 12/17/2015 12:21, Trond Endrestøl wrote:
On Thu, 17 Dec 2015 11:56+0100, Trond Endrestøl wrote:

On Wed, 16 Dec 2015 16:34-0800, Kevin Oberman wrote:

On Wed, Dec 16, 2015 at 7:34 AM, Carsten Kunze <carsten.ku...@arcor.de>

Trond Endrestøl <trond.endres...@fagskolen.gjovik.no> wrote:

I guess we who live outside the US should take into account that PCs
are initialised by firmware to the US keyboard layout and the 437
page, courtesy of IBM, 1981.

In 1981 I had accepted this.  Now it's simply a bug and I wonder it
not been fixed in 22 years.  I'll file a bug report.

I'm not sure if the creators of (U)EFI has considered other keyboard
layouts and/or code pages at boot time.

I don't care for the BIOS here, the OS has to take care of it.  It may
ok that at the boot prompt only US keymap is set.  But when the rc
are running the keymap must be set correctly (as one of the first

A bad workaround is to copy the suitable keymap from /usr/share...
/etc, along with /usr/sbin/kbdcontrol, and add a suitable line to
or either of /etc/rc.d/geli{,2}, e.g.:

/etc/kbdcontrol -l /etc/german.iso.kbd

kbdcontrol is linked only to libc:

$ ldd `which kbdcontrol`
          libc.so.7 => /lib/libc.so.7 (0x800827000)

In my case it's simpler since I have /usr in /, but as you descripted
kbdcontrol must be in /sbin and the maps in /etc in the future.


You can specify your default keymap in your kernel config file.
ATKBD_DFLT_KEYBD. It's possible that you might be able to set it in
/boot/loader.conf, as well, but I'm not too sure of this. See atkbd(4).

I can confirm that neither ATKBD_DFLT_KEYMAP nor UKBD_DFLT_KEYMAP, nor
SC_DFLT_FONT for that matter, works as intended.

I have never had any success with:

options         SC_DFLT_FONT
makeoptions     SC_DFLT_FONT=iso

options         UKBD_DFLT_KEYMAP
makeoptions     UKBD_DFLT_KEYMAP=norwegian.iso

options         ATKBD_DFLT_KEYMAP
makeoptions     ATKBD_DFLT_KEYMAP=norwegian.iso

Please prove me wrong.

A recent run in stable/10 using r292334, resulted in:

--- ukbd.o ---
cc  -c -O2 -pipe -fno-strict-aliasing  -std=c99 -g -Wall -Wredundant-decls
-Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith
-Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions
-Wmissing-include-dirs -fdiagnostics-show-option
-Wno-error-tautological-compare -Wno-error-empty-body
-Wno-error-parentheses-equality -Wno-error-unused-function   -nostdinc  -I.
-I/usr/src/sys -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/libfdt
-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mno-aes -mno-avx
-mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float
-fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -gdwarf-2
/usr/src/sys/dev/usb/input/ukbd.c:1216:18: error: use of undeclared
identifier 'key_map'
          sc->sc_keymap = key_map;
/usr/src/sys/dev/usb/input/ukbd.c:1217:18: error: use of undeclared
identifier 'accent_map'
          sc->sc_accmap = accent_map;

If your system is configured with VT and not syscons, there exists no
such thing as norwegian.iso(.kbd), but you must use no(.kbd).
See /usr/share/vt/keymaps/INDEX.keymaps.

Furthermore, with VT, there is a chance that the system is configuerd
with kbdmux, which makes things more complicated. There exist patches in
bugzilla adding support of keyboard definitions to kbdmux.

OK, so kbdcontrol(8) depends on the active console driver, be it sc or
vt, and kbdcontrol(8) searchs for the files in either
/usr/share/syscons/keymaps or /usr/share/vt/keymaps.

In my case there's virtually no difference between norwegian.iso.kbd
for sc and no.kbd for vt.

Anyway, I learned something today, and I finally got Norwegian
keyboard layout in my kernel.

Well, not quite. A stable/10 kernel (r292399) configured as below did
not exhibit a Norwegian keyboard layout when booted in single user
mode. :-/


options         UKBD_DFLT_KEYMAP
makeoptions     UKBD_DFLT_KEYMAP=no

options         ATKBD_DFLT_KEYMAP
makeoptions     ATKBD_DFLT_KEYMAP=no

Instead of getting the letters æ ø å when hitting on those keys on a
USB keyboard, I got the characters ' ; [, in the spirit of US

Full multi user mode works as expected with


in /etc/rc.conf.

/usr/obj/usr/src/sys/KERNEL/atkbdmap.h begins with:

  * Automatically generated from /usr/share/vt/keymaps/no.kbd.
static keymap_t key_map = { 0x6d, {

The same goes for ukbdmap.h in the same directory.

Nothing seems to be wrong with the generated .h files.

Alas, the options and makeoptions for selecting a default keymap does
not work, at least not for USB keyboards.

As I said above, if you use vt, and kbdmux (which is standard and even
mandatory to be able to use Xorg), specifying the keymap for atkbd and
usbkbd is useless..

Have a look at PR 194744 by Oliver Pinter


This PR is now more than 1 year old, and nothing has been done: people
using non-US keyboard are not popular here..

Claude Buisson

freebsd-current@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to