Monday, February 4, 2013

udev tip

From time to time I have to write some udev rules but I always struggle to work out which magic strings are required.

It does not help that every version of udev seems to change everything.

I have found a command for modern versions which helps work out what is required:

udevadm info -e

From there you can find out everything there is available to identify your devices.

The udev 'rule' is then a series of commands separated by a comma (,). You can test for equality with == and set properties with either = or :=. When you use := your value can not be overridden by another rule. For example:

SUBSYSTEM=="video4linux", MODE:="0666"

Will match all video devices and set the permissions to be world read write.

If you save that into a file called /etc/udev/rules.d/99-v4l2.rules
you can then apply it with the command:
udevadm trigger

There is much more which can be done but that is enough to get started. The names of the keys which can be set is actually listed in the man page man 7 udev but it be quite confusing to follow without examples.

Next time I have to work on flashcache I will try and blog about the new GOTO style rules :-(


  1. It is important to describe these news.

  2. This is also a very good post which I really enjoyed reading. It is not everyday that I have the possibility to see something like this.
    atari breakout

  3. I was working and suddenly I visits your site frequently and recommended it to me to read also. The writing style is superior and the content is relevant. Thanks for the insight you provide the readers!
    stick rpg 2

  4. My essay was causing me trouble with finals due not long after. I asked for an essay help and it was completed urgent essay writing service very quickly and well in advance of the deadline I paid for. Would use again.