NSLU2-Linux
view · edit · print · history

Building the binaries from the tarball

This HowTo describes how to build the sources from the tarball. This was written with 2.5 in mind. For other versions your milage may vary.

Note that this is for a cross build. A native build is unbroken ground. Natively building everything will probably require an extended vacation to get things finished. However natively building selected packages or the kernel might be possible. You might want to look at OpenSlugNativeCompileEnvironment

It is assumed that you have a full-fledged linux system at hand to do the compilation on. You definitely require gcc, python 2.3 or better, and friends. If you use Fedora core and use the workstation selection while installing it you're fine. Also you need enough disk space (at least 10 GB free). Finally you need internet access as additonal software is downloaded from the web (and no, you don't want to do this with a dial-up connection).
Never work as root, so make sure you are logged in as a regular user (working under root is a bad habit and a recipe for accidents and disasters).

  • First you'll need to get the tarball. You can get this from http://www.slug-firmware.net.
  • Next create a directory where you want to put all this. The tarball does not contain a top level directory, so be sure to do this first.
  • Unzip and untar the tarball in this directory. If, despite the previous instruction you did not extract in a separate directory, make that directory now and move bitbake, conf, Makefile, openembedded, and setup-env to this directory. Do not move the tree or directories after building. There are some uncharted dependencies that cause things not to work any more after you done this (of course wizards can repair that by using symlinks, but that is not really a nice solution; better put the stuff directly in a good location). There should be no symlinks in the build path. cd `pwd -P` should take you to the true path.
  • You'll also need access to the Intel ixp400 library files, which the make scripts will not be able to fetch for you (due to separate licensing issues). Instructions for finding these 2 library files can be found on the MasterMakefile page in the section called "Standard Steps." You'll need to execute two Intel licenses, and download the files, one of which you'll need to rename. After renaming that one file, you'll need to create MD5 signatures for both files. I would recommend setting these four files aside until you run the make the first time. When that build fails, you'll have an explicit path for where to put these four files, but it will look something like: <path to build sources>/slugos-3.10-beta/downloads/.
  • Type make image or make distro-safe in the directory where you extracted the sources, see the README file for infos. This will install the cross-build environment and build all packages. It will take several hours to actually do this (about 4hrs on my 3Ghz pentium). There does not seem to be an easy way to install only the cross-build environment.
    It might be that the build stops at a certain point because some stuff needed on the internet is not available. While play-testing this, this happened for xinetd. If that happens, the most important stuff is probably build already anyway. You can try again later or just move on (and build the remaining packages manually, see later)
  • After doing the build the directory tmp/cross/bin is going to contain the cross compiler and friends. You do not need to do anything here, but if things fail you can see here whether it got this far. This directory needs to contain a number of files starting with armeb-linux- (e.g. armeb-linux-gcc)
  • The packages that have been built can be found in tmp/deploy/ipk. These can be installed on a slug using ipkg.
  • kernel and root filesystem can be found in tmp/deploy/images. UpSlug2 describes how to install the kernel.
  • Once you have gone through the initial process and want to build an individual package, execute the following steps:
    source setup-env
    bitbake <packagename>
    (e.g. bitbake zuc if you want to build the zuc package.
    The packages can be found in openembedded/packages and the name of the package is the name of the directory.
  • If you want to add a package probably the best way to start is to look at an existing package and see how things are done there (and copy/edit to make your own package). If you need more info on bitbake and its capabilities check out http://bitbake.berlios.de/manual/.You might also examine AddAPackageToOptware to see how packages are handled over there.
  • If you want to you can now make changes to the kernel or add/remove packages to the kernel. Be careful with this, and be sure to read CustomisingTheBuild first.

I hope this was useful. If you have additional info, corrections, whatever, you are strongly encouraged to update the page so others can benefit from it.


Network build

Some packages seem to demand root permissions to build successfully(at least with SuSE 9.3 Pro). I used NFS and had to change the line /mnt/openslug 192.168.xxx.xxx(rw) to /mnt/openslug 192.168.xxx.xxx(rw,no_squash_root) in /etc/exports on my NFS-server. (Where /mnt/openslug is the location you extracted the tarball to. Then against better knowledge (do a backup before you attempt this!) as root the packages which fail. The packages in questions are:

  • mgetty-1.1.30-r3 (cause: cp: cannot create regular file `/usr/local/info:/usr/share/info:/usr/info/_inst...)

On 2.7beta I tried to build on an NFS-mounted directory and it failed when trying to compile the first package (quilt). Closer examination showed an empty makefile. Building in a local directory went much better. -Zhyla


Troubleshooting

On Openslug 2.7, there is a corrupted file problem with glibc: (quoted from Řyvind Repvik on the nslu2-linux mailing list):

The glibc tarball is corrupt. Unpack it, then repack it. You might have to recreate the md5sum. Then you should be ok.

[Andrew Robinson]To correct the corrupted glibc problem I had to this after make image fails



cd downloads
tar -xvvzf ports_sources.redhat.com__20050627.tar.gz
rm ports_sources.redhat.com__20050627.tar.gz
tar -cvvzf ports_sources.redhat.com__20050627.tar.gz ports/
md5sum ports_sources.redhat.com__20050627.tar.gz | while read checksum file
do
echo -n "$checksum" > "$file".md5
done
rmdir --ignore ports
cd ..
make image



Also package cpio failed to build because I didn't have texinfo installed on the machine I was building on.



On Openslug 3.10-Beta there seems to be a problem with building the ncurses package on newer versions of the SuSE and Fedora distributions. This is confirmed for at least Fedora 7.
Specifically, you may see an error like this:

NOTE: package ncurses-5.4: started
NOTE: package ncurses-5.4-r8: task do_fetch: started
NOTE: package ncurses-5.4-r8: task do_fetch: completed
NOTE: package ncurses-5.4-r8: task do_populate_staging: started
ERROR: function do_stage failed
ERROR: see log in
[TOPDIR]/openslug-nslu2.tmp/work/ncurses-5.4-r8/temp/log.do_stage.15023
NOTE: Task failed:n
[TOPDIR]/openslug-nslu2.tmp/work/ncurses-5.4-r8/temp/log.do_stage.15023n
NOTE: package ncurses-5.4-r8: task do_populate_staging: failedn
ERROR: TaskFailed event exception, abortingn
NOTE: package ncurses-5.4: failedn
ERROR: Build of ncurses failedn


...and in the mentioned log-file:

tic: symbol lookup error: tic: undefined symbol: _nc_check_termtype
? tic could not build
[TOPDIR]/slugos-3.10-beta/openslug-nslu2.tmp/work/ncurses-5.4-r8/temp-staging/usr/share/terminfo
make[1]: *** [install.data] Error 1
make[1]: Leaving directory
`[TOPDIR]/openslug-nslu2.tmp/work/ncurses-5.4-r8/ncurses-5.4/misc'
make: *** [install] Error 2
FATAL: oe_runmake failed

The solution is to set the LD_LIBRARY_PATH variable in the setup-env file to include the directory containing the libncurses*.so.* shared libraries for i686:
Find the line

export LD_LIBRARY_PATH=


and change it to

export LD_LIBRARY_PATH="${TOPDIR}/openslug-nslu2.tmp/staging/i686-linux/lib"


or whatever value may fit your particular installation.

Thanks to Mike (mwester) for providing this solution in the nslu2-linux group.

On SlugOS-4.8-beta, you may encounter an error at the libltdl library due to your cd command echoing a successful directory change. To fix this, remove your CDPATH variable before building:

unset CDPATH


----

Tar version on debian

If using debian stable a.k.a. debian etch, you will have problem due to the version of GNU Tar that is being provided. Download the package of the version used in sarge on http://packages.debian.org and install it with dpkg -i.

Page last modified on July 31, 2008, at 08:00 PM