I agree that making rule match using VID/PID is not a definite solution. But you can much multiple devices in same rule without targeting blindly all USB devices the way you did. Example using DRIVER
name (usb-storage
, usbhid
,..) or KERNEL
name (tty*
, sd*
,..) even using minimal regex (sd[a-z][0-9]*
, usb*
).
You should look for similarities in their attributes.
- Remove all those devices
Save the current list of devices in /dev
ls /dev > /tmp/dev_list0.txt
Plug one of the target devices
Save the list of devices in another file
ls /dev > /tmp/dev_list.txt
Compare files, >
added device, <
removed device
$ colordiff /tmp/dev_list0.txt /tmp/dev_list.txt
85a86,87
> sdc
> serial
89a92,93
> sg4
> sg5
93a98
> sr1
194a200,201
> ttyUSB0
> ttyUSB1
This is a 3G modem.
Check the attribute for all interfaces you need, example:
udevadm info --attribute-walk --name=/dev/ttyUSB0
Do the same for all devices you want. If you can't figure out how, please upload their udevadm info --attribute-walk --name=...
output and link them to your question.
Note that, not all USB devices create a node in /dev
. Some you have look for them in SYSFS tree /sys
. Then check their attributes using --path
udevadm info --attribute-walk --path=...
Using same steps as above you can check which device nodes created by monitoring udev
events:
udevadm monitor
udev
is frustratingly opaque and poorly documented: I think you may need to use attributeSUBSYSTEMS
(plural) rather thanSUBSYSTEM
(singular). Someone might be able to give a better analysis if you edit your question to include the output ofudevadm info --attribute-walk /dev/xxx
where/dev/xxx
is the actual devpath of your device. – steeldriver Mar 12 '15 at 12:15/dev/
entry, so I don't know how to invokeudevadm
on it. All I have is bus, dev. number, VID and PID as shown bylsusb
(and name). – Violet Giraffe Mar 12 '15 at 12:55