Sample Header Ad - 728x90

Handle mouse and keyboard usb device in udev

1 vote
0 answers
1157 views
I'm trying to set up usbip on our thin clients to forward (almost all) USB devices to the server. What I don't want to forward are all input devices and all hub / virtual devices. So I want to exclude everything with vendor id 1d6b (Linux Foundation) together with input devices. My first attempt was ATTRS{idVendor}=="1d6b", GOTO="do_nothing" ENV{ID_INPUT_MOUSE}=="?*", GOTO="do_nothing" ENV{ID_INPUT_KEYBOARD}=="?*", GOTO="do_nothing" KERNEL=="?-?"", ACTION=="add", SUBSYSTEM=="usb", RUN+="/usr/local/sbin/add_usbip.sh $kernel" LABEL="do_nothing" However, for reasons I do not understand, the first GOTO is always triggered, resulting in no behavior at all. I then tried KERNEL=="?-?", ACTION=="add", SUBSYSTEM=="usb", ENV{ID_INPUT_MOUSE}!="?*", ENV{ID_INPUT_KEYBOARD}!="?*", RUN+="/usr/local/sbin/add_usbip.sh $kernel" and similarly KERNEL=="?-?"", ACTION=="add", SUBSYSTEM=="usb", ENV{ID_INPUT}!="?*", RUN+="/usr/local/sbin/add_usbip.sh $kernel" which I assumed to be correct based on the scarce documentation I found, but they will just also run for input devices, rendering the keyboard unusable since it is exported to the server. Note that it does not help me to add specific serials or vendor and product ids since the keyboards and mice and other input devices may vary from client to client.
Asked by Xoph (111 rep)
Mar 4, 2015, 06:01 PM