On 2016/06/07 06:56, Johan Huldtgren wrote: > On 6/7/16 03:21, Martin Pieuchot wrote: > > On 06/06/16(Mon) 19:01, Johan Huldtgren wrote: > > > hello, > > > > > > I have an APC Smart-UPS-2200 which is connected via USB, as long as > > > I've followed the instructions in pkg-readme about disabling uhidev > > > and upd it's always worked fine. When I updated to the latest snap > > > (June 4th) however I am now always seeing "COMMLOST" in the output of > > > 'apcaccess status' I tried booting the previous kernel (May 19th, > > > #1709), but that did not resolve it, it seems the breakage occurred > > > when apcupsd went from 3.14.13p1 to 3.14.13p2 which seems to have been > > > because the removal of USB_GET_STRING_DESC. I did try the newly > > > committed (but as yet unpackaged) 3.14.14 but no more luck there. > > > > > > I tried to build 3.14.13p1 to see if I can confirm what broke it, but > > > I've been unable to succeed. I backed out the USB_GET_STRING_DESC > > > changes and built a new kernel based on sources from around > > > 2016-05-20, I tried to do the same thing with the ports tree but > > > clearly I've missed something, because I never make it further than: > > > > > > make[5]: Entering directory > > > '/usr/ports/pobj/apcupsd-3.14.13/apcupsd-3.14.13/src/drivers/usb/bsd' > > > CXX src/drivers/usb/bsd/hidutils.c > > > if test ! -d .obj; then mkdir -p .obj; fi > > > c++ -x c++ -I/usr/local/include > > > -I/usr/ports/pobj/apcupsd-3.14.13/apcupsd-3.14.13/src/libusbhid > > > -I/usr/ports/pobj/apcupsd-3.14.13/apcupsd-3.14.13/include -O2 -pipe > > > -fno-exceptions -fno-rtti -Wall -pthread -c -o .obj/hidutils.o hidutils.c > > > hidutils.c: In function 'const char* hidu_get_string(int, int)': > > > hidutils.c:354: error: 'USB_GET_STRING_DESC' was not declared in this > > > scope
You would need to install the old headers as well (at least dev/usb/usb.h), not just build the old kernel. The difference between 3.14.13p1 and 3.14.13p2 is that it switched from upstream's BSD-specific USB code (that used USB_GET_STRING_DESC) to generic USB code (that doesn't). In the 3.14.14 port update the configure flag was removed again but that's because upstream have switched to the generic code for all non-Linux systems, i.e. it's now the default. The bsd- specific code is still present in the tar but is unused. > > Does it work if you use the system libusbhid instead of the bundled one? > > I'm not exactly sure how to do this, but I'll take a look at it this > evening when I'm back from work. It's not quite so simple, they link a C++ file into the library too. You could try copying the c/h files from src/lib/libusbhid across but it doesn't build as-is there, at least without sprinkling casts. I am pretty sure you will have the broken behaviour with 3.4.14 on the old kernel too, which would suggest that there's a problem with apcupsd's generic usb code either on OpenBSD or in your configuration (e.g. with your UPS etc). The easiest case would probably be if you can find someone who has a working 3.4.14 on -current. If so, I'd install the same, obtain debug logs and compare with theirs. If there's nothing obvious then maybe ask upstream for suggestions.
