linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oli <ocomber@cmedresearch.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: How do assign specific nodes to 2-port USB-to-serial adapter?
Date: Tue, 18 Oct 2005 23:35:40 +0000	[thread overview]
Message-ID: <1129678540.8138.98.camel@localhost.localdomain> (raw)
In-Reply-To: <1129675265.43557a0137b76@webmail.grandecom.net>


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

  reply	other threads:[~2005-10-18 23:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-18 22:41 How do assign specific nodes to 2-port USB-to-serial adapter? J McBane
2005-10-18 23:35 ` Oli [this message]
2005-10-19 15:20 ` Oli
2005-10-19 17:41 ` J McBane

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1129678540.8138.98.camel@localhost.localdomain \
    --to=ocomber@cmedresearch.com \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).