Bug 552926 - livecd install asks for keyboard layout
Summary: livecd install asks for keyboard layout
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 13
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Ales Kozumplik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-06 15:16 UTC by Hans de Goede
Modified: 2014-09-30 23:38 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-16 13:21:19 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
prototype code I tried to use to determine the default layout (3.61 KB, application/zip)
2010-03-16 13:24 UTC, Ales Kozumplik
no flags Details

Description Hans de Goede 2010-01-06 15:16:09 UTC
I just did a F-12 livecd test install (dmraid) and it asked me for my keyboard layout. But the correct behavior for the livecd is that it uses the system keyboard and language.

Comment 1 Ales Kozumplik 2010-01-13 14:46:17 UTC
Hi Jonathan,

I am writing to you as the owner of xorg-x11-xkb-utils and xkeyboard-config. I am from the anaconda team, working on the live installer, specifically the bug 552926. What I need to fix this is a way to map the default keyboard in gnome (or kde or xfce) to the console keyboard layout code, like the ones in the first column here:

https://fedorahosted.org/system-config-keyboard/browser/trunk/lib/keyboard_models.py#L92

My first attempt was using gconf to retrive the default layout and the corresponding xlayout and variant. This is not a general enough solution though as we also need to support desktop environments based on KDE, xfce etc. which might not have gconf installed. In other words, what is needed is a mechanism that finds the keyboard directly from X. I tried:
setxkbmap -print 

but it contains no information about what keyboard is the default (to see this, try adding three different keyboards in gnome and then switch the default one couple of times: the setxkbmap output is always the same).

I'd like to ask you whether there's another way to accomplish this (that is: "find the corresponding console key layout given the default key layout in X"). If you are not the right person then please let me know who is.

Thanks,
Ales

Comment 2 Bug Zapper 2010-03-15 13:46:07 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 13 development cycle.
Changing version to '13'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 3 Ales Kozumplik 2010-03-16 13:21:19 UTC
There seems to be no way of telling what keyboard layout did the user select, or even what the default keyboard layout is:

1) In GNOME, one can't use gconf to obtain the information, security mechanisms won't allow us: anaconda runs under the root and so can't read gconf of the liveuser. Two hacks could be put in place to circumvent this:
1.a) directly read the gconf XMLs in liveuser's home. The desktop team tells me the practice of storing gconf data in XMLis going to be abolished one day and so would this solution.
1.b) change the liveinst script to determine the information before the user id is changed to root. This would be possible and I had a working patch for this (lost by now, simple enough to recreate), but it was generally frowned upon by both anaconda and desktop developers.

2) Note that none of the options under 1) are portable enough to work under different desktops. That's actually a requirement because currently we support at least Gnome, KDE and Xfce. An alternative is to use an XKB libarary. Using libxklavier, I made prototypes in both C and Python (attached in the .zip) that output the current layouts and variants the X is running with. Note that there is no API in libxklavier to tell what variant is the active/default/preferred! What we could only rely on is that the set of options new windows are created with is always at the same index. This is however not reliable:
2.a) in fedora 13 alpha in Gnome, when System->Preferences->Keyboard is used, the default keyboard will end up in the index 0 in the arrays returned by libxklavier.
2.b) in fedora 13 alpha in GDM, when a keyboard layout is selected before user is logged in, it ends up at index 1 in the arrays returned by libxklavier, with the US keyboard at index 0.
Again, as far as I know there is no way of knowing (without e.g. using the hack from 1.b)) what the default keyboard really is.

There are further (although less severe) problems: for instance system-config-keyboard that anaconda uses won't allow us to unambiguously map the X layout to one of the layouts system-config-keyboard knows about. So any fix we can come up with at this point would probably only result in moving the focus field in the keyboard window in anaconda on the option that would be the best guess (as opposed to actually correctly select the keyboard and not display the window at all).

I am closing this bug as won't fix. Anyone please reopen it in case you know of a way to reliably determine the default keyboard layout across different Desktops.

Comment 4 Ales Kozumplik 2010-03-16 13:24:44 UTC
Created attachment 400462 [details]
prototype code I tried to use to determine the default layout


Note You need to log in before you can comment on or make changes to this bug.