[Ben's home]
[Nias home]


AT32ipkg
The community repository for AVR32 binaries.


WARNING: Since creating this it's come to my attention that uClibc doesn't guarantee a stable binary interface.  As such each package must be used on a system with the same library versions as the package was originally linked against.  I have not tracked this.  I'll get around to it shortly but until then don't be surprised if the packages Segfault or just act funny.  Thanks :-)

My aim here is simply to provide an easy method for the AVR32 community to share binaries.  Support is offered either through direct email contact or, for preference, on the AVRFreaks Forum where I go by the username squidgit.  Be sure to post in the AVR32 Linux section.  Don't bother PM'ing me, I practically live in that place ;-)


My aim is not to make another Linux distro for the AVR32.  For network-oriented designs I highly recommend OpenWRT, for most other designs, you can use OctoTux.  As such, AT32ipkg will not provide packages for busybox, the kernel or any other system-critical packages.  It does however assume you have a set of startup scripts which will run any S-prefix script in the /etc/init.d folder (such as the scripts used in avr32 buildroot filesystems).

OpenWRT uses the ipkg system as well, their main repository can be added to your ipkg.conf if you want, though I don't recommend it.  I have cherry-picked a few of the more interesting packages from their repo as I don't really want to have people grabbing their kernel and busybox packages by mistake, they could well break your system.

They do have a secondary repo which just contains extra packages; this is enabled by default in the ipkg.conf I've got here.

Despite this being hosted on the Nias Digital website, I am not being paid for any of this work so please be patient with me :-)

How to Use
I've decided to use the ipkg system on this particular repository.  Despite the fact that both rpm and dpkg are included in later Busybox releases, ipkg still has great advantages in size of packages and metadata.  Besides, ipkg can take .deb format packages natively and can take RPMs which have been converted to .deb using a tool like Alien.  Despite this, I haven't tried using Octotux RPMs converted to .deb or .ipk.  If anyone has a spare millisecond and would like to try, please do so and report your success!

The first step is to install ipkg on your avr32 board.  This is as simple as saving ipkg to /usr/bin then saving ipkg.conf to /etc, both on your avr32 board.  You may also want to save update-alternatives to /usr/bin too.  Note that you will have to

chmod +x ipkg update-alternatives

so as to make them executable.  Note that I'm using an old version of ipkg implemented as a shell script as the newer versions written in C, when compiled for the avr32, segfault.  Really quite often.  I can't be bothered to debug, but if someone else wants to, go for it!


On your command line, you can then run

ipkg update


and start grabbing packages!

You'll probably want at least the commands

ipkg list

ipkg install <package>
ipkg remove <package>

You can find the full ipkg reference as well as more general information on the ipkg Wiki

If your wget starts complaining when you run ipkg, you may need to install this one instead.  Simply copy it to your /usr/bin folder on your AVR32 and rename it 'wget'.  This web server has an odd bug which won't allow me to name the binary wget.  Weird.  The wget which ships with Busybox doesn't understand the --passive-ftp switch required for ipkg.  Now, the executable is the only _required_ bit of wget, but not the only bit.  Once you've got the binary, you can run

ipkg update && ipkg install wget

to get the rest of the files, dependancies, bells and whistles.

Experimental Packages
There are also some experimental packages available.  If you want access to these, open ipkg.conf and uncomment the experimental src line.

Be warned, these have not been exposed to significant testing and may explode.

tar has run out of space!
One limitation with this system is that ipkg extracts the contents of each package to a folder in /tmp.  /tmp exists in RAM and, given the small amount of RAM on your avr32 board, may well just fill it!  If you're root filesystem exists in Flash then you probably don't want /tmp living on that either so you're a bit stuffed, but if you've got a rootfs media upon which you don't mind having /tmp mounted (eg NFS) then you can move /tmp to that.  To do this open up /etc/init.d/S00mountvirtfs and place a # in front of the line mounting /tmp.  It will look something like

mount_fs tmp /tmp tmpfs


Remember it is assumed that /tmp will be emptied on each reboot so generally you should add something to your startup or shutdown scripts to empty the directory too.

But my package needs kernel support :s
Some kernels require support from the running kernel.  In a normal distribution this would be as simple as adding a kernel module package as a dependancy but, by policy, at32ipkg won't touch your kernel.  Instead there are a series of dummy packages prefixed with kmod-.  These will add files to /etc/mod-list which describe what your kernel must support.  As such, if you find a package not working, check the mod-list directory.  Make sure the kernel you're running has all the listed features compiled in.

Yes it ain't purdy but hopefully this will be rare enough that it won't be a problem.


Contributing
As mentioned before, the idea of this project is community sharing.  As such, please, when ever you compile something new for the avr32, contribute it here!  There are many ways to do this, listed below in decreasing order of goodocity.  My email is bn@niasdigital.com

1:    Make your own .ipk as per the instructions here and email them to me along with an assurance that they are tested and working.  If you submit things which have not been tested I will shave your pet doggie.  NOTE: Please build the packages with the -c switch.  This will compress the outer layer with gzip rather than ar, which is what's needed.

2:    Once you've compiled your software, install it to a temp directory, tar that directory up and email it to me along with instructions (or preferably scripts) telling me what (if anything) has to be done before and after install and remove.  For example, if it's a kernel module then after install and remove 'depmod' would have to be run again.  Once again, assurance will be required that the package has been tested and is working.

3:    Fill out a page in avr32linux.org's LinuxApplications section and drop me an email asking me to make and package it up for you.

4:    Send a polite request asking whether I'd mind trying to compile and package something for you

5:    Send an impolite request and watch it > /dev/null

In the email, please specify whether you want this put in the main or experimental repository.  Only recommend a package for main if it's either trivial or heavily tested.  If in doubt, or if nothing is specified, it'll go in experimental.

I will try and keep all the packages up to date with the latest stable releases.  If you notice any package out of date please let me know or better yet, remake the package and flick-pass it my way.

If you use any of the ipkg-utils (aka ipkg-tools) you may want to update the ipkg.py script with this new one.

Files
ipkg The ipkg shell script.  Save to /usr/bin
ipkg.conf The ipkg configuration file.  Save to /etc
update-alternatives Similar functionallity to debian's update-alternatives.  Allows you to select which version of a file to use if it is provided by multiple packages (eg which 'java' to use if you have both sun-java and gcj installed).  Save to /usr/bin.
wget GNU Wget.  Used to replace the Busybox version which is incompatible with the ipkg scripts.  Save this to /usr/bin, rename to wget as a temporary measure but then use the (now working) ipkg to grab the wget package to supply support files.
ipkg.py The python library script for working with ipkg files.  This updated version (relative to the one on the ipkg website) provides support for newer versions of tar.


Our GPL Compliance

Many of the programs in this repository are distributed under the GNU Public Licence ( http://www.gnu.org/copyleft/gpl.html ).  In setting up this repo I'm distributing binaries of these packages and as such need to distribute source too.  To the best of my knowledge, all appropriate source (and a bunch besides) can be found in the source directory on this server.

If you require any of this source and for some reason can't download it from here, send an email to gpl@niasdigital.com and we can send you a CD with the source for just the cost of postage.

Your GPL Compliance
Just a friendly reminder that if you distribute any of these GPL'd binaries in your product you must also distribute the source, including any changes you have made to them.  This includes things like the Linux Kernel and Busybox, assuming you have those.