Openembedded and Ubuntu

26 Aug

Though Buildroot doesn’t give me the satisfaction I like for my embedded project (at the moment) I am looking further into openembedded. The first things here are quite simple, so lets get started:

I’m using a Ubuntu 10.04.03 x86 server OS for those development purposes because I’ve best experiences with Long Term Supported Ubuntu distris.

Attention: If you are setting up the system right now, make sure you have enough disk space. I didn’t do “much” things and reached the 50GB limit of my VHDD easily…

I’m assuming that your system (or at least mine here) is fresh installed and blank. So first get all available updates for everything installed at the moment:

sudo apt-get update
sudo apt-get upgrade

Now get the building essential things:

sudo apt-get install sed wget cvs subversion git-core coreutils unzip texi2html texinfo docbook-utils gawk python-pysqlite2 diffstat help2man make gcc build-essential g++ desktop-file-utils chrpath python-ply python-progressbar libxml2-utils xmlto python-psyco policykit-gnome-doc gnome-doc-utils

Maybe you want to add some useful stuff as well:

sudo apt-get install build-essential autoconf make patch vim nfs-kernel-server

Now go to the directory where you want to have everything (and remember the needed disk space!) and get the obenembedded basic things via git:

git clone git:// </

Note: A good reference for the whole part ist located on the openembedded Website, check it out if you’re having problems!

Second step is to create your config. Create the directory build on the same level as openembedded. Create then the directory conf under build. A easy start is to use the sample config already provided by openembedded under “openembedded/conf/local.conf.sample” and copy it to your build directory. Rename it to match “local.conf” and edit the following things in it to match them to your wanted config.

In my case I want support for the pandaboard, so we have to change the following Variables:
DL_DIR = "/build/OE/sources"
BBFILES := "/build/OE/openembedded/recipes/*/*.bb"
MACHINE = "omap4430-panda"
DISTRO = "angstrom-2010.x"

I’m using the pandaboard, a Angstrom base root fs and the main directory “build” for all stuff. Set the threads variable according to the number of CPU cores you have available, so that compiling doesn’t take ages…

Next step is to get “bitbake” which is a kind of “apt” on the debian side. Openembedded serves you “recipes” for both “packages” and “images”. So images are some kind of a summary of what packages are needed for a purpose (i.e. x11-image makes you a small Xorg root fs). Bitbake is the program, that reads the recipes, “cooks” them and packages them into a .tar for you.

There is a ubuntu package available, but I will use the newest version here. So just get it from <HERE>, in my case 1.12:


and untar it into your openembedded directory.

The last step is now to get bitbake into your environmental settings, so just execute those two things every time you want to use it or put them into your unix profile settings:

export BBPATH=/build/OE/build:/build/OE/openembedded
export PATH=/build/OE/openembedded/bitbake/bin:$PATH

Now you can do your first cooking or baking or what the hell you may ever call it:

bitbake vim

Just fyi: It took me an hour on my 2600K CPU… And afterwards the hdd looked like

user@ubuntu:/build/OE$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             9.4G  1.9G  7.1G  21% /
none                 1003M  188K 1003M   1% /dev
none                 1007M     0 1007M   0% /dev/shm
none                 1007M   56K 1007M   1% /var/run
none                 1007M     0 1007M   0% /var/lock
none                 1007M     0 1007M   0% /lib/init/rw
/dev/sdb1              99G   24G   71G  25% /build

If you are running into the error
ERROR: Openembedded's config sanity checker detected a potential misconfiguration.
Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
Following is the list of potential problems / advisories:
Using dash as /bin/sh causes various subtle build problems, please use bash instead.
ERROR: Command execution failed: Exited with 1

then you will need to reconfigure your dash with:

sudo dpkg-reconfigure dash

and select <NO> !

The first time it will take like ages because bitbake will need to download all sources, build the corresponding toolchains etc… So maybe get SOME cups of coffee this time…