linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pattern matching in udev
@ 2003-11-29 20:58 Stephane Chauveau
  2003-12-01 16:59 ` Patrick Mansfield
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Stephane Chauveau @ 2003-11-29 20:58 UTC (permalink / raw)
  To: linux-hotplug

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-12-04 10:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-29 20:58 pattern matching in udev Stephane Chauveau
2003-12-01 16:59 ` 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

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).