All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephane Chauveau <s.chauveau@chello.nl>
To: linux-hotplug@vger.kernel.org
Subject: pattern matching in udev
Date: Sat, 29 Nov 2003 20:58:20 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-107013956514187@msgid-missing> (raw)

Hello,

did anyone considered the idea of using pattern matching in udev.

The current mecanism is nice but it requires an exact match. 

For example, I have a USB dual memory card reader which
produces 2 devices (such as /block/sda and /block/sdb). They
have the same characteristics (model, vendor,...). The only
difference is their bus 'id'  (N:0:0:0 and N:0:0:1 with N a scsi
host number). 

LABEL is useless because the 'keys' are identical and TOPOLOGY
is also not what I want because the scsi host are not constant.

The current solution is to use CALLOUT but a better way to do it
would be to add some simple pattern matching capabilities to udev.

For example using the usual * and ? :
 
LABEL, BUS="scsi", vendor="ImageMate CF-SM ", ID="*:0:0:0" ,  NAME="mem0-%n"
LABEL, BUS="scsi", vendor="ImageMate CF-SM ", ID="*:0:0:1" ,  NAME="mem1-%n"

Or even better using regular expressions that could be reused to build
the final name:

REGEXP "<$bus><$vendor><$id>"="<scsi><ImageMate.*><.*:0:0:\(.*\)>",
             NAME="mem\1-%n"

S. Chauveau






-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
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:[~2003-11-29 20:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-29 20:58 Stephane Chauveau [this message]
2003-12-01 16:59 ` pattern matching in udev Patrick Mansfield
2003-12-02  0:21 ` Greg KH
2003-12-04  9:51 ` Olaf Hering
2003-12-04 10:17 ` Chauveau S.
2003-12-04 10:29 ` Ihno Krumreich
2003-12-04 10:34 ` Olaf Hering

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=marc-linux-hotplug-107013956514187@msgid-missing \
    --to=s.chauveau@chello.nl \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.