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 > >
Rob Groner
2015-Mar-09 16:00 UTC
[Nut-upsuser] Install problems (group permissions) with nut 2.7.2
Sorry for the bad formatting of the previous message...I tried to use plus signs as bullet points, and that caused a problem somehow. Ok...I discovered that if I do the autoreconf after the first failed make (and the autoreconf still gives that error message), and then do make again...it builds. Conclusions: 1) Autoreconf *must* be run, and not ./configure? I had thought that putting in my *.c and *.h files and making the makefile changes and then executing ./configure for the first time would be enough. 2) Autoreconf appears to do what it needs to do, even though it shows and error and says it exited. Sincerely, Rob Groner> -----Original Message----- > From: Nut-upsuser [mailto:nut-upsuser- > bounces+rgroner=rtd.com at lists.alioth.debian.org] On Behalf Of Rob Groner > Sent: Monday, March 09, 2015 11:49 AM > To: 'nut-upsuser List' > Subject: Re: [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 > > > > > > > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser at lists.alioth.debian.org > http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
Charles Lepple
2015-Mar-10 00:48 UTC
[Nut-upsuser] Install problems (group permissions) with nut 2.7.2
On Mar 9, 2015, at 12:00 PM, Rob Groner <rgroner at RTD.com> wrote:> 1) Autoreconf *must* be run, and not ./configure? I had thought that putting in my *.c and *.h files and making the makefile changes and then executing ./configure for the first time would be enough.Each tool serves a different purpose. autoreconf (and NUT's autogen.sh, by inclusion) generates the ./configure script. I think it typically runs it as well, but often you would re-run it with "--prefix=" or other arguments (such as "--with-drivers=usbhid-ups" to cut down on compilation time). It occurred to me that your driver will be introducing new USB VID:PID entries, so this is something else that autogen.sh does: it rebuilds the udev files that change permissions when the UPS gets plugged in. I mentioned pulling in a copy of autogen.sh earlier, and I'm not sure what other developer-only scripts are left out of the tarball. We really only heavily test two cases: building from Git, and building from a clean tarball. Small patches to the tarball are easy; structural changes like adding files are harder to guarantee that they will work. That, plus the fact that 2.7.2 still has the old prefix number on the udev files, means you might be better off starting from the latest Git version of NUT, or at least including the following patch: https://github.com/networkupstools/nut/commit/040c800efad46ead9670077c9764360802d7aaf5 Reference: https://github.com/networkupstools/nut/issues/140 -- Charles Lepple clepple at gmail
Apparently Analagous Threads
- building from git (was Re: Install problems (group permissions) with nut 2.7.2)
- Install problems (group permissions) with nut 2.7.2
- Install problems (group permissions) with nut 2.7.2
- Install problems (group permissions) with nut 2.7.2
- Install problems (group permissions) with nut 2.7.2