[systemd-devel] Programmatically setting udev properties

Peter Hutterer peter.hutterer at who-t.net
Thu Jan 29 14:12:54 PST 2015


Hi,

I need some sort of way of assigning udev properties on the fly to a device,
but I'm short of ideas how to do this sensibly.

A bit more context:
The libinput test suite works by setting up uinput devices for each test
case, then hooking libinput contexts up to those devices. libinput itself
uses some udev properties to adjust internal behaviours. That works for real
hardware because the rules are written for that (and we can require a make
install) but uinput devices don't have the same hierarchy and thus don't
trigger those rules. Plus, requiring an install before running the test
suite isn't very nice.

So basically what I'd like would be a udev_device_set_property() call or
something similar.  We're in control of the uinput and the libinput bits,
i.e. there are no race conditions to worry about. 

Because of uinput, the test suite runs as root. One solution would be to
drop a custom test rule, reload, create the uinput device, run the test,
rm the rule again. Not pretty though, I was hoping there was something
nicer.

Any ideas?

Cheers,
  Peter


More information about the systemd-devel mailing list