Udevadm rule works using “udevadm test” but not with “udevadm trigger”

openwrtttyudev

I have created a simple rule called "99-usb.rules" that simply names a tty port of a specific device

KERNEL=="ttyACM*", ATTRS{idVendor}=="2341", NAME="mydevice"

This rule works fine when I run a udevadm test with the command

udevadm test $(udevadm info -q path -n /dev/ttyACM0)

Running this command causes "/dev/mydevice" to appear, and I can communicate with my usb device through "mydevice". The problem is, I can't get this rule to be triggered outside of the test environment. I have tried "udevadm control -R" and "udevadm trigger" aswell as disconnecting and reconnecting the device and rebooting my system. Any ideas why "udevadm trigger" would fail? I am using udev version 173 on OS OpenWrt Barrier Breaker 14.07.

Best Answer

I had a similar issue on my linux systems. I eventually found out the NAME option is severely underpowered, as it only works with network interfaces. It has no effects on disk drives, TTYs, and other stuff, that are managed by the kernel. You should instead use SYMLINK+=... to create a symlink to that device. I think it better suits your purpose.

Related Question