Rob Groner
2015-Mar-02 17:49 UTC
[Nut-upsuser] Install problems (group permissions) with nut 2.7.2
Well, having spent a decent amount of time trying to get my driver file added into the Makefile build system (and failing), I've decided that for now, simply adding that one line to the openups-hid.c file and recompiling is the best route to go. When I can no longer live with the limited nature of the openups-hid driver, I'll revisit writing our own. Thanks for the helps. Sincerely, Rob Groner> -----Original Message----- > From: Charles Lepple [mailto:clepple at gmail.com] > Sent: Wednesday, February 25, 2015 8:10 PM > To: Rob Groner > Cc: nut-upsuser List > Subject: Re: [Nut-upsuser] Install problems (group permissions) with nut > 2.7.2 > > On Feb 25, 2015, at 11:35 AM, Rob Groner <rgroner at RTD.com> wrote: > > > The quickest way to get my UPS running with nut (as the current release > exists) is to either: > > > > 1) Add my vendor and device ID to the openups_usb_device_table OR > > 2) Create my own driver file, and then add that driver to the usbhid-ups > subdriver_list > > > > And then recompile/install. > > > Correct. > > For posterity, here's the discussion thread from last March: > http://article.gmane.org/gmane.comp.monitoring.nut.devel/6669 > > I may not have been clear then, but the changes to the driver/*.c files will > definitely require a recompile/install of at least the usbhid-ups driver. > > If you are looking for something more turnkey, you may want to consider > building packages for a few of the common distributions. It has been on my > TODO list for some time to gather the instructions on how to do this from all > of the various mailing list posts, but the information is out there. > > -- > Charles Lepple > clepple at gmail > >
Charles Lepple
2015-Mar-03 01:27 UTC
[Nut-upsuser] Install problems (group permissions) with nut 2.7.2
On Mar 2, 2015, at 12:49 PM, Rob Groner <rgroner at RTD.com> wrote:> Well, having spent a decent amount of time trying to get my driver file added into the Makefile build system (and failing), I've decided that for now, simply adding that one line to the openups-hid.c file and recompiling is the best route to go. When I can no longer live with the limited nature of the openups-hid driver, I'll revisit writing our own.I'll take this as a TODO item to make it clearer, but for later the basic information is here: http://www.networkupstools.org/docs/developer-guide.chunked/ar01s04.html#_writing_a_subdriver "You must also add the subdriver to USBHID_UPS_SUBDRIVERS in drivers/Makefile.am and call "autoreconf" and/or "./configure" from the top level NUT directory." To run autoreconf, you need automake, autoconf and libtool. automake turns Makefile.am into Makefile.in, and the ./configure script converts Makefile.in to the Makefile. -- Charles Lepple clepple at gmail
Rob Groner
2015-Mar-03 15:30 UTC
[Nut-upsuser] Install problems (group permissions) with nut 2.7.2
My fault, I neglected to re-read the developers guide. I had just taken the openups-usb.* and copied them, and then copied all their entries in various makefiles and changed them to match my files instead. That wasn't enough, apparently. I'll try following the guide verbatim instead and see how well that works for me. Sincerely, Rob Groner> -----Original Message----- > From: Charles Lepple [mailto:clepple at gmail.com] > Sent: Monday, March 02, 2015 8:27 PM > To: Rob Groner > Cc: nut-upsuser List > Subject: Re: [Nut-upsuser] Install problems (group permissions) with nut > 2.7.2 > > On Mar 2, 2015, at 12:49 PM, Rob Groner <rgroner at RTD.com> wrote: > > > Well, having spent a decent amount of time trying to get my driver file > added into the Makefile build system (and failing), I've decided that for now, > simply adding that one line to the openups-hid.c file and recompiling is the > best route to go. When I can no longer live with the limited nature of the > openups-hid driver, I'll revisit writing our own. > > I'll take this as a TODO item to make it clearer, but for later the basic > information is here: > > http://www.networkupstools.org/docs/developer- > guide.chunked/ar01s04.html#_writing_a_subdriver > > "You must also add the subdriver to USBHID_UPS_SUBDRIVERS in > drivers/Makefile.am and call "autoreconf" and/or "./configure" from the top > level NUT directory." > > To run autoreconf, you need automake, autoconf and libtool. automake > turns Makefile.am into Makefile.in, and the ./configure script converts > Makefile.in to the Makefile. > > -- > Charles Lepple > clepple at gmail > >
Rob Groner
2015-Mar-09 15:49 UTC
[Nut-upsuser] Install problems (group permissions) with nut 2.7.2
Ok, I tried this from scratch on a fresh 2.7.2 directory. I followed the web instructions, specifically: + I generated the new subdriver for my UPS (rtd-hid.*) based on PATH info. + I put them in the drivers subdir + I added the include line (#include rtd-hid.h) in usbhid-ups.c (specifically in the #ifndef SHUT_MODE section) + I added &rtd_subdriver, to the subdriver_list in usbhid-ups.c (specifically in the #ifndef SHUT_MODE section) + I added "rtd-hid.c" to USBHID_UPS_SUBDRIVERS in drivers/Makefile.am + I added "rtd-hid.h" to dist_noinst_HEADERS in drivers/Makefile.am + I executed ./configure --with-usb --with-dev --etc --etc I execute make, and I get an error: /bin/sh ../libtool --tag=CC --mode=link gcc -I../include -g -O2 -Wall -Wsign-compare -o usbhid-ups usbhid-ups.o libhid.o libusb.o hidparser.o usb-common.o apc-hid.o belkin-hid.o cps-hid.o explore-hid.o liebert-hid.o mge-hid.o powercom-hid.o tripplite-hid.o idowell-hid.o openups-hid.o ../common/libcommon.la ../common/libparseconf.la main.o dstate.o -lusb -lpthread libtool: link: gcc -I../include -g -O2 -Wall -Wsign-compare -o usbhid-ups usbhid-ups.o libhid.o libusb.o hidparser.o usb-common.o apc-hid.o belkin-hid.o cps-hid.o explore-hid.o liebert-hid.o mge-hid.o powercom-hid.o tripplite-hid.o idowell-hid.o openups-hid.o main.o dstate.o ../common/.libs/libcommon.a ../common/.libs/libparseconf.a -lusb -lpthread usbhid-ups.o:(.rodata+0x110): undefined reference to `rtd_subdriver' collect2: error: ld returned 1 exit status make[1]: *** [usbhid-ups] Error 1 make[1]: Leaving directory `/home/rtd/nut-2.7.2/drivers' I can see that somehow, somewhere, my rtd-hid.o isn't being included in that list. I followed the same process again, but this time tried autoreconf instead of configure (I had already run ./configure once). That gave me an error message that I do not believe is related to my driver: Parallel-tests: error: required file './test-driver' not found Parallel-tests: 'automake --add-missing' can install 'test-driver' Autoreconf: automake failed with exit status 1 Sincerely, Rob Groner> -----Original Message----- > From: Charles Lepple [mailto:clepple at gmail.com] > Sent: Monday, March 02, 2015 8:27 PM > To: Rob Groner > Cc: nut-upsuser List > Subject: Re: [Nut-upsuser] Install problems (group permissions) with nut > 2.7.2 > > On Mar 2, 2015, at 12:49 PM, Rob Groner <rgroner at RTD.com> wrote: > > > Well, having spent a decent amount of time trying to get my driver file > added into the Makefile build system (and failing), I've decided that for now, > simply adding that one line to the openups-hid.c file and recompiling is the > best route to go. When I can no longer live with the limited nature of the > openups-hid driver, I'll revisit writing our own. > > I'll take this as a TODO item to make it clearer, but for later the basic > information is here: > > http://www.networkupstools.org/docs/developer- > guide.chunked/ar01s04.html#_writing_a_subdriver > > "You must also add the subdriver to USBHID_UPS_SUBDRIVERS in > drivers/Makefile.am and call "autoreconf" and/or "./configure" from the top > level NUT directory." > > To run autoreconf, you need automake, autoconf and libtool. automake > turns Makefile.am into Makefile.in, and the ./configure script converts > Makefile.in to the Makefile. > > -- > Charles Lepple > clepple at gmail > >