Discussion:
udev: attributes rules to identical devices
Theo
2014-01-15 14:15:43 UTC
Permalink
Hello everybody,

I am working with Kubuntu 13.10.
I need to assign permanent names to some modems that I am working with.
This would be possible by creating a rule in /etc/udev/rules.d/ and defining
a symlink, something like this:

KERNEL=="ttyUSB[0-9]*", ATTRS{serial}=="0000:00:1d.0", SYMLINK="Modem0"

The problem is that all these modems have the same serial, so I cannot
distinguish them and cannot assign a different symlink to each one.

If it can help, the output of lsusb with two modems connected is this:

Bus 006 Device 002: ID 0403:6001 Future Technology Devices International, Ltd
FT232 USB-Serial (UART) IC
Bus 005 Device 002: ID 0403:6001 Future Technology Devices International, Ltd
FT232 USB-Serial (UART) IC

Is there a way to do this?
Thanks.

Theo

--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Greg KH
2014-01-15 14:26:54 UTC
Permalink
Post by Theo
Hello everybody,
I am working with Kubuntu 13.10.
I need to assign permanent names to some modems that I am working with.
This would be possible by creating a rule in /etc/udev/rules.d/ and defining
KERNEL=="ttyUSB[0-9]*", ATTRS{serial}=="0000:00:1d.0", SYMLINK="Modem0"
The problem is that all these modems have the same serial, so I cannot
distinguish them and cannot assign a different symlink to each one.
Bus 006 Device 002: ID 0403:6001 Future Technology Devices International, Ltd
FT232 USB-Serial (UART) IC
Bus 005 Device 002: ID 0403:6001 Future Technology Devices International, Ltd
FT232 USB-Serial (UART) IC
You should already have some links in /dev/serial/ right? Why not use
those?

Otherwise you are going to have to use the USB path, but if USB
enumerates them in a different order next time you boot, the paths are
going to be different. You should bug your vendor about putting unique
serial numbers in them, that's the only "real" way to do this correctly,
sorry.

Hope this helps,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Greg KH
2014-01-15 15:11:21 UTC
Permalink
Thank you for your prompt reply.=A0
I have already /dev/ttyUSB0, /dev/ttyUSB1, they are enumerated progre=
ssively
following a chronological plug in order.
And what is showing up in /dev/serial/ ?
Fortunately I can use permanent USB port names, but I was wondering i=
f
permanent names were possible even without an ATTRS{serial}.
How would that be possible if there is no way to tell the devices apart=
?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug=
" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Loading...