[Nut-upsuser] cross-compiling nut

Tilman Glotzner tilmanglotzner at hotmail.com
Sat Jul 30 15:09:15 UTC 2011


Hey Johnea

many thanks for your support.
 
On step ahead -- the deployment works as it is supposed to work. 
Adding 
    NUT_LIBTOOL_PATCH = NO
to nut.mk makes it build. 
 
The program names become funny however: apcsmart for instance was stored as arm-linux-apcsmart
The buildroot mailing list advised me to add the following option to fix this issue:
 
NUT_CONF_OPT = --program-transform-name='s/$(GNU_TARGET_NAME)-//;'
 
> But again, how this fits into the 
> buildroot framework i'm not sure. My experience is that autotool's files are 
> only slightly harder to read that ancient Sanskrit 8-)
I feel the same way -- and I am a Sanskrit illiterate :-)
 
> Come on man, it's your board, give yourself permission 8-)
The tought occured to me :-)  Well,  it is not a matter of permission. The directories are on a read-only file system residing in a flash. I need to download and flash an the image which is a lengthy process of around 5 minutes (excluding building the image). You only want to do this once in a while.
 
- Is there a config  option to only compile only a particular ups driver (to reduce the size of the image) ?
- And is there an configure option to provide my own config file in etc ? etc resides on the flash as well...
- And is there a command line option for upsdrvctl to read a config file other than /etc/ups.conf ?
 
Thanks
Tilman
 
 
> Hey Tilman,
> 
> > a) The compiler chain that came with the board uses buildroot. I tried to integrate nut into the buildroot tool chain, but it fails building.
> 
> I'm not a buildroot expert. I've always run into quite a learning curve trying 
> to get any of those environments (buildroot, openembbeded, yocto, etc) to do 
> anything custom for me.
> 
> As I said, I run archlinux and have a host with the pacman/makepkg package 
> management system installed. I've found it useful to manually crossbuild and 
> intall pacman on embedded targets, then cross build packages on the development 
> host and install them on the embedded target using the crossbuilt pacman that I 
> manually installed.
> 
> Having a package management system makes it so much easier to upgrade, or 
> delete, the application files (in this case nut) on the target.
> 
> So if buildroot is too onerous, maybe try installing and using opkg:
> http://code.google.com/p/opkg/
> 
> or pacman:
> http://www.archlinux.org/pacman/
> 
> Or, if it's just a one time thing, maybe just copying in the files manually is 
> easiest.
> 
> The file list (that I attached earlier) shows the files and locations that nut 
> installs on the system here. (the difference will be that the package here are 
> configured with --prefix=/usr and yours will be --prefix=/usr/local. So modify 
> the directories you copy into accordingly)
> 
> > b) How can I verify that the cross compiler (arm-linux) was correctly detected by autoconf? Is ther a .config file or something alike in output/build/nut-2.6.1 which I can check ?
> 
> The --host config option should do this. But again, how this fits into the 
> buildroot framework i'm not sure. My experience is that autotool's files are 
> only slightly harder to read that ancient Sanskrit 8-)
> 
> >
> > d) To test the manually build nut (i.e. not using buildroot), I copied some binaries via ssh to the embedded board to /usr/local (besides /tmp this is the only place where I have write permission).
> 
> Come on man, it's your board, give yourself permission 8-)
> 
> You'll need root login for installing via package management systems.
> 
> >
> > d1) What is the minimal set of files that I need to bring to the embeeded board to see nut working ?
> 
> Reference the directory listing previously attached. Convert /usr to /usr/local
> 
> >
> > d2) And how can I change the directory in which upsdrvctl searches for its drivers ?
> 
> Looks like you need to rebuild with --prefix=/usr/local
> 
> > Thanks
> >
> > Tilman
> 
> Good Luck! Let me know how it works...
> 
> johnea
> 
> _______________________________________________
> Nut-upsuser mailing list
> Nut-upsuser at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20110730/6385e0f1/attachment.html>


More information about the Nut-upsuser mailing list