Skip to content
Nicolas Mace edited this page Sep 22, 2023 · 2 revisions

This project is a good example that shows the benefits of direnv. If you follow the OpenEmbedded - Getting started instruction, you will see a set of paths and environments variables that must be set in your .profile.

By using direnv, you will avoid having to change your system to cope with the OpenEmbedded requirements and also get a portable project directory that you can move around at will.

direnv instructions

Getting the sources

mkdir oe; cd oe
wget http://download.berlios.de/bitbake/bitbake-1.10.2.tar.gz
tar xzvf bitbake-1.10.2.tar.gz
ln -s bitbake-1.10.2 bitbake
git clone git://git.openembedded.org/openembedded
mkdir -p build/conf

Settings-up the environment

(in your "oe" folder)

cat <<ENVRC > .envrc
export TOPDIR=$PWD
export BBPATH=$PWD/build:$PWD/openembedded
export PATH=$PWD/bitbake/bin:$PATH
export TMPDIR=$PWD/tmp
ENVRC

Debian/Ubuntu: OE depends on /bin/sh linking to /bin/bash instead of the default /bin/dash you have. Unfortunately, direnv is not able to update the /bin/sh symlink dynamically. Run sudo dpkg-reconfigure dash and select "no".

Other kind of developer dependencies aren't provided by direnv either, so you still have to install them on your system.

Create local configuration

(in your "oe" folder)

cp openembedded/conf/local.conf.sample build/conf/local.conf

Follow the OpenEmbedded instructions, but in places where you use an absolute path, use "${TOPDIR}" as a prefix. For example:

DL_DIR = "${TOPDIR}/sources"
BBFILES = "${TOPDIR}/openembedded/recipes/*/*.bb"
DISTRO = "angstrom-2010.x"
MACHINE = "beagleboard"

That's it ! You can try the build process by running bitbake nano. From here on, I give back the voice to the official wiki for you to get more infos.