linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: udev: rules using multiple sysfs directories
Date: Fri, 29 Apr 2005 18:15:04 +0000	[thread overview]
Message-ID: <1114798504.9585.11.camel@localhost.localdomain> (raw)
In-Reply-To: <200504282041.56905.typo@mcflan.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

  parent reply	other threads:[~2005-04-29 18:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-28 19:41 udev: rules using multiple sysfs directories James Macfarlane
2005-04-28 20:28 ` Ian Pilcher
2005-04-28 21:44 ` Kay Sievers
2005-04-29  0:59 ` James Macfarlane
2005-04-29 12:55 ` Ian Pilcher
2005-04-29 17:13 ` James Macfarlane
2005-04-29 18:15 ` Kay Sievers [this message]
2005-04-29 20:09 ` Greg KH
2005-04-30  0:44 ` Ian Pilcher

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=1114798504.9585.11.camel@localhost.localdomain \
    --to=kay.sievers@vrfy.org \
    --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).