From owner-freebsd-ports@freebsd.org Wed Oct 4 06:05:52 2017 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21DAEE2F521 for ; Wed, 4 Oct 2017 06:05:52 +0000 (UTC) (envelope-from johan@stromnet.se) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 0378472FB4 for ; Wed, 4 Oct 2017 06:05:52 +0000 (UTC) (envelope-from johan@stromnet.se) Received: by mailman.ysv.freebsd.org (Postfix) id F34D7E2F520; Wed, 4 Oct 2017 06:05:51 +0000 (UTC) Delivered-To: ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFA30E2F51F for ; Wed, 4 Oct 2017 06:05:51 +0000 (UTC) (envelope-from johan@stromnet.se) Received: from mail.stromnet.se (s0.stromnet.se [109.74.15.210]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F8B172FB3 for ; Wed, 4 Oct 2017 06:05:50 +0000 (UTC) (envelope-from johan@stromnet.se) Received: from mail (mail.j.stromnet.se [172.28.10.1]) by mail.stromnet.se (Postfix) with ESMTP id AE458D7A4F; Wed, 4 Oct 2017 07:59:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=stromnet.se; h= content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:subject:subject:received :received; s=default; t=1507096782; bh=bNTWlxDf+fj+BgceWDPm3R0Ab H4NsTW9UqkID7HyFuU=; b=SffSoRvQB1fpwrtiUoEaPRiwTiGnDRa7O+bqrA+gk lmQOWkqx4M0gqFA+GLugB0fIY306Py5xU/IHVsJBil+Sh3KtSAmuxw/pAjwaNFi5 abzuZZdQGmiaH5+B+FpfPhXmhfjtIB1F8nFJzpJOntbUgHTcXjaoBzT9AYUiE/54 SlOWKOUqGlG8OyuEA4A5j3f7XmzwhtH6zRneCh9m+4Ej+hqAa4KGdiGewbCnnJbp FD+ecaKfLfrhOk4ywb5g9se/nFFbvp4pTdv9DvkTffuPlD9HLfCuXrs4mJDrKeqz QIcQ2rLQA7lC/Of6BiDOba5LTwJ4eoO5qPATAGmNfSBuQ== X-Virus-Scanned: amavisd-new at stromnet.se Received: from mail.stromnet.se ([172.28.10.1]) by mail (mail.stromnet.se [172.28.10.1]) (amavisd-new, port 10026) with ESMTP id Rekra1WrwfIL; Wed, 4 Oct 2017 07:59:42 +0200 (CEST) Received: from johan-ht.stromnet.se (c-abfa70d5.019-333-67626721.cust.bredbandsbolaget.se [213.112.250.171]) by mail.stromnet.se (Postfix) with ESMTPSA id A6905D7990; Wed, 4 Oct 2017 07:59:42 +0200 (CEST) Subject: Re: FreeBSD telldusd port fix for devd script To: Hans Petter Selasky References: <27b89374-5513-ed45-6ec1-58a2c1156543@selasky.org> From: =?UTF-8?Q?Johan_Str=c3=b6m?= Cc: ports@FreeBSD.org Message-ID: <3bc6fa52-7066-05b9-2cdf-dfa8cfe681f9@stromnet.se> Date: Wed, 4 Oct 2017 07:59:42 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <27b89374-5513-ed45-6ec1-58a2c1156543@selasky.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 06:05:52 -0000 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: at usbus0 Oct=C2=A0 4 07:43:48 back-1 kernel: uftdi0: 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: at usbus0 ... Oct=C2=A0 4 07:49:12 back-1 kernel: uftdi0: 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