FreeBSD telldusd port fix for devd script

Johan Ström johan at stromnet.se
Wed Oct 4 06:05:52 UTC 2017


Hi,

thanks, verified and seems to work fine, at least on unplug/re-plug.

I added a "logger "logger ATTACH event on $cdev;" to the action too. On
unplug-plug scenario this was logged and all worked fine [1].
On a reboot it did not log it [2], but it actually seems to have
executed, as the dialer group have been set on ugen0.2 and telldusd is
able to interact with it.

Can I expect that this will execute on system boot too, or is there some
other magic involved for that? logger not ready for use at that stage,
but devd is perhaps?

Johan


1. Device inserted
Oct  4 07:43:48 back-1 kernel: ugen0.2: <Telldus> at usbus0
Oct  4 07:43:48 back-1 kernel: uftdi0: <TellStick> on usbus0
Oct  4 07:43:48 back-1 devd: Executing 'logger ATTACH event on ugen0.2;
chgrp dialer /dev/ugen0.2; chmod 660 /dev/ugen0.2
/usr/local/sbin/tdadmin --pid 0x0c30 --vid 0x1781 --serial A6008W8a
controller connect'
Oct  4 07:43:48 back-1 johan: ATTACH event on ugen0.2
...
Oct  4 07:44:17 back-1 telldusd: Connecting to TellStick (1781/C30) with
serial A6008W8a


2. System boot with device already plugged in
Oct  4 07:49:12 back-1 kernel: ugen0.2: <Telldus> at usbus0
...
Oct  4 07:49:12 back-1 kernel: uftdi0: <TellStick> on usbus0
...
Oct  4 07:49:34 back-1 telldusd: Connecting to TellStick (1781/C30) with
serial A6008W8a


But nothing from devd or ATTACH event.


On 30/09/17 21:07, Hans Petter Selasky wrote:
> Hi Johan,
>
> The following devd script is not fully correct.
>
>> --- tdadmin/freebsd-devd-tellstick.conf    2014-04-06
>> 22:40:11.000000000 +0200
>> +++ tdadmin/freebsd-devd-tellstick.conf    2014-04-06
>> 20:37:50.501751596 +0200
>> @@ -0,0 +1,12 @@
>> +attach 10 {
>> +    device-name "uftdi[0-9]+";
>> +    match "vendor" "0x1781";
>> +    match "product" "0x0c30";
>> +
>> +    action "chgrp dialer /dev/ugen$port.$devaddr; chmod 660
>> /dev/ugen$port.$devaddr;
>> +        @CMAKE_INSTALL_PREFIX@/sbin/tdadmin --pid $product --vid
>> $vendor --serial $sernum controller connect";
>> +};
>
> It should be:
>
> notify 10 {
>         match "system" "USB";
>         match "subsystem" "DEVICE";
>         match "type" "ATTACH";
>         match "vendor" "0x1781";
>         match "product" "0x0c30";
>     action "chgrp dialer /dev/$cdev; chmod 660 /dev/$cdev
> @CMAKE_INSTALL_PREFIX@/sbin/tdadmin --pid $product --vid $vendor
> --serial $sernum controller connect";
> }
>
> Can you test and update the port in FreeBSD ?
>
> Thank you!
>
> --HPS



More information about the freebsd-ports mailing list