My OpenEmbedded enviroment

From time to time someone ask me why their attempt to use OpenEmbedded fail — I’m a bit tired of saying the same each time so I decided to write how I have directories setup.

I use ~/devel/ to keep all things where I’m involved:

bitbake/ -- Subversion tree of Bitbake
build/ -- place where I do all OE builds
build/0912/ -- currently used build (c7x0 related)
build/oz353/ -- OpenZaurus 3.5.3 upgrades
build/armv4l/ -- testing "collie" build
build/native/ -- native i686 build for developing OPIE
build/wrt/ -- build for my OpenWRT powered router

doc/ -- misc documentation (QT/E, Qtopia and other)
fonts/ -- DejaVu fonts which I convert from TrueType to QPF

oe/ -- OpenEmbedded directory
oe/org.openembedded.dev/ -- development repository
oe/branch.oz354fam083/ -- frozen repository for release
oe/hrw-packages/ -- my misc testing packages
oe/hrw.db -- database with all OE stuff

openwrt/ -- copy of OpenWRT build system
opie/ -- development for OPIE
sources/ -- DL_DIR, CVS_DIR for OpenEmbedded
tmp/ -- place for all misc tweaking

This gives me easy way of doing builds. All to do is:

cd ~/devel/
. setup-oe.sh build/0912/

and everything is configured — BBPATH set, bitbake and gcc 2.95 added into PATH so I can start bitbake shell and do OE related work.

setup-oe.sh:

#!/bin/sh

# Set this to the location of bb
BB_DIR=/home/hrw/devel/bitbake/trunk/bitbake

# The location of the packages
OE_DIR=/home/hrw/devel/oe/org.openembedded.dev

HERE=`pwd`

cd $BB_DIR
svn update
cd $HERE
cd $OE_DIR
monotone pull monotone.vanille.de org.openembedded.dev
monotone --lca merge
monotone update
cd $HERE
cd $1

#use this if using the openzaurus cross compiler
PATH=$BB_DIR/bin:/usr/local/arm/2.95.3/bin:${PATH}

# Blank this so we don't link non-arm libraries
LD_LIBRARY_PATH=

# Don't export TARGET_ARCH -- it *will* cause build failures
export PATH LD_LIBRARY_PATH

#make error messages understable for everyone
export LC_ALL=C

#one command to make rebuild
bbrebuild()
{
        bitbake -b $1 --cmd=clean
        bitbake -b $1
}

export BBPATH=`pwd`:$OE_DIR
unset BB_DIR
unset OE_DIR