All of lore.kernel.org
 help / color / mirror / Atom feed
* udev and parent attributes within subdirectories
@ 2007-02-23  9:44 Theodoros V. Kalamatianos
  2007-02-23 17:13 ` Kay Sievers
  2007-02-23 19:42 ` Theodoros V. Kalamatianos
  0 siblings, 2 replies; 3+ messages in thread
From: Theodoros V. Kalamatianos @ 2007-02-23  9:44 UTC (permalink / raw)
  To: linux-hotplug

Hi,

I am trying to set-up a udev rule for composite USB video/audio devices, 
so that the audio devices get a more generic name .e.g /dev/avaudio. In 
order to determine whether a USB device had a video component, I used 
variations of ATTRS{<video device>/dev}="?*", but udev complained about 
referencing parent directories directly.

1. Is there a suggested way to access parent attributes that reside 
within subdirectories?

2. Is there a different way to do what I am trying to do?

I am using udev 105 on kernel 2.6.18.

Thank you for your time.


Best regards,

Theodoros Kalamatianos


PS: Please CC: any replies, as I am not subscribed to this list

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
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] 3+ messages in thread

* Re: udev and parent attributes within subdirectories
  2007-02-23  9:44 udev and parent attributes within subdirectories Theodoros V. Kalamatianos
@ 2007-02-23 17:13 ` Kay Sievers
  2007-02-23 19:42 ` Theodoros V. Kalamatianos
  1 sibling, 0 replies; 3+ messages in thread
From: Kay Sievers @ 2007-02-23 17:13 UTC (permalink / raw)
  To: linux-hotplug

On 2/23/07, Theodoros V. Kalamatianos <nyb@users.sourceforge.net> wrote:
> I am trying to set-up a udev rule for composite USB video/audio devices,
> so that the audio devices get a more generic name .e.g /dev/avaudio. In
> order to determine whether a USB device had a video component, I used
> variations of ATTRS{<video device>/dev}="?*", but udev complained about
> referencing parent directories directly.
>
> 1. Is there a suggested way to access parent attributes that reside
> within subdirectories?

You want to follow a symlink to another device, or attributes in
subdirectories of the device
you receive the event for?

We can't allow to reference a parent and go down to another "sibling
device", because that rule would break, if something in sysfs changes;
like a device gets inserted into the chain of devices, which is
perfectly valid, but such a rule would stop to work.

> 2. Is there a different way to do what I am trying to do?

Probably not with simple rules likes this. There is also no guarantee,
that the video device is created before the audio device, if something
changes in the kernel. We can't support such a logic at that level, I
fear.

Thanks,
Kay

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
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] 3+ messages in thread

* Re: udev and parent attributes within subdirectories
  2007-02-23  9:44 udev and parent attributes within subdirectories Theodoros V. Kalamatianos
  2007-02-23 17:13 ` Kay Sievers
@ 2007-02-23 19:42 ` Theodoros V. Kalamatianos
  1 sibling, 0 replies; 3+ messages in thread
From: Theodoros V. Kalamatianos @ 2007-02-23 19:42 UTC (permalink / raw)
  To: linux-hotplug

On Fri, 23 Feb 2007, Kay Sievers wrote:

> On 2/23/07, Theodoros V. Kalamatianos <nyb@users.sourceforge.net> wrote:
>> I am trying to set-up a udev rule for composite USB video/audio devices,
>> so that the audio devices get a more generic name .e.g /dev/avaudio. In
>> order to determine whether a USB device had a video component, I used
>> variations of ATTRS{<video device>/dev}="?*", but udev complained about
>> referencing parent directories directly.
>> 
>> 1. Is there a suggested way to access parent attributes that reside
>> within subdirectories?
>
> You want to follow a symlink to another device, or attributes in
> subdirectories of the device
> you receive the event for?

A "sibling" device, I guess. Attributes for the same device seem to work 
just fine :-)

> We can't allow to reference a parent and go down to another "sibling
> device", because that rule would break, if something in sysfs changes;
> like a device gets inserted into the chain of devices, which is
> perfectly valid, but such a rule would stop to work.

I suppose you are right. I'll try to find another way to do this, but it 
would be nice to be able to easily tell that "if mixer2 is in the same 
device with video0, add a symlink as tvmixer".

I guess that the way the device layer is structured there is not much 
difference between sibling devices, whether they are parts of the same 
composite device, or different devices attached to the same hub...

>> 2. Is there a different way to do what I am trying to do?
>
> Probably not with simple rules likes this. There is also no guarantee,
> that the video device is created before the audio device, if something
> changes in the kernel. We can't support such a logic at that level, I
> fear.

I see. And considering that USB devices are very variable and don't even 
have a descent way to tell them apart when they are identical, I can 
understand why this is not possible, unless one would be willing to set 
depth limits when matching or something... too messy that one.

> Thanks,
> Kay

Thank you for your help,

Theodoros Kalamatianos



PS: CC'ing any replies to my address would be once again appreciated :-)

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
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] 3+ messages in thread

end of thread, other threads:[~2007-02-23 19:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-23  9:44 udev and parent attributes within subdirectories Theodoros V. Kalamatianos
2007-02-23 17:13 ` Kay Sievers
2007-02-23 19:42 ` Theodoros V. Kalamatianos

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.