LED devices

Kay Sievers kay.sievers at vrfy.org
Fri Jun 1 09:12:47 PDT 2007


On Fri, 2007-06-01 at 16:56 +0100, Richard Purdie wrote:
> On Fri, 2007-06-01 at 17:32 +0200, Johannes Berg wrote: 
> > Actually, I was talking about triggers, they don't have any stuff
> > in /sys/devices. But their name is controlled by something that does,
> > and that something can even be renamed (like netdevs).
> > 
> > Maybe the LED/LED trigger association API should just be symlinking a
> > trigger devices to a /sys/devices/.../<ledname>/trigger, but of course
> > that's not really possible.
> 
> I've often wished we could do this as it would suit triggers well! The
> same approach could be used for bio schedulers and other selection type
> operations. As you say its not really possible though and would be more
> difficult to use in reality.

I'm not familiar with the whole infrastructure, so I might be on the
wrong track. :)

Wouldn't something like the blockdev holders/ slaves/ subdirs work to
express such a relationship?

  $ ls -l /sys/block
  md0 -> ../devices/virtual/block/md0
  sda -> ../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
  sr0 -> ../devices/pci0000:00/0000:00:1f.1/host4/target4:0:0/4:0:0:0/block/sr0

  $ ls -l  /sys/block/md0/slaves
  sda8 -> ../../../../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda8
  sda9 -> ../../../../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda9

  $ ls -l  /sys/block/sda/sda8/holders
  md0 -> ../../../../../../../../../../devices/virtual/block/md0

It shows the relationship in both directions, and is not limited to a
single relation per device.

Kay



More information about the hal mailing list