Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Oct 2017 07:59:42 +0200
From:      =?UTF-8?Q?Johan_Str=c3=b6m?= <johan@stromnet.se>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        ports@FreeBSD.org
Subject:   Re: FreeBSD telldusd port fix for devd script
Message-ID:  <3bc6fa52-7066-05b9-2cdf-dfa8cfe681f9@stromnet.se>
In-Reply-To: <27b89374-5513-ed45-6ec1-58a2c1156543@selasky.org>
References:  <27b89374-5513-ed45-6ec1-58a2c1156543@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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=C2=A0 4 07:43:48 back-1 kernel: ugen0.2: <Telldus> at usbus0
Oct=C2=A0 4 07:43:48 back-1 kernel: uftdi0: <TellStick> on usbus0
Oct=C2=A0 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=C2=A0 4 07:43:48 back-1 johan: ATTACH event on ugen0.2
...
Oct=C2=A0 4 07:44:17 back-1 telldusd: Connecting to TellStick (1781/C30) =
with
serial A6008W8a


2. System boot with device already plugged in
Oct=C2=A0 4 07:49:12 back-1 kernel: ugen0.2: <Telldus> at usbus0
...
Oct=C2=A0 4 07:49:12 back-1 kernel: uftdi0: <TellStick> on usbus0
...
Oct=C2=A0 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=C2=A0=C2=A0=C2=A0 2014-04-06
>> 22:40:11.000000000 +0200
>> +++ tdadmin/freebsd-devd-tellstick.conf=C2=A0=C2=A0=C2=A0 2014-04-06
>> 20:37:50.501751596 +0200
>> @@ -0,0 +1,12 @@
>> +attach 10 {
>> +=C2=A0=C2=A0=C2=A0 device-name "uftdi[0-9]+";
>> +=C2=A0=C2=A0=C2=A0 match "vendor" "0x1781";
>> +=C2=A0=C2=A0=C2=A0 match "product" "0x0c30";
>> +
>> +=C2=A0=C2=A0=C2=A0 action "chgrp dialer /dev/ugen$port.$devaddr; chmo=
d 660
>> /dev/ugen$port.$devaddr;
>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 @CMAKE_INSTALL_PREFIX@/sbi=
n/tdadmin --pid $product --vid
>> $vendor --serial $sernum controller connect";
>> +};
>
> It should be:
>
> notify 10 {
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 match "system" "USB";
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 match "subsystem" "DEVICE";
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 match "type" "ATTACH";
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 match "vendor" "0x1781";
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 match "product" "0x0c30";
> =C2=A0=C2=A0=C2=A0=C2=A0action "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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3bc6fa52-7066-05b9-2cdf-dfa8cfe681f9>