Question

I've been working with the Angstrom Linux distribution for the BeagleBoard. Can anyone point me to a tutorial or reference for how bitbake and OpenEmbedded actually work? For example, when I invoke bitbake like this:

bitbake virtual/kernel

what's actually happening? I've grep'ed the Angstrom recipes and searched the Angstrom filesystem, but I don't seem to be able to find references to either virtual or kernel. I feel a bit flummoxed working with this toolchain and making kernel patches without really understanding how bitbake works.

Was it helpful?

Solution

BitBake is a complex piece of software that unfortunately doesn't have the best user documentation. I believe that it's (loosely) based on the portage system in Gentoo, so some familiarity with that system might be a help.

The best way that I've found to figure out what is happening when you try to build something is to pass the -g option to bitbake, which will generate two files, depends.dot and task-depends.dot. The former is a graph of the dependencies of that package, showing what other packages get pulled in when you run a specific task. The latter shows more detail, showing tasks instead of packages. These tasks are a bit lower-level than the packages themselves; building a package might cause the system to fetch the sources, patch the sources, run a configure script, perform the compilation, install the binaries, and split the resulting files into subpackages.

These files can show why you're pulling in a piece of software you don't want, so that you can edit the offending package to remove its dependency. The graphs generated here can be visualized with the graphviz package, but if you run the -g option for a large task, such as an image task, the generated graph would be too large to visualize. It can still be useful to grep through the .dot files.

OTHER TIPS

For future reference to those who are wondering the same thing. If in your file system you go to overo/org.openembedded.dev/docs/usermanual and then run "make", then a lot of documentation about bitbake and openembedded will be made for you as html files. It explains a lot of what is going on.

OpenEmbedded User Manual that Anthony refers to is available on the OE site. Chapter 7 provides a good introduction to OE and how it uses BitBake:

http://docs.openembedded.org/usermanual/usermanual.html#chapter_using_bitbake_and_oe

The Configuration, Work Space, and Tasks subsections provide good background on what happens behind the scenes if you follow the OE Getting Started page:

http://www.openembedded.org/wiki/Getting_started

Even though BitBake does not have a detailed and user-friendly tutorial, the OpenEmbedded(older) and YOCTO(newer) projects which uses BitBake has several manuals or books where the BitBake and BitBake recipes are described in detail. BitBake is now co-maintained by Openembedded and YOCTO projects and when you use BitBake normally you will use these two projects to find the fundamental linux components like bootloader, busybox , etc suitable for your target.

References: http://docs.openembedded.org/usermanual/usermanual.html http://www.yoctoproject.org/docs/1.8/ref-manual/ref-manual.html#patching-dev-environment (Chapter 3 is more related to BitBake)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top