From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oli Date: Tue, 18 Oct 2005 23:35:40 +0000 Subject: Re: How do assign specific nodes to 2-port USB-to-serial adapter? Message-Id: <1129678540.8138.98.camel@localhost.localdomain> List-Id: References: <1129675265.43557a0137b76@webmail.grandecom.net> In-Reply-To: <1129675265.43557a0137b76@webmail.grandecom.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Hey J, On Tue, 2005-10-18 at 17:41 -0500, J McBane wrote: > Greetings, > > My USB-to-serial adapter (gives me 2 serial ports) is currently being named > ttyUSB0 and ttyUSB1. I would like to change the name of the nodes to test0 and > test1, for example. > > I understand how to normally accomplish this, except this device shares the same > serial number and ID, according to "udevinfo -a -p /sys/class/tty/ttyUSB0" and > "udevinfo -a -p /sys/class/tty/ttyUSB1". > > I don't know how to tell udev/hotplug how to differentiate between the two > serial ports. > > The best I can come up with is the following, which only gives me a test0 node > (and no ttyUSB nodes): > BUS="usb", SYSFS{serial}="V32408622-0", NAME="test0" > BUS="usb", SYSFS{serial}="V32408622-0", NAME="test1" > You could try a little something like this: BUS="usb", SYSFS{serial}="V32408622-0", NAME="%k", SYMLINK="test%n" Or if you're feeling cheeky, maybe you could: BUS="usb", SYSFS{serial}="V32408622-0", NAME="%k", SYMLINK="%s{serial}% n" With a bit of digging around in sysfs, I'm sure you could find something more meaningful to put in the symlink name than 'serial'. You're probably being a bit restrictive by putting the whole serial in there. It'd be better to use something like model number. Have a look at the udev manual page. All sorts of fun stuff in there :0) Check the version of udev you're running too - I know the '%s' stuff was patched a bit some time ago - v0.75ish, IIRC ? Also note that the rules will (I think) stop at the first match. This is why your test1 device never gets created. Hope this helps. Cheers, -Oli ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel