Skip to content
Jed edited this page Aug 19, 2014 · 9 revisions

The following assumes that you already have a built tree in build-scripts/, with INHIBIT_RMWORK set. INHIBIT_RMWORK is set by default, and tells the build scripts to not delete the temporary packages build folders, so that we can go there, modify and rebuild source code.

The MACHINE variable

bitbake, the tool we use to build packages, uses the MACHINE environment variable to know what the current target (VM) is. A few possible values are xenclient-dom0 (to work on the main rootfs), xenclient-uivm (to work on the UI VM rootfs), xenclient-ndvm (to work on the network VM rootfs).
Make sure it is always set to something valid. Having "export MACHINE=xenclient-dom0" in your .bashrc is not a bad idea.

The main folders

Folder Description
build-scripts/build/oe/ The main work folder, where bb (bitbake wrapper) lives
build-scripts/build/oe/xenclient/recipes/ The OpenXT-specific recipes (xenclient-oe.git)
build-scripts/build/oe/tmp-eglibc/ The build folder, made not so "tmp" by INHIBIT_RMWORK
build-scripts/build/oe/tmp-eglibc/work/ Where the building of the packages happen, each subfolder is an OE "machine"
build-scripts/build/oe/tmp-eglibc/work/core2-oe-linux/ For non-machine-specific work, most of the non-kernel-related packages are built here

The package folders

Those are located in build-scripts/build/oe/tmp-eglibc/work/*/[Package name]_[Package version]/ and can contain the following folders:

Folder Description
[Package name]-[Package version]/ The source code location for most non-git-based packages
git/ The source code location for git-based packages
image/ The build target folder, used to create the final packages
temp/ The build logs
deploy_ipks/*/ Where the final packages are

Custom bibake rules

To run in build-scripts/build/oe using ./bb -c [rule] [Package name]

Rule Description
makeclean Run a cross-compile version of "make clean" inside the build folder
force_rebuild Brings the state of the package back (usually from "done building") to "needs compiling"

Example

Let's say trousers build failed because of a typo in the code, here's how to fix it:
$ cd build-scripts/build/oe
$ less tmp-eglibc/work/core2-oe-linux/trousers-0.3.2-1-r2/temp/log.do_compile # figure out what failed
$ emacs tmp-eglibc/work/core2-oe-linux/trousers-0.3.2-1-r2/trousers-0.3.2-1/src/tcs/tcs_caps.c # fix it
$ ./bb -c makeclean trousers
$ ./bb -c force_rebuild trousers
$ ./bb trousers
$ dpkg -c tmp-eglibc/work/core2-oe-linux/trousers-0.3.2-1-r2/deploy-ipks/core2/trousers_0.3.2-1-r2_core2.ipk # check the contents of the final package