Created attachment 153482 [details] Patch to bring comms/telldus-core to 2.1.2_1 The attached patch fixes issues with telldus-core on FreeBSD 10.1, and a few other issues: * improved devd-script * Fixed permissions on /var/telldus/telldus-core.conf; use new @dir style * portlint complaints portlint output from patched port: WARN: Makefile: possible use of absolute pathname "/var/telldus". WARN: Makefile: for new port, make $FreeBSD$ tag in comment section empty, to make SVN happy. WARN: Makefile: new ports should not set PORTREVISION. 0 fatal errors and 3 warnings found.
Created attachment 153484 [details] poudriere testport -j 101amd64 -o comms/telldus-core Added testport output for 10.1 AMD64
A commit references this bug: Author: hselasky Date: Wed Feb 25 08:35:01 UTC 2015 New revision: 279270 URL: https://svnweb.freebsd.org/changeset/base/279270 Log: Add ugen keyword to USB pnpinfo. Remove extra space from existing pnpinfo. PR: 198015 PR: 198019 PR: 198026 MFC after: 1 week Changes: head/sys/dev/usb/usb_hub.c
Created attachment 153511 [details] Fix for missing $ugen Please use /dev/$ugen . It will be upstream in not too long.
*** Bug 198026 has been marked as a duplicate of this bug. ***
Thanks for quick fixes! When can one expect this to be in 10.1-RELEASE (or 9.3-RELEASE) as available via freebsd-update? The original submitted patch contained this workaround (at least working on FreeBSD 10.1) until proper is usable: action "dev=`usbconfig dump_device_desc | grep $sernum -B14|grep ugen|cut -f1 -d':'`; chgrp dialer /dev/$$dev; chmod 660 /dev/$$dev; ..." Unless this can be in generic relatively soon, I'd prefer to have the above hack in the port to avoid breakage. Without the chown/chmod the port is unusable.
Hi, If you know the vendor and product IDs, then you shouldn't match for uftdiX at all. Use: notify 50 { match "system" "USB"; match "subsystem" "DEVICE"; match "type" "ATTACH"; match "vendor" "0x1781"; match "product" "0x0c30"; action "chgrp dialer /dev/$cdev; chmod 660 /dev/$cdev"; }; --HPS
I'm actually already doing that. The full script looks like this: attach 10 { device-name "uftdi[0-9]+"; match "vendor" "0x1781"; match "product" "0x0c30"; # Devd variable $bus and $devaddr ought to be what we want to identify /dev/ugenN.N. # Unfortunately devd overwrites $bus: # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198015 # # Use this workaround instead.. Find device by serial and use that device name. -B14 should be stable: # https://github.com/freebsd/freebsd/blob/master/usr.sbin/usbconfig/dump.c#L395 # https://github.com/freebsd/freebsd/blob/master/lib/libusb/libusb20_desc.h#L220 # # $ usbconfig dump_device_desc | grep $sernum -B14|grep ugen # ugen0.2: <TellStick Telldus> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (90mA) # # Old command: # action "chgrp dialer /dev/ugen$bus.$devaddr; chmod 660 /dev/ugen$bus.$devaddr; action "dev=`usbconfig dump_device_desc | grep $sernum -B14|grep ugen|cut -f1 -d':'`; chgrp dialer /dev/$$dev; chmod 660 /dev/$$dev; /usr/local/sbin/tdadmin --pid $product --vid $vendor --serial $sernum controller connect"; }; There is no $cdev variable provided. The event processed (same as reported in ticket 198015): Processing event '+uftdi0 at bus=0 hubaddr=1 port=3 devaddr=2 interface=0 vendor=0x1781 product=0x0c30 devclass=0x00 devsubclass=0x00 sernum="XXXXXX" release=0x0600 mode=host intclass=0xff intsubclass=0xff intprotocol=0xff ttyname=U0 ttyports=1 on uhub1' Verified with: action "echo cdev for $sernum is x $cdev x" Output: Executing 'echo cdev for XXXX is x x' cdev for XXXX is x x
Oh, my bad. Didn't notice USB/ATTACH event matching. And.. Doh. I've been testing by doing "usbconfig -d... power_off ; ... power_on". When doing that, the USB INTERFACE ATTACH event was not sent, hence I missed it.. Looking closer, these events is what I get: Processing event '!system=USB subsystem=INTERFACE type=ATTACH ugen=ugen0.2 cdev=ugen0.2 vendor=0x1781 product=0x0c30 devclass=0x00 devsubclass=0x00 sernum="XXXX" release=0x0600 mode=host interface=0 endpoints=2 intclass=0xff intsubclass=0xff intprotocol=0xff' Processing event '!system=DEVFS subsystem=CDEV type=CREATE cdev=usb/0.2.2' Processing event '!system=DEVFS subsystem=CDEV type=CREATE cdev=ttyU0' Processing event '!system=DEVFS subsystem=CDEV type=CREATE cdev=ttyU0.init' Processing event '!system=DEVFS subsystem=CDEV type=CREATE cdev=ttyU0.lock' Processing event '!system=DEVFS subsystem=CDEV type=CREATE cdev=cuaU0.init' Processing event '!system=DEVFS subsystem=CDEV type=CREATE cdev=cuaU0.lock' Processing event '+uftdi0 at bus=0 hubaddr=1 port=3 devaddr=2 interface=0 vendor=0x1781 product=0x0c30 devclass=0x00 devsubclass=0x00 sernum="XXXX" release=0x0600 mode=host intclass=0xff intsubclass=0xff intprotocol=0xff ttyname=U0 ttyports=1 on uhub1' Changing to your suggestion works perfect, thanks! I'll update the patch accordingly.
You should see two events. One "INTERFACE" one and another "DEVICE" one. You should use the "DEVICE" one if the deamon should only attach once. --HPS
Right, I have Processing event '!system=USB subsystem=INTERFACE type=ATTACH ugen=ugen0.2 cdev=ugen0.2 vendor=0x1781 product=0x0c30 devclass=0x00 devsubclass=0x00 sernum="XXX" release=0x0600 mode=host interface=0 endpoints=2 intclass=0xff intsubclass=0xff intprotocol=0xff' and Processing event '!system=USB subsystem=DEVICE type=ATTACH ugen=ugen0.2 cdev=ugen0.2 vendor=0x1781 product=0x0c30 devclass=0x00 devsubclass=0x00 sernum="XXX" release=0x0600 mode=host port=3 parent=ugen0.1' Will use DEVICE, as per your example. Sorry for the confusion.
Created attachment 153517 [details] Revised patch to bring comms/telldus-core to 2.1.2_1 The port patch has now been updated to use a proper devd script, which now also supports the DETACH event properly.
Note that "Fix for missing $ugen (514 bytes, patch)" is obsolete with my latest port patch.
A commit references this bug: Author: hselasky Date: Thu Mar 5 09:31:37 UTC 2015 New revision: 279636 URL: https://svnweb.freebsd.org/changeset/base/279636 Log: MFC r279270: Add ugen keyword to USB pnpinfo. Remove extra space from existing pnpinfo. PR: 198015 PR: 198019 PR: 198026 Changes: _U stable/10/ stable/10/sys/dev/usb/usb_hub.c
A commit references this bug: Author: hselasky Date: Thu Mar 5 09:35:16 UTC 2015 New revision: 279637 URL: https://svnweb.freebsd.org/changeset/base/279637 Log: MFC r279270: Add ugen keyword to USB pnpinfo. Remove extra space from existing pnpinfo. PR: 198015 PR: 198019 PR: 198026 Changes: _U stable/9/sys/ _U stable/9/sys/dev/ stable/9/sys/dev/usb/usb_hub.c
A commit references this bug: Author: hselasky Date: Thu Mar 5 09:37:28 UTC 2015 New revision: 279638 URL: https://svnweb.freebsd.org/changeset/base/279638 Log: MFC r279270: Add ugen keyword to USB pnpinfo. Remove extra space from existing pnpinfo. PR: 198015 PR: 198019 PR: 198026 Changes: _U stable/8/sys/ _U stable/8/sys/dev/ _U stable/8/sys/dev/usb/ stable/8/sys/dev/usb/usb_hub.c
The fix has been already committed, so I am closing this PR.
Hi, this issue is not resolved. The original patch supplied here was not the one mentioned in the commit comments, those commit referred to another issue which parts of my original patches worked around. As evident by the repo (https://github.com/freebsd/freebsd-ports/tree/master/comms/telldus-core) the patch "Revised patch to bring comms/telldus-core to 2.1.2_1" is not applied. (Also, repeating so it does not get lost: Note that "Fix for missing $ugen (514 bytes, patch)" is obsolete with my latest port patch.) Thanks
Hi, Is this PR still relevant?
It's still relevant, the improved devd-script was never commited to ports. If the now 2 year old patch still applies cleanly, can't really say.. For me personally, stuff works fine on 10.3 at least.
Hi Johan, Thanks for your feedback, I'll keep it open.
This patch looks good to me. --HPS
New refreshed patch in 222790 *** This bug has been marked as a duplicate of bug 222790 ***