Stick USB modem to specific /dev/ link

1

I have up to 4 USB GSM modems from different providers. When I plug it,udev/usbmodeswitch makes a symlink to each device at /dev/gsmmodem, /dev/gsmmodem2 and so on.

I need to make the symlink name for each modem to be permanent. So if I plug modem3 it always symlinks to /dev/gsmmodem3, even when there is no other modems attached.

I've tried create udev rule for this but these do not seem to work:

ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1506", SUBSYSTEMS=="usb", KERNEL=="ttyUSB%n", SYMLINK="gsmmodem1_%n"

ATTRS{idVendor}=="1410", ATTRS{idProduct}=="6000", SUBSYSTEMS=="usb", KERNEL=="ttyUSB%n", SYMLINK="gsmmodem2_%n"

How do I build a correct udev rule or is there a better way to do this?

Oleg Nesterov

Posted 2013-09-02T12:41:00.207

Reputation: 11

for now, best way I've found - use usb_modeswitch's symlinks in /dev/serial/by-id/ – Oleg Nesterov – 2013-09-03T13:48:39.840

No answers