From owner-freebsd-current@freebsd.org Thu Dec 17 11:59:35 2015 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 410A9A4A59A for ; Thu, 17 Dec 2015 11:59:35 +0000 (UTC) (envelope-from clbuisson@orange.fr) Received: from smtp.smtpout.orange.fr (smtp12.smtpout.orange.fr [80.12.242.134]) by mx1.freebsd.org (Postfix) with ESMTP id B9B3217A1 for ; Thu, 17 Dec 2015 11:59:34 +0000 (UTC) (envelope-from clbuisson@orange.fr) Received: from localhost ([90.50.135.113]) by mwinf5d47 with ME id ubrs1r00D2SxzLy03brsuT; Thu, 17 Dec 2015 12:51:56 +0100 X-ME-Helo: localhost X-ME-Date: Thu, 17 Dec 2015 12:51:56 +0100 X-ME-IP: 90.50.135.113 Subject: Re: keymap set after file system decryption To: =?UTF-8?Q?Trond_Endrest=c3=b8l?= , Kevin Oberman References: <37578766.236860.1450260266870.JavaMail.ngmail@webmail18.arcor-online.net> <271086927.242379.1450280096357.JavaMail.ngmail@webmail18.arcor-online.net> Cc: Carsten Kunze , FreeBSD Current From: Claude Buisson Message-ID: <5672A1D8.8090602@orange.fr> Date: Thu, 17 Dec 2015 12:51:52 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 11:59:35 -0000 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 >>> wrote: >>> >>>> Trond Endrestøl 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 code >>>>> page, courtesy of IBM, 1981. >>>> >>>> In 1981 I had accepted this. Now it's simply a bug and I wonder it has >>>> 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 be >>>> ok that at the boot prompt only US keymap is set. But when the rc scripts >>>> are running the keymap must be set correctly (as one of the first actions). >>>> >>>>> A bad workaround is to copy the suitable keymap from /usr/share... to >>>>> /etc, along with /usr/sbin/kbdcontrol, and add a suitable line to one >>>>> 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` >>>>> /usr/sbin/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. >>>> >>>> Carsten >>>> >>> >>> 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 -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -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 > /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. Claude Buisson