Create a symlink in /dev using /etc/udev/rules
Few points
Used
75-
, the rules run in order. There is a chance that your rule may overridden by next rules from/lib/udev/rules.d/
, prefer to use99-
~90-
-
SUBSYSTEM=="usb", SYMLINK+="myusb"
too genericIt match all event actions
add
,remove
&change
. Beside all USB devices. May be you should make it more strict.Check using
lsusb
Bus 003 Device 003: ID 0461:4d81 Primax Electronics, Ltd Dell N889 Optical Mouse
and add them:
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0461", ATTRS{idProduct}=="4d81", SYMLINK+="myusb"
Not all devices create a node in
/dev
. (Could you mention what type of devices you have used)-
Bonus :), even so the rule still broad concerning tree device nodes. When you plug camera there is not only one node created but many from tree root to the leaf (leaf is in most cases the wanted one). Check:
udevadm info -a /dev/video0
The previous modified rule may match two last nodes (not the leaf).