
Feature changed by: Stefan Dirsch (sndirsch) Feature #318355, revision 9 Title: Convert X keyboard layouts to console keymaps openSUSE Distribution: Unconfirmed Priority Requester: Mandatory Requested by: Mindaugas Baranauskas (embar-) Partner organization: openSUSE.org Description: In systemd world we use localectl. Mapping between console and X keyboards is complicated. I creates bugs (e.g. https://bugzilla.novell.com/show_bug.cgi?id=897803) after switching from legacy /etc/X11/xdm/Keyboard.map mapping in to new systemd /usr/share/systemd/kbd-model-map mapping. Indeed most console keyboards are obsolete, they are difficult to configure, as each layout requires specific correct parameters for kbd_mode and setfont. And YaST also have some additional mapping: /usr/share/YaST2/data/keyboard_raw.ycp. We must change essentially keyboard management in YaST. We could use Fedora solution by converting X keymaps to console keymaps to simplify keyboard issues. Use Case: As discussed in https://bugs.freedesktop.org/show_bug.cgi?id=88545, Fedora has many more console layouts, converted from X keyboard layouts with script: # Convert X keyboard layouts to console keymaps mkdir -p $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb perl xml2lst.pl < /usr/share/X11/xkb/rules/base.xml > layouts-variants.lst while read line; do XKBLAYOUT=`echo "$line" | cut -d " " -f 1` echo "$XKBLAYOUT"
layouts-list.lst XKBVARIANT=`echo "$line" | cut -d " " -f 2` ckbcomp "$XKBLAYOUT" "$XKBVARIANT" | gzip > $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/"$XKBLAYOUT"-"$XKBVARIANT".map.gz done < layouts-variants.lst # Convert X keyboard layouts (plain, no variant) cat layouts-list.lst | sort -u >> layouts-list-uniq.lst while read line; do ckbcomp "$line" | gzip > $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/"$line".map.gz done < layouts-list- uniq.lst Full spec file: https://apps.fedoraproject.org/packages/kbd/sources/spec/ Fedora moved upstream layouts to /usr/lib/kbd/keymaps/legacy/ .
Discussion: #1: Stefan Dirsch (sndirsch) (2015-07-21 15:20:21) Finally I found the time to work on this. :-) Current result you can find in obs://home:sndirsch:fate318355. I've created a console-setup package, since SUSE was still lacking the ckbcomp tool to convert xkeyboard-layout keymaps to console keymaps. I've adjusted kbd package to convert xkeyboard-layout keymaps to console keymaps, which makes use of this tool. Original kbd keymaps I've moved to legacy directory and now they are last in loadkeys' search path, i.e. xkb converted ones are preferred. Also in kbd package I've created additional entries for systemd's mapping console keymap <-> X keymap. In systemd package I append these entries to systemd's /usr/share/systemd/kbd-model-map table. What's still missing are the adjustments in YaST. Do we want to adjust YaST in a way so the existing console keymaps are replaced with the converted xkb keymaps? Or do we want to add new entries to the YaST list and still use the old legacy keymaps for the current list? Or maybe both? I'm not sure here. Seems there are 3 files, which need adjustments. lang2keyboard.ycp, xkblayout2keyboard.ycp, keyboard_raw. ycp in /usr/share/YaST2/data. Not sure how these are connected togehter exactly. I would like to see a proposal here preferrably by the YaST developer(s). Mapping table console keyboard <-> X keyboard is now available in systemd's /usr/share/systemd/kbd-model-map. Everything YaST specific can now be based on that information. #2: Stefan Dirsch (sndirsch) (2015-07-21 15:23:14) Jiri Suchomel. I've found your email address in lang2keyboard.ycp. Can you help here? #3: Jiří Suchomel (jsuchome) (2015-07-21 16:08:28) (reply to #2) I've already asked for this years ago in fate #309487. So I think it's good there's time for it now. However, I'm not yast2- country maintainer any more. Please ask Jiri Srain or Lukas who should work on YaST side of this. #4: Stefan Dirsch (sndirsch) (2015-07-28 15:28:58)
Hope you didn't miss FATE#318426. A feature often requested by YaST development and finally being possible to implement. But now I would need the input of YaST developers (see my comment #15). Without your input I don't know how to continue there. :-(
Also I don't know what all these different keyboad mapping variants mean in keyboard_raw.ycp. Apart from the "pc104" there is also "macintosh", "type4", "type5", "type5_euro". Are they still being used by YaST?
Any help would be appreciated. Hi Stefan,I'm also adding Ancor, who has changed the code recently and (Major) part of the current implementation has been created by Jiri Suchomel, so I believe he'll be so kind and answer your questions. Moreover, I'm also adding Ancor, who has changed the code recently and thus should also have a knowledge about the implementation there. Bye Lukas Ocilka, Systems Management (Yast) Team Leader
#5: Mindaugas Baranauskas (embar-) (2015-08-18 20:45:27) Nice to hear, that the is progress. I hope in openSUSE Leap 42.1 YaST will provide selection of keyboard layouts, that are X and console compatible (i.e. using console keymaps, converted from X). + #6: Stefan Dirsch (sndirsch) (2015-08-19 10:11:23) (reply to #5) + Good news. Everything is now put in place for tumbleweed, i.e. package + change requrests done (console-setup, kbd, systemd, yast2-country and + yast2-x11). Once this is in and has been tested we can continue with + Leap/42, then sle12-sp2. -- openSUSE Feature: https://features.opensuse.org/318355