linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kay Sievers <kay@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: udev: getting attributes from subdevice?
Date: Mon, 02 Jul 2012 17:03:13 +0000	[thread overview]
Message-ID: <CAPXgP120-YiaocmE3ZJWr=fEC5eLa-PAT2_Xhq=sDmH3tEGFqA@mail.gmail.com> (raw)

On Sat, Jun 30, 2012 at 7:15 PM, Clemens Ladisch <clemens@ladisch.de> wrote:

> TEST="vendor_name", TEST!="model_name", WAIT_FOR="$kernel.0/model_name"
> TEST="vendor_name", TEST!="model_name", TEST="$kernel.0/model_name", \
>         OPTIONS="string_escape=replace", \
>         SYMLINK+="firewire/by-name/$attr{vendor_name} $attr{$kernel.0/model_name}"
>
> But this doesn't work, probably because $kernel is not substituted
> before $attr:
>
> $ ls -l /dev/firewire/by-name/
> lrwxrwxrwx 1 root root 9 2012-06-30 18:13 LaCie_ -> ../../fw2
>
> (It works if I use $attr{fw2.0/model_name}, but that isn't generic enough.)
>
> Do I have to write a separate tool for extracting the name?

There is no direct support for accessing child devices, because it is
too racy and the child devices usually do not even exist at the time
the event for the parent device is handled.

Special care in the kernel need to be taken to make all that possible,
like we do for example for disks and partitions.

Aside from that, why this usually does not work well, the format char
replacement is just one pass from the left to the right, so that order
would not work.

Kay

             reply	other threads:[~2012-07-02 17:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-02 17:03 Kay Sievers [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-06-30 17:15 udev: getting attributes from subdevice? Clemens Ladisch

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='CAPXgP120-YiaocmE3ZJWr=fEC5eLa-PAT2_Xhq=sDmH3tEGFqA@mail.gmail.com' \
    --to=kay@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 read-only IMAP folder(s) and NNTP newsgroup(s).