4

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.

  • FWIW, it looks like you're supposed to use SYMLINK instead, even with this old version of udev. I don't think that's the problem though. – sourcejedi May 1 '18 at 20:54
  • @sourcejedi Thanks, I'll change to SYMLINK to follow a standard, but you're right it did not solve this issue. I guess I will try using a new version of udev. – Dark May 1 '18 at 20:58
  • 1
    I... elided some context. The reason BB has a 2011 version of udev will be because it was among the last standalone versions of udev. And possibly they wanted not to depend on devtmpfs, which udev version 176 does. (In that version it stopped letting you set NAME at all). I haven't found a reason to expect that there's a problem with the specific version you're using. – sourcejedi May 1 '18 at 21:04
  • All I can think is to enable the debug logging and see what it says. AFAIK it should end up in the openwrt system log. You might end up wanting to increase log_size. – sourcejedi May 1 '18 at 22:02
  • @sourcejedi looks like I get a few "user.err syslog: Unkown action change" errors, so the trigger command is obviously not working – Dark May 1 '18 at 23:01
0

I had 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 is managed the kernel. You should instead use SYMLINKS+=... to create symlik to that device. I think it better suits your purpose.

  • This environment is different. IIUC udev 173 still begrudgingly allowed you to set NAME, and also the comments show this answer did not solve the problem. – sourcejedi Feb 4 at 16:13
  • We have at least one Q/A that covers it, so I won't ask you to open a new question to hold your answer :-). unix.stackexchange.com/questions/270179/… – sourcejedi Feb 4 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.