User:CesarB/Using a local overlay
From Openmoko
A local overlay is a way to add your own bitbake recipes (or override the ones from openembedded and openmoko) without having them clobbered when you update these trees.
Contents |
Creating a local overlay
To create a local overlay:
- Create a directory for it and its subdirectories
mkdir local local/conf local/classes local/packages
- Copy
site.conf
from the openmoko tree tolocal/conf
cp oe/conf/site.conf local/conf/site.conf
- Edit the local.conf you copied to add the new tree as a source for bitbake recipes. You must change the
BBFILES
andBBFILE_COLLECTIONS
variables and add newBBFILE_PATTERN
andBBFILE_PRIORITY
variables.
BBFILES := "${OMDIR}/openembedded/packages/*/*.bb ${OMDIR}/oe/packages/*/*.bb ${OMDIR}/local/packages/*/*.bb" BBFILE_COLLECTIONS = "upstream local overlay" BBFILE_PATTERN_overlay = "^${OMDIR}/local/" BBFILE_PRIORITY_overlay = "20"
The BBFILE_PRIORITY
should be greater than all the other BBFILE_PRIORITY
variables on the same file.
- Change your
BBPATH
environment variable to add the new tree before the two others (for MokoMakefile, the variable is on thesetup-env
file).
export BBPATH="${OMDIR}/build:${OMDIR}/local:${OMDIR}/oe:${OMDIR}/openembedded"
Using a local overlay
How you use the local overlay depends on which part of the tree you want to affect.
Changing files in conf/
To change a file in conf/, just copy the file to the overlay tree (preserving the directory structure) and edit it.
Changing files in classes/
To change a file in classes/, just copy the file to the overlay tree and edit it.
Changing packages
Changing a package's recipe is a bit more complex. You have to copy over (or symlink) not only the .bb file for the package, but also all the files it includes with require
, and the FILESDIR
directories (all directories referred to by FILESDIR
, usually named either package-version or files
). If you forget one of them, the build will give an error (either when parsing the recipe in the case of require
, or when trying to build in the case of the FILESDIR
directories).
Adding a new package
You can add a new package (or a recipe for a new version of a package) to the overlay tree simply by creating it on the overlay tree.