linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Karl O. Pinc" <kop@meme.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: Udev rule for HSDPA modem
Date: Fri, 05 Dec 2008 04:54:20 +0000	[thread overview]
Message-ID: <1228452860l.9275l.0l@mofo> (raw)
In-Reply-To: <bed87e0b812045212a08a0c9ef4a06b2.squirrel@kone.netland.fin>


On 12/04/2008 08:53:46 PM, Kay Sievers wrote:
> On Thu, Dec 4, 2008 at 20:11, Greg KH <greg@kroah.com> wrote:

> 
> Yeah, that's intentional for by-id/, it should be independent of the
> order of plug-in and the physical location it is plugged in, so the
> usual case where you have only one device, or devices with proper
> serial numbers, you always find it with exactly the same link name.

> 
> > $ tree /dev/serial/
> > /dev/serial/
> > |-- by-id
> > |   |-- usb-Inside_Out_Networks_Edgeport_8_V12124599-if00-port0 ->
> ../../ttyUSB8

Why is it that the symlink is a single name, and not a path?

On the one hand it's probably because that's the way other
parts of udev work, which is a good reason to leave the design well
enough alone.

But I'm drawn to having a path like:

/dev/serial/by-id/usb/Inside_Out_Networks/Edgeport_8/V12124559/if00/port0

The last component would be the actual symlink.

It makes the name painless to parse and is just as easy to type.
To parse the one-big-name approach, in the general case,
you'd have to be sure that - does not appear in the strings
supplied by the device.  (The answer's probably obvious to
someone who's read the udev manual, but still....)

Come to think of it even better would be (shamelessly
adding a new "kind" of tree):

/dev/serial/by-label/bus.usb/make.Inside_Out_Networks/model.Edgeport_8/serial.V12124559/iface.if00/port.port0

What's nice here is that if a component is missing it still can have
an element in the tree.  If you wanted to omit missing elements,
if there was a missing serial number for instance, then it'd
be more basename friendly to put the labels into the directory
components as suffixes, like:

/dev/serial/by-label/usb.bug/Inside_Out_Networks.make/Edgeport_8.model/V12124559.serial/if00.iface/port0.port

Maybe this info is exposed elsewhere.  This is from the perspective
of someone who always winds up going in circles when rooting through
/sys/.

Karl <kop@meme.com>
Free Software:  "You don't pay back, you pay forward."
                  -- Robert A. Heinlein

      parent reply	other threads:[~2008-12-05  4:54 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-28 17:56 Udev rule for HSDPA modem Jar
2008-11-28 18:51 ` Greg KH
2008-11-29  8:00 ` Jar
2008-11-29 17:37 ` Greg KH
2008-11-30  5:21 ` Kay Sievers
2008-12-03  6:45 ` Greg KH
2008-12-03  9:27 ` Kay Sievers
2008-12-03 12:12 ` Kay Sievers
2008-12-03 15:11 ` Kay Sievers
2008-12-03 17:06 ` Karl O. Pinc
2008-12-03 17:37 ` Kay Sievers
2008-12-03 18:49 ` Karl O. Pinc
2008-12-03 23:10 ` Greg KH
2008-12-03 23:54 ` Kay Sievers
2008-12-04  0:04 ` Greg KH
2008-12-04  0:12 ` Kay Sievers
2008-12-04  0:40 ` Greg KH
2008-12-04  1:14 ` Kay Sievers
2008-12-04  6:28 ` Jar
2008-12-04  7:23 ` Kay Sievers
2008-12-04 14:22 ` Jar
2008-12-04 15:27 ` Karl O. Pinc
2008-12-04 18:56 ` Greg KH
2008-12-04 19:11 ` Greg KH
2008-12-05  2:53 ` Kay Sievers
2008-12-05  4:54 ` Karl O. Pinc [this message]

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=1228452860l.9275l.0l@mofo \
    --to=kop@meme.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).