Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Oct 2009 23:26:41 -0400
From:      Justin Hibbits <jrh29@alumni.cwru.edu>
To:        Warren Block <wblock@wonkity.com>
Cc:        current@freebsd.org
Subject:   Re: Creating /dev links to dynamic devices
Message-ID:  <fd9cd3450910242026p6f9d84cap274b03deee6534ee@mail.gmail.com>
In-Reply-To: <alpine.BSF.2.00.0910242102400.24135@wonkity.com>
References:  <alpine.BSF.2.00.0910241934310.23784@wonkity.com> <fd9cd3450910241907k5661e1b3jfdcf6f59d73a4e5f@mail.gmail.com> <alpine.BSF.2.00.0910242102400.24135@wonkity.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Oct 24, 2009 at 11:19 PM, Warren Block <wblock@wonkity.com> wrote:

> On Sat, 24 Oct 2009, Justin Hibbits wrote:
>
>  On Sat, Oct 24, 2009 at 10:00 PM, Warren Block <wblock@wonkity.com>
>> wrote:
>>
>>  devfs.conf allows creating static device links:
>>>
>>> link    acd0    cdrom
>>>
>>> This only runs on devfs startup, so it's useless for creating a link to a
>>> dynamic device.
>>>
>>> The specific example is for scanners.  My scanner is ugen2.3, but only as
>>> long as it is plugged into the same USB hub/port each time.  I can
>>> manually
>>> create a uscanner0 link in /dev with devd.conf:
>>>
>>> attach 20 {
>>>       device-name "ugen[0-9]+";
>>>       match "vendor" "0x04b8";
>>>       match "product" "0x010a";
>>>       action "/bin/ln -sf /dev/$device-name /dev/uscanner0; /sbin/devfs
>>> rule applyset";
>>> };
>>>
>>> Using /dev/uscanner0 then works in place of ugen2.3.
>>>
>>> Now the second part of the example: I want devd to recognize the attach
>>> or
>>> creation of uscanner0.  But it's not a true devfs device; devd doesn't
>>> see
>>> an attach event, or a notify CDEV/CREATE event.
>>>
>>> Is there a method to create a true devfs link to a dynamic device?
>>>
>>
>> Check devfs.rules(5)
>>
>
> I did, but maybe missed the relevant information.  There are conditions to
> match and modify (perm/owner) a node, but none to create or delete one.
>  Maybe something with unhide?  Could you post an example?
>
>
> -Warren Block * Rapid City, South Dakota USA
>

I guess I misread your original post.  Why do you want to add actions based
on the creation of the uscanner node?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?fd9cd3450910242026p6f9d84cap274b03deee6534ee>