Main -> Software Overview -> OpenEmbedded


OpenEmbedded

This page is dedicated to provide information on how to work with OpenEmbedded.

http://imgs.xkcd.com/comics/compiling.png "The OpenEmbedded (OE) project maintains and develops a collection of BitBake recipes, similar to Gentoo's ebuilds. The bitbakes consist of the source URL of the package, dependencies and compile or install options. During the build process they are used to track dependencies, cross-compile the package and pack it up, suitable to be installed on the target device. It's also possible to create complete images, consisting of root file system and kernel. As a first step the framework will build a cross-compiler toolchain for the target platform." (http://en.wikipedia.org/wiki/OpenEmbedded)


Getting Started…

Dependencies

For several major distributions, it may be faster to follow the specific instructions provided on the OE wiki. Also, note that building OE on Windows is currently not supported. Using a Linux virtual machine is recommended if you're unable to run Linux natively.

It should be noted that since the OSWALD OE repository is based on upstream's development branch you should always try to use the latest version of bitbake available (currently 1.8.18) or even the latest pulled from the OE bitbake git repository. Older versions of bitbake may not support all the features in newer package recipes which can cause problems.

Ubuntu

This is a compilation of the commands found on the OE wiki for Ubuntu. Along with some unmentioned dependencies such as:

sudo apt-get install sed wget cvs subversion git-core \
   coreutils unzip texi2html texinfo libsdl1.2-dev docbook-utils \
   gawk python-pysqlite2 diffstat help2man make gcc build-essential g++ \
   quilt qemu-arm-static python-psyco bitbake libxml2-utils xmlto

Gentoo

We provide specific instructions for setting up OE on Gentoo Linux as that is our distribution of choice.

Installation

A base directory should be created for the OpenEmbedded environment.
To create the directory structure:

cd ~
mkdir -p openembedded
cd openembedded

Next, the OE must be cloned from the OSWALD repository.
First make sure you're in the base directory of the OE environment you setup previously. Then clone the repository:

git clone git://code.oregonstate.edu/oswald-oe

Updating

The development branch of OE is updated very frequently so it is recommended to update your OE tree often. To do this, run:

git pull

within the directory created by the initial checkout of OE.

Create local configuration

Now the OSWALD OE overlay needs to be cloned as well. Again, make sure you're in the base directory of your OE environment and then clone the repository:

git clone git://code.oregonstate.edu/oswald-oe-overlay

Then, you'll need to edit the oswald-oe-overlay/conf/local.conf file. At the top of the file, the following lines need to be updated for your setup:

# Change these for your setup
OE = "${HOME}/openembedded"

Notes on local.conf:

The OE variable sets the base OpenEmbedded directory, DL_DIR is where downloaded files are placed, OE_DIR is the location of the OSWALD OE repository directory, and OVERLAY_DIR is the OSWALD OE overlay repository directory.

In addition, you should configure the BB_NUMBER_THREADS, PARALLEL_MAKE, and ASSUME_PROVIDED variables specifically for your environment. BB_NUMBER_THREADS defines the maximum number of tasks that bitbake can run simultaneously while PARALLEL_MAKE defines the number of threads used by make to parallelize the build process. These should usually be set relative to the number of CPUs available on your system.

Finally, ASSUME_PROVIDED defines packages available on the host system which are used by OE so they don't need to be built within the OE environment. If you don't recognize any of the package names you should consider commenting out that part of the config file so OE builds everything.

Setup the build environment

The easiest way to setup the build environment is to set the BBPATH variable in your shell's init file (e.g. ~/.bashrc). For example, the default configuration should work with the following line:

OE=$HOME/openembedded
export BBPATH=$OE:$OE/oswald-oe:$OE/oswald-oe-overlay

Don't forget to change the paths as necessary for your setup.

Start building

To build the standard Radix image use the following command:

bitbake radix-image

The build process should run for a long time (depending on how fast your machine is this can take anywhere between about three and twenty hours) and eventually produce a kernel image and rootfs.

Dealing with Errors

The OE FAQ has solutions to most of the common problems. Also, if you're still lost feel free to send an email to the oswald-dev mailing list or jump on the #oswald IRC channel.


Setting up OE on Gentoo

The following instructions should help experienced Gentoo users get an OE build environment for the OSWALD running quickly. Note that the instructions assume a lot of prior knowledge about Gentoo and the command line environment so they are targeted at experienced users.

We use Gentoo for our main build machines for the OSWALD project so we are somewhat biased towards it. Other developers should feel free to add updated instructions on how to get OE running for OSWALD development on this site as the instructions on the OE wiki may be deprecated or incomplete.

Install bitbake

The latest version of bitbake in the portage tree is usually not marked stable so bitbake must be keyworded if you run a stable system. As stated above, you should definitely run the latest version of bitbake, currently 1.8.18. A bitbake git ebuild is also available in the overlay for those who want to use a bleeding edge version straight from upstream's bitbake git repository.

To get the oswald-gentoo-overlay git repository, use the following command:

git clone git://code.oregonstate.edu/oswald-gentoo-overlay

Clone the repositories

Next you should clone the OSWALD repositories for OE and the OE overlay:

git clone git://code.oregonstate.edu/oswald-oe
git clone git://code.oregonstate.edu/oswald-oe-overlay

Edit the local.conf file

The local.conf file must be edited for your specific build environment as detailed in the instructions above.

Set the BBPATH variable

To setup the build environment in your shell, you can just export the BBPATH variable in your shell's init file using the value shown above for the default configuration.

Starting building

If you setup the environment correctly, you should be able to start building the standard Radix image or other packages.


Attachments