Setting up OE
Firstly read and digest http://www.openembedded.org/wiki/GettingStarted (or alternatively try QuickStart)
By following the instructions you should end up with four directories
- bitbake
- conf
- monotone
- openembedded (or maybe org.openembedded.dev)
A fifth directory (tmp) is created upon using bitbake for the first time
To start building for a particular machine and distribution the following must be defined either in conf/auto.conf or openembedded/conf/local.conf
For example, if the five directories are in /home/foo/balloon, then /home/foo/balloon/conf/auto.conf could be:
- DISTRO="balloon" (TODO - alter when DISTRO and MACHINE finalised) MACHINE="balloon3" TOPDIR='/home/foo/balloon' BBFILES='/home/foo/balloon/openembedded/*/*.bb' DL_DIR='/home/foo/downloads'
OpenEmbedded by default places downloaded files in the openembedded tmp directory. Sometimes (getting less often now) you need to delete the whole tmp directory. Fortunately you can avoid downloading all the files again if you ensure they placed somewhere else by using the DL_DIR directive.
For bitbake to work two environment vars must be set so bitbake knows where to find the packages (I think useful to save in a setup-env file or similar)
- export BBPATH=/home/foo/balloon:/home/foo/balloon/openembedded export PATH=/home/foo/balloon/bitbake/bin:$PATH
Then try building a package
For example:
- cd /home/foo/balloon
- setup-env bitbake package-index (if this fails with ipkg-make-index not found then bitbake ipkg-utils (can stop it once gets to building X11) and rerun package-index) bitbake balloon3-kernel bitbake bootstrap-image
Updating OE
To update your packages with the latest changes
- cd /home/foo/balloon
- setup-env mtn --db=monotone/OE.mtn pull monotone.openembedded.org org.openembedded.dev cd openembedded mtn update
Standalone usage
- To use the OE toolchain standalone, shell script to set up the vars required bitbake devshell or just use bitbake -b openembedded/packages/mypackage.bb -c compile -f
Bitbake
In essence Bitbake does the hard stuff whereas OpenEmbedded is the meta data (packages and conf files)
Details about bitbake can be found here http://bitbake.berlios.de/manual/
Useful bitbake options:
- Build a single package bitbake -b openembedded/packages/mypackage.bb
- Clean a single package bitbake -b openembedded/packages/mypackage.bb -c clean
- Unsure what bitbake is doing or why it hasn't built something, then bitbake -D package
- Want to know the variable settings bitbake -e package
- Want to know all the package versions bitbake -s package
Encountered problems
As of Feb 2007 there is a yet to identified problem with some machine configurations that leads to the error 'Unable to open conf/bitbake.conf'. If you encounter this error in response to any bitbake command it is likely your .conf files are not being read, either due to typo (hopefully) or a more specific problem with the python scripts and interaction with the set environment of the PC. If the latter config problem the quickest solution to preserve sanity appears to be 'find a different machine'.
If bitbake package-index fails with ipkg-make-index not found then do a 'bitbake ipkg-utils', feel free to stop it once it gets to building X11 and rerun bitbake package-index.