NSLU2-Linux
view · edit · print · history

Detailed guide to setting up your OpenEmbedded environment.

This page assumes that you have a machine that satisfies all the tool pre-requisites. GettingStarted has a good overview of what you will need. Items in bold may need to be modified to suit your own configuration.

Let's start in the parent directory of your new workspace, we'll create the working directory:

 mkdir /home/slug
 cd /home/slug

Now we retrieve the required files from the SubVersion and BitKeeper (or Monotone) repositories:

 svn co svn://svn.berlios.de/bitbake/trunk/bitbake

and

 bk clone bk://nslu2-linux.bkbits.net/openembedded

or with Monotone

 monotone db init --db=/somepath/oe.db
 monotone --db=/somepath/oe.db pull monotone.nslu2-linux.org org.openembedded
 monotone --db=/somepath/oe.db co --branch=org.openembedded.nslu2-linux openembedded

Next, create the local configuration:

 mkdir -p build/conf
 touch build/conf/local.conf

Put the following in your build/conf/local.conf file:

 OEROOT = "/home/slug"
 DL_DIR = "${OEROOT}/sources"
 BBFILES = ${OEROOT}/openembedded/packages/*/*.bb
 OEMASK = ""
 PREFERRED_PROVIDERS = " virtual/${TARGET_PREFIX}gcc-initial:gcc-cross-initial"
 PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}gcc:gcc-cross"
 PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}g++:gcc-cross"
 MACHINE = "nslu2"
 DISTRO = "unslung"
 OEINCLUDELOGS = "yes"

If you are building OpenSlug rather than Unslung, replace unslung with openslug above.

Next, we create a shell script that configures the environment:

 touch setup-env

Put the following in the setup-env file:

 OEROOT="/home/slug"
 OESYS=$OEROOT/bitbake
 PKGDIR=$OEROOT/openembedded
 OEBUILD=$OEROOT/build
 BBPATH=$OEBUILD:$PKGDIR:$OESYS
 PATH=$OESYS/bin:$PATH
 cd $OEBUILD
 LD_LIBRARY_PATH=
 export PATH LD_LIBRARY_PATH BBPATH
 export LANG=C
 unset LC_CTYPE
 unset CC
 unset CXX
 alias bb=bitbake
 echo "Environment set up for OpenEmbedded development."

Now, you need to ensure that your current shell has all of the settings we just put into setup-env, so do this:

 source setup-env

You will need to perform the above step in each and every shell used to execute OE commands.

You are now ready to build:

  bb unslung-image

Note: On Gentoo, one might run into conflicts with BusyBox? which is installed as /bin/bb. Just use bitbake instead of bb

The resulting files will end up in ${OEROOT}/tmp/deploy/images

If you are building OpenSlug rather than Unslung, replace unslung with openslug above.

Some problems you may encounter and how to solve them:

  • "NOTE: package quilt-native-0.39-r0: task do_fetch: failed"

Check that you have enough memory and swap space. The out of memory error is evidently not passed along.

  • During the process, the system will download patches and source packs. Sometimes these downloads may fail on all mirrors and the build process will then halt when trying to unpack the file. Use your favorite search engine to look for alternate sources for the file (the file name will be provided by the build process), download it and place it in ${OEROOT}/temp/sources and resume the build process.
  • As of late Dec. 2004, the cpio package has a bug which causes it to try to create a number of directories in the root file system on the build host. If the build is done from an unpriviliged user on a host where some of these directories are missing, the build process will fail complaining that it cannot create these directories. One way of going around this (until the bug is fixed) is to go in as root, create these directories manually before resuming the build process as the unpriviliged user. The directories may be removed after the build process has completed.
  • You get a cryptic message from bitbake (bb) after it has parsed all the files and completed the "Building the provder cache" step, something like:
 Traceback (most recent call last):
File "/usr/local/bin/bitbake", line 700, in ?
    bb.event.fire(bb.event.BuildStarted?(buildname, pkgs_to_build, make.cfg))
  File "/usr/local/lib/python2.4/site-packages/bb/event.py", line 49, in fire
    if tmpHandler(event) == Handled:
  File "tmpHandler(e)", line 30, in tmpHandler
 NameError?: global name 'bb' is not defined
This means you have an out of date bitbake, from some time around January 2005 or earlier. Use svn up to update the bitbake tree, or just rm it and repeat the svn co step above. If this doesn't fix it you followed the older instructions and ran setup.py to install bitbake in /usr/local/bin. Reinstall it - the installed files take precedence over the ones in the bitbake svn tree.
  • You may get a message from bitbake indicating that there was nothing to build, with 0 files fetched and 0 cached -- but with no error messages per se. Make sure that your $BBPATH variable specifies the build directory first. The bitbake directory contains its own conf/local.conf file, and if the bitbake directory is in $BBPATH and bitbake finds that one before it finds yours, it won't see your local.conf file at all.
view · edit · print · history · Last edited by mathieu_xwave.
Based on work by x-way, repvik, n1xnx, dmahurindmaorg, jbowler, bobtm, rwhitby, and peteru.
Originally by peteru.
Page last modified on August 06, 2005, at 12:12 PM