You are not logged in.

#1 2018-01-02 16:46:57

Gunther74
Member
Registered: 2018-01-02
Posts: 3

[Solved] Trouble setting the propper keymap layout

Hello,

I am trying to install Arch for the first time. I used several linux distro before though. (Suse 7 as the 1rst i believe)
I been following the installation guide and im at the point my system boots from the harddrive.
I have not installed X yet i want to fix all isues first but i having alot of trouble to get my keyboard right.

I have a Belgium keyboard
manualy i can run loadkeys /usr/share/kbd/keymaps/i386/azerty/be-latin1.map.gz

Allso i have edited the /etc/locale.gen and ran locale-gen

my /etc/vconsole.conf holds
KEYMAP=be-latin1

/etc/locale.conf holds
KEYMAP=be-latin1
LANG=be_BY.UTF-8

localectl output
System Locale: LANG=be_BY.UTF-8
VC Keymap: be-latin1
X11 Layout: n/a

this after i ran loadkeys.

Anyone got a idea how i can fix this?

Last edited by Gunther74 (2018-01-05 14:07:35)

Offline

#2 2018-01-02 17:02:14

Gunther74
Member
Registered: 2018-01-02
Posts: 3

Re: [Solved] Trouble setting the propper keymap layout

localectl output exactely the same after a reboot without using loadkeys

Offline

#3 2018-01-04 09:59:25

andreas_baumann
Administrator
From: Zurich, Switzerland
Registered: 2017-08-10
Posts: 833
Website

Re: [Solved] Trouble setting the propper keymap layout

I can reproduce this on Archlinux32. The question is, does it happen on 64-bit too?

Offline

#4 2018-01-04 13:21:54

redqueen
Member
Registered: 2017-12-27
Posts: 21

Re: [Solved] Trouble setting the propper keymap layout

andreas_baumann wrote:

I can reproduce this on Archlinux32. The question is, does it happen on 64-bit too?

The quick answer is: NO!

Have the same Issue on Archlinux32, on x64 works fine setting up manually  /etc/vconsole.conf and /etc/locale.conf. Same with localectl on x64.

Offline

#5 2018-01-04 13:49:21

andreas_baumann
Administrator
From: Zurich, Switzerland
Registered: 2017-08-10
Posts: 833
Website

Re: [Solved] Trouble setting the propper keymap layout

redqueen, thanks for confirming that (both the bug on 32-bit and the working on 64-bit).
I'll have a look but I find it rather odd that loading a keymap should be architecture-specific..
Let me dig into systemd and see where the problem could be.

Offline

#6 2018-01-04 16:43:45

andreas_baumann
Administrator
From: Zurich, Switzerland
Registered: 2017-08-10
Posts: 833
Website

Re: [Solved] Trouble setting the propper keymap layout

So, starting to debug the problem (testing with sg-latin1 in as keyboard layout):

systemctl status systemd-vconsole-setup.service

systemd-vconsole-setup.service - Setup Virtual Console
   Loaded: loaded (/usr/lib/systemd/system/systemd-vconsole-setup.service; static; vendor preset: disable
   Active: inactive (dead)
     Docs: man:systemd-vconsole-setup.service(8)
           man:vconsole.conf(5)

Enabling the 'debug' kernel/ramdisk boot option shows:

Jan 04 16:36:10 arch32 systemd-vconsole-setup[189]: Executing "/usr/bin/loadkeys -q -C /dev/tty1 -u sg-latin1"...
Jan 04 16:36:10 arch32 systemd-vconsole-setup[189]: /usr/bin/loadkeys succeeded.

But I also see:

Jan 04 16:36:10 arch32 systemd-udevd[182]: '/usr/lib/systemd/systemd-vconsole-setup'(err) 'gzip: error while loading shared libraries: cannot restore segment prot after reloc: Operation not permitted'

and on an earlier run:

Jan 04 09:47:00 arch32 systemd-vconsole-setup[196]: KD_FONT_OP_GET failed while trying to get the font metadata: Input/output error
Jan 04 09:47:00 arch32 systemd-vconsole-setup[196]: Fonts will not be copied to remaining consoles

Offline

#7 2018-01-04 16:44:57

andreas_baumann
Administrator
From: Zurich, Switzerland
Registered: 2017-08-10
Posts: 833
Website

Re: [Solved] Trouble setting the propper keymap layout

May be related to https://bugzilla.redhat.com/show_bug.cgi?id=1001411.

Indeed, calling:

/usr/lib/systemd/systemd-vconsole-setup

manually loads the correct keymap.

Sadly this all confirms my prejudice against systemd and the development process. :-(

A shell script (let's call it '/etc/initrc') which 'loadkeys sg-latin1' would most likely work just fine, but adding a
ramdisc, dracut, kernel parameters overriding a config file which can be written
with a tool (localectl) is just enough "design" to go wrong in beatiful ways. :-)

Offline

#8 2018-01-04 16:53:37

andreas_baumann
Administrator
From: Zurich, Switzerland
Registered: 2017-08-10
Posts: 833
Website

Re: [Solved] Trouble setting the propper keymap layout

It's a combination of whether you use KVM or not, when the vconsole-setup deamon is started.
If started too soon, the console fonts (and most likely the keymaps) do not exist yet. So they
can be added to the ramdisk or the start of the vconsole-setup can maybe be delayed.

Offline

#9 2018-01-04 16:54:20

andreas_baumann
Administrator
From: Zurich, Switzerland
Registered: 2017-08-10
Posts: 833
Website

Re: [Solved] Trouble setting the propper keymap layout

What puzzles me is that loadkeys is called and succeeds, it should at least say something,
if it cannot find the keyboard map file.

Offline

#10 2018-01-04 16:58:55

andreas_baumann
Administrator
From: Zurich, Switzerland
Registered: 2017-08-10
Posts: 833
Website

Re: [Solved] Trouble setting the propper keymap layout

Aha:

gunzip /usr/share/kbd/keymaps/i386/qwertz/sg-latin1.map.gz

solved the problem for me. So loadkeys tries to un-gzip the keymap file and
fails due to permission issues.

Offline

#11 2018-01-04 17:01:01

andreas_baumann
Administrator
From: Zurich, Switzerland
Registered: 2017-08-10
Posts: 833
Website

Re: [Solved] Trouble setting the propper keymap layout

Which leads to the question: why 32-bit only? and who is de-gzipping the keymap file?
It's not loadkeys itself (function lk_findfile)..

Offline

#12 2018-01-04 17:08:43

andreas_baumann
Administrator
From: Zurich, Switzerland
Registered: 2017-08-10
Posts: 833
Website

Re: [Solved] Trouble setting the propper keymap layout

Sounds like a security issue:

gzip: error while loading shared libraries: cannot restore segment prot after reloc: Operation not permitted

So gzip gets executed at a point where certain things are not allowed or not available (ld.so cache?)

Offline

#13 2018-01-04 17:10:55

andreas_baumann
Administrator
From: Zurich, Switzerland
Registered: 2017-08-10
Posts: 833
Website

Re: [Solved] Trouble setting the propper keymap layout

Ah. Damn:

src/libkeymap/findfile.c:       { ".gz", "gzip -d -c" },

So, loadkeys calls gzip -d -c when loading the keymap file.

Offline

#14 2018-01-04 17:28:45

andreas_baumann
Administrator
From: Zurich, Switzerland
Registered: 2017-08-10
Posts: 833
Website

Re: [Solved] Trouble setting the propper keymap layout

So, for now, (and short): use gunzip on the keymapfile you want to use.

For long term, we should get into discussions about full/partial relro and why gzip runs
after startup and not while running inside systemd-vconsole (and of course, why and or if this
should be different on 64-bit and 32-bit ELF).

Offline

#15 2018-01-04 17:43:56

andreas_baumann
Administrator
From: Zurich, Switzerland
Registered: 2017-08-10
Posts: 833
Website

Re: [Solved] Trouble setting the propper keymap layout

And I'll have to order the "Big Book about ELFs" and read it. :-)

Offline

#16 2018-01-05 14:07:05

Gunther74
Member
Registered: 2018-01-02
Posts: 3

Re: [Solved] Trouble setting the propper keymap layout

Wow Anreas,
I lost you allready after the first few posts.
However, i unziped the keymap and it worked.
Nice figureing a workaround. Looking forward to a permanent solution.

On to the next isue, ive seen some more problems in the log, someting like power button and GMA500 graphics driver.
I remember the GMA500 problems, i had some problems with that in Ubuntu aswell.
Anyway Ill try to find solutions my self first for my learning process.

Thanks alot for this fix, changed topic to solved.

Last edited by Gunther74 (2018-01-05 14:08:01)

Offline

#17 2018-03-02 11:34:33

maiux
Member
Registered: 2018-03-02
Posts: 1

Re: [Solved] Trouble setting the propper keymap layout

I confirm that bug is still present in archlinux-2018.03.01-i686.iso and workaround (gunzip needed keymap file) works as a charm.

Thanks!

Offline

#18 2018-03-04 10:55:07

WyRe
Member
Registered: 2018-03-03
Posts: 19

Re: [Solved] Trouble setting the propper keymap layout

I've used a different workaround, as you can see here

I've added keymap hook to HOOKS line in mkinitcpio file.

Offline

#19 2018-08-30 17:30:59

ula8000
Member
Registered: 2017-12-27
Posts: 11

Re: [Solved] Trouble setting the propper keymap layout

Thanks,
mkinitcpio is the better way and works fine!
It is update safe and also provides for encrypted systems the correct keyboard setting.

Offline

Board footer

Powered by FluxBB