Use HID_ID to match devices instead of USB specific sysfs attributes#912
Use HID_ID to match devices instead of USB specific sysfs attributes#912hadess wants to merge 3 commits intonetworkupstools:masterfrom
Conversation
See https://lwn.net/Articles/837033/ for an in-depth explanation of how "bind" events should be handled in udev rules. In short: " The ACTION line causes the entire file to be skipped for anything other than ADD or CHANGE events; in particular, that is what will happen with BIND events. That will cause properties associated with those events to be lost — and the device in question to be set up improperly (if at all). "
|
(This definitely doesn't work, I'll do some more debugging in a bit, at least the matching isn't right...) |
Instead of matching on the USB device. This makes it easier to use hid-record and hid-replay to emulate HID UPS devices.
Why "!= usb" when we're already checking for usb and other values above? Always go to the end label if we didn't already jump to the section containing the actual rules.
028f248 to
82f78b7
Compare
|
And now it should work once https://gitlab.freedesktop.org/libevdev/hid-tools/-/issues/25 gets fixed. The hiddev device isn't getting instantiated right now. |
|
I've split off the fixes I made in #913 This MR should have been about using Ideally, the NUT code would be migrated to use hidraw, so the codepath would be the same for USB UPSes, and "replayed" devices. That's not the case as of now though, and I don't have the bandwidth to work on that right now. |
|
Thanks for giving this a try! If you get the bandwidth for this later, possibly after we choose and merge one of the libusb-1.x integration branches, seems like it would be a useful to a higher-level dummy-ups. |
For future reference: I haven't looked at upower, but NUT (primarily the |
This should make it possible to use
hid-recorderandhid-replayto emulate UPSes.See https://gitlab.freedesktop.org/libevdev/hid-tools/-/issues/25
@bentiss, does this look correct to you?
(I haven't tested this beyond checking that the generated files look correct)