[systemd-devel] update: udev keymaps are moving to hwdb

Kay Sievers kay at vrfy.org
Wed Jul 10 14:38:12 PDT 2013


We need to cut down the use of udev rules, and move all hardware
matches to the magnitudes more efficient hardware database. Udev rules
were not meant to carry out huge lists of sequential matches against
hardware IDs, this model just doesn't scale too well.

The keymaps are the first, other users like libsane, libgphoto, media
player, ... should be converted too.

The systemd git source tree has now all the pieces to prepare the move
from the current keymap handling to the hardware database. None of it
will take any action at the moment, the hwdb file is not committed.

All keymap scan/key code pairs, and the force-release lists will move
into the file:
  /usr/lib/udev/hwdb.d/60-keyboard.hwdb

The input device will import the keymap data into the udev database like:
  $ udevadm test /class/input/event5
  ...
  KEYBOARD_KEY_01=screenlock
  KEYBOARD_KEY_02=battery
  KEYBOARD_KEY_03=sleep
  KEYBOARD_KEY_04=wlan
  KEYBOARD_KEY_06=switchvideomode
  KEYBOARD_KEY_07=f21
  KEYBOARD_KEY_08=f24
  KEYBOARD_KEY_0b=suspend
  KEYBOARD_KEY_0f=brightnessup
  KEYBOARD_KEY_10=brightnessdown
  ...

There is a new builtin "keyboard" which will read these keys and
install them into the kernel device.

The force-release flag is carried as '!' in front of the key identifier like:
  KEYBOARD_KEY_78=mail
  KEYBOARD_KEY_82=!switchvideomode
  KEYBOARD_KEY_83=!battery

After all keymap data is moved to the 60-keyboard.hwdb file, all
current keymap files, force-release files, the keymap binary, the udev
rule and the force-release shell script will be removed from the
source tree.

Attached is the current version of the hwdb file, which is not
committed to the source tree. It contains maybe 30% of the old keymaps
and should cover all of the force-release lists. The header of the
file carries some documentation.

Some data like USB devices with too broad and insufficient matches on
the USB strings instead of the USB IDs cannot be ported over and need
to be reworked if they are still needed.

Any help or testing would be more than welcome to get that thing
properly working.

Thanks,
Kay
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 60-keyboard.hwdb
Type: application/octet-stream
Size: 20193 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20130710/a1d49a4c/attachment-0001.obj>


More information about the systemd-devel mailing list