[systemd-devel] systemd numbers for Debian Sid/unstable system

Colin Guthrie gmane at colin.guthr.ie
Thu Jun 28 18:00:22 PDT 2012


'Twas brillig, and Lennart Poettering at 28/06/12 12:21 did gyre and gimble:
> On Thu, 28.06.12 07:54, Tollef Fog Heen (tfheen at err.no) wrote:
> 
> Heya,
> 
>>> On Wed, 27.06.12 21:59, Tollef Fog Heen (tfheen at err.no) wrote:
>>>
>>>>
>>>> ]] Lennart Poettering 
>>>>
>>>>> Hmm, the other distributions have an #ifdef TARGET_FOOBAR section in
>>>>> vconsole-setup for that. Debian currently doesn't. I'd be willing to add
>>>>> a patch that parses the old DEbian configuration files, to implement the
>>>>> fallback.
>>>>
>>>> We use the X11 keyboard definitions.  Are you sure you want to
>>>> completely reimplement console-setup? :-)
>>>
>>> Ah, hmm. I heard of that. Can you explain how precisely that works? Do
>>> you actually use the same keybaord definitions, i.e. have converted them
>>> to console definitions? Or do you just share the same naming namespace?
>>
>> console-setup reads the xkb definitions and downsamples them to
>> something the console can understand.  IIRC, it doesn't work for the
>> most complex keymaps and the cases where you have multiple keymaps
>> defined which you can switch between, but it works well in the simple
>> case of one language.  (IIRC, this is due to kernel limitations in how
>> many keys can be defined and such.  Also, I don't think the kernel
>> understands Compose.)
> 
> Ah, pretty cool. I have now added an item to the TODO list, so that we
> support this scheme natively in localed and systemd-vconsole-setup. It
> appears the much better solution over what we are currently using to
> setup the kbd on Fedora.

Hmm, this reply comes at an interesting time, considering our discussion
recently on IRC :)


FWIW, I finally figured out how we do our keyboards. We keep the
keyboard layout in /etc/sysconfig/keyboard (we use separate vars for X
vs. console). This is then read in via udev rule
/lib/udev/rules.d/61-x11-input.rules which triggers a script which
pushes the xkb variables into the udev database.

I'm not saying it's beautiful, but the principle of pushing the settings
into udev (presumably such that X's evdev can read the settings out from
udev later?) seems like a nice idea. It would allow for a generic config
file that could be used for all keymapping stuff and it begin used for
vconsole and X rather than splitting them over /etc/vconsole.conf and
/etc/X11/xorg.conf.d/00-keyboard.conf.

Although I guess if you want to avoid a shell script being imported into
udev it's likely just a choice between reading/writing a static udev
rule in /etc or the xorg.conf snippet, in which case both are much of a
muchness (unless Wayland also uses these udev keys in which case the
udev approach is arguably better).


Here's the files for reference:

61-x11-input.rules:
SUBSYSTEM!="input", GOTO="x11_input_end"
ACTION!="add",      GOTO="x11_input_end"
KERNEL!="event*",   GOTO="x11_input_end"

ENV{ID_INPUT_KEY}=="1", IMPORT{program}="/sbin/mageia-setup-keyboard --udev"

LABEL="x11_input_end"



mageia-setup-keyboard:

#!/bin/sh
#
# Trivial egregious hack to load the console keyboard layout into XKB.
#

. /etc/sysconfig/keyboard > /dev/null 2> /dev/null || exit 0

if [ -z "$XkbLayout" ]; then
    [ -x /usr/sbin/keyboarddrake ] || exit 0
    /usr/sbin/keyboarddrake --migrate
    . /etc/sysconfig/keyboard
fi

[ -n "$XkbLayout" ] || exit 0

if [ "$1" = "--udev" ]; then
    [ -z "$XkbModel" ]    || echo "xkbmodel=$XkbModel"
    [ -z "$XkbLayout" ]   || echo "xkblayout=$XkbLayout"
    [ -z "$XkbVariant" ]  || echo "xkbvariant=$XkbVariant"
    [ -z "$XkbOptions" ]  || echo "xkboptions=$XkbOptions"
else
    # We're being called stand-alone
    # This will only work if we're root
    [ -x /sbin/udevadm ] && /sbin/udevadm trigger
--subsystem-match=input --action=add
fi






-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/





More information about the systemd-devel mailing list