Bug 903776

Summary: Installer dropped my keyboard layout, preventing me from logging in after rebooting
Product: Red Hat Enterprise Linux 7 Reporter: Jay Fenlason <fenlason>
Component: systemdAssignee: Michal Sekletar <msekleta>
Status: CLOSED ERRATA QA Contact: Petr Sklenar <psklenar>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: jfeeney, jscotka, lnykryn, msekleta, nigjones, pv.bugzilla, systemd-maint-list, tbeattie
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: systemd-208-12.el7 Doc Type: Bug Fix
Doc Text:
Cause: Bug in algorithm for mapping X11 keyboard layouts to console layouts, implemented as part of systemd-localed Consequence: If US keyboard layout was selected with dvorak variant then on the first boot keyboard layout for console was set to us instead of dvorak. Fix: When converting between X11 keyboard layouts to console layouts we now consider empty model as a wildcard. (Note: we fixed the algorithm and exactly how is not important for users, no need to have elaborate explanation of fix) Result: Keyboard layout on the first boot is set to dvorak.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 11:08:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jay Fenlason 2013-01-24 20:10:15 UTC
Description of problem:
During the install, I told the installer to use the English language with a Dvorak layout.  It used dvorak during the install.  When it rebooted the keyboard was not in dvorak, so I could not type "root" or my password.

Version-Release number of selected component (if applicable):


How reproducible:
haven't tried

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 2 Vratislav Podzimek 2013-01-28 11:25:04 UTC
(In reply to comment #0)
> Description of problem:
> During the install, I told the installer to use the English language with a
> Dvorak layout.  It used dvorak during the install.  When it rebooted the
> keyboard was not in dvorak, so I could not type "root" or my password.
What do you mean by "when it rebooted"? Was it in firstboot, GDM/KDE or did you have minimal install? In either case everything Anaconda can do is write out right /etc/vconsole.conf and /etc/X11/xorg.conf.d/00-anaconda-keyboard.conf files. Could you please attach those files from your malfunctioning system? (you can always use vconsole.keymap="us" as command line argument to get 'us' keymap on virtual console)

Comment 3 Jay Fenlason 2013-01-28 17:00:25 UTC
after the install finished, the machine rebooted.  I was only offered the choice of minimal install by the installer, so there was no gnome/kde/firstboot, just a text console.

/etc/vconsole.conf contains only
KEYMAP="us"

/etc/X11/xorg.conf.d/00-anaconda-keyboard.conf contains
Section "InputClass"
	Identifier	"anaconda-keyboard"
	MatchIsKeyboard	"on"
	Option	"XkbLayout"	"us"
	Option	"XkbVariant"	"dvorak"
EndSection
With no trailing newline.

I eventually managed to work around the problem by modifying the kernel line in the grub configuration file to include "vconsole.keymap=dvorak" which allowed me to type "root", my root password, etc. after the system booted.

Comment 4 Vratislav Podzimek 2013-01-29 09:10:55 UTC
(In reply to comment #3)
> after the install finished, the machine rebooted.  I was only offered the
> choice of minimal install by the installer, so there was no
> gnome/kde/firstboot, just a text console.
> 
> /etc/vconsole.conf contains only
> KEYMAP="us"
> 
> /etc/X11/xorg.conf.d/00-anaconda-keyboard.conf contains
> Section "InputClass"
> 	Identifier	"anaconda-keyboard"
> 	MatchIsKeyboard	"on"
> 	Option	"XkbLayout"	"us"
> 	Option	"XkbVariant"	"dvorak"
> EndSection
> With no trailing newline.
I've just pushed the patch adding the newline.

> 
> I eventually managed to work around the problem by modifying the kernel line
> in the grub configuration file to include "vconsole.keymap=dvorak" which
> allowed me to type "root", my root password, etc. after the system booted.
Yeah, unfortunately this was the only workaround. You can change /etc/vconsole.conf contents to 'KEYMAP='dvorak' to get the right VConsole keymap for your system.

Overall issue here is that there is no simple matching between X layouts and VConsole keymaps. Anaconda uses systemd-localed to get the matching VConsole keymap for given X layout and vice versa. Obviously the mapping in systemd-localed is far from ideal, but to be honest it is impossible to have correct mapping for all X layouts and all VConsole keymaps. Thus this is being resolved in a more general way in bug #837292.

Reassigning to systemd, but I'm not sure anyone will fix this particular case.

Comment 5 Phil V 2013-03-07 05:18:55 UTC
I had the same experience with installer dropping the dvorak keymap.
In the installer I set dvorak as the primary keymap and us as the secondary.
It passed this information onto GNOME but set the virtual consoles to 'us'.


It seems to me that the installer (anaconda) should either

(1) use the primary keymap as default for the virtual consoles. 
 or
(2) ask which keymap to use in vconsole and which keymap to use in X

I understand that there are a profusion of layouts in many languages and it's impossible to match them all up. 
However matching up dvorak in vconsole with dvorak in X should be a first step.

Comment 6 Lennart Poettering 2013-08-06 16:12:00 UTC
So, For F20 I hope to get rid of the console keymaps and always use X11 maps. However, that's probably not ready for RHEL7. So instead, we should probably fix the mapping.

localed uses /usr/share/systemd/kbd-model-map to find the closest console keymap match for the combination of X11 keymap parameters. For that it matches the X11 keymap parameters (layout, model, variant, options) against this list, and checks for layout first, model second, variant, third, and finally options. The closes match wins. Now, as anaconda doesn't output the model pc105 model anymore this translataion prefers "us" over "dvorak" on the grounds that that's then closer.

When looking for a match we should probably consider an unset model as a wildcard...

Comment 8 Petr Sklenar 2014-03-07 08:55:51 UTC
I switch into dvorak during anaconda installation and dvorak was there - I was able to write password and username by dvorak layout.
But after the installation finished and machine was reboot then dvorak was away.

see configs :

cat /etc/vconsole.conf
KEYMAP="us"
FONT="latarcyrheb-sun16"

# cat /etc/X11/xorg.conf.d/00-keyboard.conf 
# Read and parsed by systemd-localed. It's probably wise not to edit this file
# manually too freely.
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us"
        Option "XkbVariant" "dvorak"
EndSection

Comment 9 Petr Sklenar 2014-03-07 08:56:40 UTC
^ used systemd-208-5.el7.x86_64

Comment 11 Michal Sekletar 2014-06-03 13:03:35 UTC
*** Bug 960298 has been marked as a duplicate of this bug. ***

Comment 17 errata-xmlrpc 2015-03-05 11:08:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0509.html