1

I am trying to assign unique symlinks to USB hubs with the same vendor ID and product ID with no serial numbers assigned to them. I read this, which is a similar problem: Fixed udev rules for USB modems and associated chat: https://chat.stackexchange.com/rooms/8004/discussion-between-derobert-and-user777.

deroberto's answer to use the symlinks that exist in /dev/serial/by-path/ seems like it should work, but I cannot formulate a udev rule. It seems this should work:

SUBSYSTEM=="tty", ACTION=="add", DEV=="/dev/serial/by-path/pci-0000:00:14.0-usb-0:4.2.1:1.0-port0", SYMLINK+="mySymLink1"

or just

ACTION=="add", DEV=="/dev/serial/by-path/pci-0000:00:14.0-usb-0:4.2.1:1.0-port0", SYMLINK+="mySymLink1"

But I can't get anything to do it, for whatever reason. Any help is greatly appreciated. I would have just commented on deroberto's answer in the other thread, but I don't have enough reputation for that.

For reference

$ ls -l /dev/serial/by-path/*
rwxrwxrwx 1 root root 13 Jun 11 20:43 /dev/serial/by-path/pci-0000:00:14.0-usb-0:2:1.0-port0 -> ../../ttyUSB5
lrwxrwxrwx 1 root root 13 Jun 11 20:43 /dev/serial/by-path/pci-0000:00:14.0-usb-0:4.2.1:1.0-port0 -> ../../ttyUSB0
lrwxrwxrwx 1 root root 13 Jun 11 20:43 /dev/serial/by-path/pci-0000:00:14.0-usb-0:4.2.1:1.1-port0 -> ../../ttyUSB1
lrwxrwxrwx 1 root root 13 Jun 11 20:43 /dev/serial/by-path/pci-0000:00:14.0-usb-0:4.2.1:1.2-port0 -> ../../ttyUSB2
lrwxrwxrwx 1 root root 13 Jun 11 20:43 /dev/serial/by-path/pci-0000:00:14.0-usb-0:4.2.1:1.3-port0 -> ../../ttyUSB3
lrwxrwxrwx 1 root root 13 Jun 11 20:43 /dev/serial/by-path/pci-0000:00:14.0-usb-0:4.2.2:1.0-port0 -> ../../ttyUSB4
lrwxrwxrwx 1 root root 13 Jun 11 20:43 /dev/serial/by-path/pci-0000:00:14.0-usb-0:4.2.2:1.1-port0 -> ../../ttyUSB6
. 
.
.
lrwxrwxrwx 1 root root 14 Jun 11 20:43 /dev/serial/by-path/pci-0000:00:14.0-usb-0:4.2.4:1.3-port0 -> ../../ttyUSB16
1
  • you might have to use the devfs paths for usb bus; e.g. if lsusb output shows the device connected to Bus 001 Device 003, that would correspond to /dev/bus/usb/001/003 character device.
    – ILMostro_7
    Commented Sep 24, 2018 at 4:38

1 Answer 1

1

Here is a selector I'm using for USB-attached devices:

DEVPATH=="/devices/*.usb/usb1/1-1/1-1.[1-4]/dvb/dvb[0-9]*.*[0-8]"

1
  • Do you know if it is possible to deactivate only one of two devices that have in commen idVentor and idProduct? Please see my question.
    – Johan
    Commented Sep 12, 2023 at 8:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .