Development for Familiar

From MoDe

Table of contents


This page describes how to develop and compile C/C++ applications for your IPAQ for Familiar (currently v.0.8.2 stable).

IPKG Packaging System

The IPAQ uses the ipkg packaging system to distribute and install software. This system is very much like apt-get or yum if you're familiar with them. The package itself is either a .tar.gz or a .ar file, which you can unpack manually. Once unpacked, you'll 3 files:

   control.tar.gz
   data.tar.gz
   debian-binary (text file used for .deb packages)

data.tar.gz contains the actual binaries in the correct directory structure (e.g., /usr/bin/<executable files>). control.tar.gz contains the control files. The only required file is the one named "control". It looks something liked this:

   Package: coreutils
   Version: 5.1.3-r1
   Description: A collection of core GNU utilities.
   Section: base
   Priority: optional
   Maintainer: OpenEmbedded Team <oe@handhelds.org>
   Architecture: arm
   OE: coreutils-5.1.3
   Depends: coreutils-locale*, libgcc1 (>= 3.4.3), libc6 (>= 2.3.2+cvs20040726)
   Provides: textutils, shellutils, fileutils
   Replaces: textutils, shellutils, fileutils
   Source: ftp://alpha.gnu.org/gnu/coreutils/coreutils-5.1.3.tar.bz2 

There are 4 additional optional files - preinst, prerm, postinst, postrm. These are just shell scripts that perform operations before and after install, and before and after package removal.

Information on the web is a bit sparse on ipkg, but there's an old wiki page (http://handhelds.org/moin/moin.cgi/Ipkg) on handhelds.org that contains some more info. Also, there's a link on the wiki page to this page (http://handhelds.org/moin/moin.cgi/BuildingIpkgs) which gives you a link to a bunch of utilities available for building ipkgs and creating/maintaining feeds. Again, documentation is pretty sparse, but the utilities are just scripts, so you can just look through most of them.

Currently, the Familiar distribution has moved to a new framework for building and packaging software called OpenEmbedded (see below), so they no longer seem to update the utilities for building ipkgs manually (or the documentation). However, since the packaging system hasn't changed, these methods still work and probably still the most straightforward to use.

Method 1 - Native Compile

In the past, there used to clusters (http://handhelds.org/projects/skiffcluster.html) maintained by handhelds (skiff and ipaq clusters) that you could use to natively compile applications. As of two years ago, these were still around, but I don't believe they exist anymore - can anyone confirm this?

The simplest (and hackiest) way to do a native compile is to store all the necessary libraries on another computer and mount the directories as needed over the network for compilation. This is also the method I use usually to compile things. For those at MIT, Albert already setup the libraries on tempura. You can mount them over nfs via:

   mount -t nfs tempura.csail.mit.edu:/usr/org/ipaq/usr /usr
   mkdir /mnt/org
   mount -t nfs tempura.csail.mit.edu:/usr/org/ipaq/lib /mnt/org
   cp /mnt/org/* /lib

Be aware, however, that the libraries here are a year old, and comes with gcc v2.95. The current version of Familiar is built with gcc v3.4, so it may be worth setting up your own build system with updated libraries and compilers. I will update the libraries on tempura at some point if you're willing to wait.

UPDATE: Updated libraries and binaries for Familiar v.0.8.3 RC2 can now be found on ozone.csail.mit.edu. To mount the share, do the following:

   mount -t nfs ozone.csail.mit.edu:/usr/org/ipaq/usr /usr

The directory is also read-only. If you need any additional libraries installed, email me (mailto:nsong@csail.mit.edu) and I'll add them.

If you're looking for something a little more structured, see the next two methods below, which involve cross-compile. The advantage of cross-compile is that it is all done on your PC. However, note that I have not played with these build environments yet, so I won't be able to give much support.

Method 2 - Scratchbox

See the following page for information on Scratchbox (http://www.scratchbox.org/). Scratchbox is basically a toolkit for cross-compiling on your Linux PC for handhelds, and it offers a more structured way of building libraries and applications. You'll still need to grab the correct libraries (or compile them) and set up the correct directory structure (though it does come with a basic toolchain for ARM), once the setup is done, building is pretty straightforward, and there's decent documentation to get you started

Method 3 - OpenEmbedded

OpenEmbedded (http://oe.handhelds.org/) is the current framework used to build Familiar. Out of all the methods, this one is most complicated to set up and use, but again, once the initial setup is done, building is should be straightforward. Documentation here is still spotty (read: incomplete), but the advantage is that the toolkit is already tailored specifically for Familiar, so it comes with all the libraries and compiler already in place. If you're feeling ambitious, this is probably the best option out of all the three.


--Ning Song (mailto:nsong@csail.mit.edu)

Last edit: 2/24/06