From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Chauveau S." Date: Thu, 04 Dec 2003 10:17:55 +0000 Subject: Re: pattern matching in udev Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Patrick Mansfield wrote: >On Wed, Dec 03, 2003 at 08:19:44PM +0100, Stephane Chauveau wrote: > > >>>>REGEXP "<$bus><$vendor><$id>"="<.*:0:0:\(.*\)>", >>>> NAME="mem\1-%n" >>>> >>>> >>>IMO the pattern matching should be part of the TOPOLOGY plus PLACE. >>> >>>The scsi naming also requires a parent, your example above is only valid >>>if you have one host adapter connected (or one usb mass storage device >>>attached), there could exist another sd on *:0:0:0. >>> >>> >>Not really because my example matches the $bus, the $id and the $vendor. >> >> > >There could be another identical scsi device with the same id and vendor. > >I thought the PCI sysfs id's were constant for a given hardware, but I'm >told they can change with PCI hotplug, so the full sysfs path I mentioned >previously will not be constant across boots with PCI hotplugging. > > I agree that matching the vendor is not enough but this is because my example is incorrect. What I call '$vendor' is my example is in fact the '$model'. The 'ImageMate' is an external USB memory card reader so the PCI or the SCSI ids are not constant and cannot be used at all (except the last bit to differenciate the 2 slots on the card reader). The only way to identify a USB device is to match the 'model' and the usb device 'id' Your remark about having identical devices is especially relevant in case of USB (or other hot-plugable) devices. For example, how could udev handle 2 identical USB joysticks? Ideally, udev should be able to create a device 'js0' for the 1st joystick plugged in, 'js1' for the second, etc. One accepatble way could be to use the USB topology! the joystick plugged in the nth USB slot would be 'jsn' but that won't work with wireless devices. > > >>A single method capable of pattern matching on all the available informations >>could be used to replace all the methods currently in implemented in udev >>(except maybe REPLACE which has a different purpose). >> >> > >-- Patrick Mansfield > > > Stephane Chauveau ------------------------------------------------------- This SF.net email is sponsored by OSDN's Audience Survey. Help shape OSDN's sites and tell us what you think. Take this five minute survey and you could win a $250 Gift Certificate. http://www.wrgsurveys.com/2003/osdntech03.php?site=8 _______________________________________________ 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