Revision as of 08:56, 15 December 2008 by Atin (Talk | contribs) (Local Overlay Setup)

Jump to: navigation, search

This guide briefly describes one way to modify packages contained within OpenEmbedded (OE) for the the BeagleBoard.


You should set up the OpenEmbedded environment for the BeagleBoard by following the BeagleBoardAndOpenEmbeddedGit guide first before using this guide.

Local Overlay Setup

Many of us have installed OpenEmbedded to allow us to make BeagleBoard specific modifications to the official packages that are already in OpenEmbedded. One way to accomplish this is to use a local overlay tree that contains a copy of that the tree that was created in the BeagleBoardAndOpenEmbeddedGit guide. The local overlay packages will override the packages contained in the tree, with the recipes in the local copy of the package being preferred over the recipes in the tree. You could even have a full copy of the tree under the local directory, and each package will override the one in the tree.

This guide assumes that the tree was created under $HOME/oe/openembedded, or /home/you/oe/openembedded and the local overlay tree you will be using will be under /home/you/oe/local. It also assumes that the package you are modifying is the u-boot package. Change the path names and the name of the package as appropriate for your installation and package.

Edit the file that was created in the BeagleBoardAndOpenEmbeddedGit guide under the /home/you/oe/beagleboard/beagleboard directory to look like:

export OE_HOME="${HOME}/oe"
export OE_TOP="${OE_HOME}/openembedded"

export MY_OE_CONF="beagleboard"
export USERBRANCH="${OE_HOME}/local" 

export BBPATH="${OE_HOME}/beagleboard/:${OE_HOME}/beagleboard/${MY_OE_CONF}:${OE_HOME}/openembedded"
export PATH="${OE_HOME}/opt/bitbake/bin:$PATH"
if [ "$PS1" ]; then
  if [ "$BASH" ]; then
    export PS1="\[\033[01;32m\]OE:$MY_OE_CONF\[\033[00m\] ${PS1}"

Assuming the angstrom-2008.1 distribution, edit the /home/you/oe/beagleboard/beagleboard/conf/local.conf file (you may need to create it) to look like:

DISTRO = "angstrom-2008.1"

Edit the /home/you/oe/beagleboard/beagleboard/conf/auto.conf file (you may need to create it) to look like:

MACHINE = "beagleboard"

Edit the /home/you/oe/beagleboard/beagleboard/conf/site.conf file (you may need to create it) to look like:

# collection setup
BBFILES="/home/you/oe/openembedded/packages/*/*.bb /home/you/oe/local/packages/*/*.bb"


For some reason, using the symbolic names ${OE_TOP} and ${USERBRANCH} did not work in BBFILES so I just used the full paths in my site.conf file. The priority for the _user has to be higher than the priority for _oe to make bitbake prefer the user packages over the openembedded packages.

The final directory structure would look something like:

|-- beagleboard
|   |-- beagleboard
|       |--
|       |-- conf
|           |-- auto.conf
|           |-- local.conf
|           |-- site.conf
|-- local
|   |-- packages
|   |   `-- u-boot
|   |       |-- (local copy of the recipe)
.   |       .-- ...
.   .
.   .
|   |-- sources
|        `-- u-boot
|            |-- ... local copy of the sources for u-boot
| -- openembedded
|    `-- packages
|        `-- u-boot
|            | -- (official recipe)
.            . -- ...
.            .
.            .

In my case, the files under /home/you/oe/local/packages/u-boot are the same as those in /home/you/oe/openemedded/packages/u-boot, with the recipe changed to use the local sources or some other git repository than the one specified in the official upstream that is present in the openembedded/packages/u-boot directory. If you want to specify another public repository in the .bb file, you can change the SRC_URI in the local package's version to point to it. If you just want to use a local copy of the sources, without using a public repository, you can change the S variable in the .bb file from:

S = "${WORKDIR}/git"

or whatever S is set to in the recipe, to point to your local directory that contains your copy of the sources like:

S = "/home/you/oe/local/sources/u-boot"

Overriding S will still download the repository specified in SRC_URI, but will then build using the sources specified in S. Now, you will be sourcing the file to set up your build environment before you start your build:

source /home/oe/beagleboard/beaglboard/

Now when you call:

bitbake u-boot 

it will use the /home/you/oe/local/packages/u-boot/ recipe instead of the one in the openembedded tree ( is the recipe for the u-boot package).