From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Fri, 29 Apr 2005 18:15:04 +0000 Subject: Re: udev: rules using multiple sysfs directories Message-Id: <1114798504.9585.11.camel@localhost.localdomain> List-Id: References: <200504282041.56905.typo@mcflan.org> In-Reply-To: <200504282041.56905.typo@mcflan.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Fri, 2005-04-29 at 01:59 +0100, James Macfarlane wrote: > On Thursday 28 April 2005 22:44, Kay Sievers wrote: > > How does: > > tree /sys/... > > of this device look like? > > > > What does: > > udevinfo -a -p /sys/xxx... > > print for this device? > > See at the bottom of this message. > > > I never tried this, but: > > SYSFS{product/value} > > may work to go into subdirs? > > Not sure exactly you mean, in terms of syntax. I've just tried > SYSFS{1.0/bInterfaceProtocol} but it didn't seem to work. > > udevinfo says: "Only attributes within one device section may be used > together in one rule, to match the device for which the node will be > created." - that seems to indicate it won't work. Yes that is right, but you can specify a path as attribute. Example: [root@pim udev]# tree /sys/block/hda/ /sys/block/hda/ |-- dev |-- hda1 | |-- dev | |-- size | |-- start | `-- stat |-- queue | |-- iosched | | |-- antic_expire | | |-- est_time | | |-- read_batch_expire | | |-- read_expire | | |-- write_batch_expire | | `-- write_expire | |-- max_hw_sectors_kb | |-- max_sectors_kb | |-- nr_requests | |-- read_ahead_kb | `-- scheduler |-- range |-- removable |-- size `-- stat This matches: KERNEL="hda", SYSFS{queue/iosched/est_time}="*", SYSFS{removable}="*", NAME="test" > I've had a brief delve into the source and it looks unlikely to work > either. It appears to search for attribute names in a pre-existing > list, and everything between the curly braces counts as the attribute > name (btw, I'm looking at ver 056, which is what my distro (debian > testing) uses). So adding '/' is probably not going to work. Only in the way mentioned above, as a path. > It walks the tree and breaks out of the loop once all the key-value > pairs are matched, but it does all the SYSFS pairs in one loop. So > unless all the SYSFS attributes are matched at one level, then the > whole rule fails to match. Right. But in your case, it may be the easiest to write a PROGRAM-script to catch your device... Good luck, Kay ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r _______________________________________________ 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