Revision as of 13:02, 22 March 2009 by Atin (talk | contribs) (Local Overlay Setup)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This guide briefly describes one way to modify packages contained within OpenEmbedded (OE) for 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 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}"

# bitbake 1.8.12 filters env except for that specified in BB_ENV_EXTRAWHITE  

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="${OE_TOP}/recipes/*/*.bb ${USERBRANCH}/recipes/*/*.bb"


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
|   |-- recipes
|   |   `-- u-boot
|   |       |-- (local copy of the recipe)
.   |       .-- ...
.   .
.   .
|   |-- sources
|        `-- u-boot
|            |-- ... local copy of the sources for u-boot
| -- openembedded
|    `-- recipes
|        `-- 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 you can change that to point to a local file://dummy.txt file you create in the files folder of the local copy of your package files. Then, a build will use the sources specified in S without going through the step of downloading the files specified in SRC_URI in the original recipe. 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).

If you modified S = to point to your own local copy of the sources, and modified SRC_URI such that it points to a dummy file in the files directory in your local copy of the package, you could call:

bitbake -c compile -f u-boot

to force a compilation using your local source files while skipping the download step.