linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: Problem parsing %s in udev rules
Date: Fri, 15 Oct 2004 18:45:38 +0000	[thread overview]
Message-ID: <20041015184538.GA15315@kroah.com> (raw)
In-Reply-To: <1097105584.9273.9.camel@bluto.andrew>

On Thu, Oct 14, 2004 at 02:05:49PM -0600, Andrew Patterson wrote:
> > > > > I also wonder if it might be a good idea to do some sort of
> > > > > transformation for characters in an attribute that are illegal in a file
> > > > > system, rather than just chopping everything off. e.g, spaces that are
> > > > > not leading or trailing would be changed to underscores.
> > > > 
> > > > ick, no.
> > > 
> > > Really?  Care to elaborate? 
> > > 
> > > Do you not like any transformation (besides the "let's chop off
> > > everything after anything illegal") or just the underscores for spaces
> > > one?  Perhaps a configuration value to make it optional? This sort of
> > > thing might relieve a lot of the script writing that must be done to
> > > handle cases that may be common.
> > 
> > Have you run into any cases where something like this is needed?  I
> > don't really want to do any transformation within udev itself if
> > possible, as it's a slippery slope down...  Helper programs can be used
> > if people run into anything really nasty, and the fact that this hasn't
> > come up yet, lends me to belive it really isn't a problem.  
> > 
> > Do you have any device that would need such transformation?
> 
> Need, no.  Want perhaps.  Example: using the following rule:
> 
> BUS="scsi", KERNEL="sd*", NAME="%k", SYMLINK="scsi_disks/%s{vendor}-%
> s{model}"
> 
> I have this stupid disk drive that has the following vendor and model
> entry:
> 
> Vendor: HP 36.4G Model: ST336753LC
> 
> So the resulting device file created by udev is
> /dev/scsi_disks/HP-ST336753LC
> 
> Intuitively, I would expect /dev/scsi_disks/HP 36.4G-ST336753LC.
> Given that spaces are bad, it would be be nice to see something like:
> 
> /dev/scsi_disks/HP_36.4G-ST336753LC.

Then I suggest you use a helper program to create such an insane name :)
Seriously, there are a load of better things to use to create a name,
than a vendor provided string.

> Is the %s stuff used a lot?

I think in this manner, no.

thanks,

greg k-h


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.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

      parent reply	other threads:[~2004-10-15 18:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-06 23:33 Problem parsing %s in udev rules Andrew Patterson
2004-10-06 23:50 ` Kay Sievers
2004-10-07  0:23 ` Andrew Patterson
2004-10-07  0:30 ` Kay Sievers
2004-10-12 23:04 ` Andrew Patterson
2004-10-12 23:58 ` Greg KH
2004-10-13 23:13 ` Andrew Patterson
2004-10-13 23:56 ` Greg KH
2004-10-14 20:05 ` Andrew Patterson
2004-10-15 18:45 ` Greg KH [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=20041015184538.GA15315@kroah.com \
    --to=greg@kroah.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).