For example, the CentOS 6. This section provides required packages according to Linux distribution and function. Git, Python, and tar. It is recommended that you install the buildtools in order to provide versions that will work with the OpenEmbedded build system.

Author:Neshakar Grozshura
Language:English (Spanish)
Published (Last):5 November 2006
PDF File Size:17.44 Mb
ePub File Size:19.36 Mb
Price:Free* [*Free Regsitration Required]

This manual provides information on the BitBake tool. The information attempts to be as independent as possible regarding systems that use BitBake, such as the Yocto Project and OpenEmbedded. In some cases, scenarios or examples that within the context of a build system are used in the manual to help with understanding.

For these cases, the manual clearly states the context. Introduction Fundamentally, BitBake is a generic task execution engine that allows shell and Python tasks to be run efficiently and in parallel while working within complex inter-task dependency constraints.

Conceptually, BitBake is similar to GNU Make in some regards but has significant differences: BitBake executes tasks according to provided metadata that builds up the tasks. Metadata is stored in recipe. BitBake includes a fetcher library for obtaining source code from various places such as source control systems or websites.

The instructions for each unit to be built e. It was inspired by the Portage package management system used by the Gentoo Linux distribution. On December 7, , OpenEmbedded project team member, Chris Larson split the project into two distinct pieces: BitBake, a generic task executor OpenEmbedded, a metadata set utilized by BitBake Today, BitBake is the primary basis of the OpenEmbedded project, which is being used to build and maintain Linux distributions such as the Angstrom Distribution and which is used as the build tool for Linux projects such as the Yocto Project.

Prior to BitBake, no other build tool adequately met the needs of an aspiring embedded Linux distribution. All of the build systems used by traditional desktop Linux distributions lacked important functionality, and none of the ad-hoc Buildroot-based systems, prevalent in the embedded space, were scalable or maintainable.

Some important original goals for BitBake were: Handle cross-compilation. Handle inter-package dependencies build time on target architecture, build time on native architecture, and runtime. Support running any number of tasks within a given package, including, but not limited to, fetching upstream sources, unpacking them, patching them, configuring them, and so forth.

Be Linux distribution agnostic for both build and target systems. Be architecture agnostic. Support multiple build and target operating systems e. Cygwin, the BSDs, and so forth. Handle conditional metadata on the target architecture, operating system, distribution, and machine. Be easy to use the tools to supply local metadata and packages against which to operate. Be easy to use BitBake to collaborate between multiple projects for their builds. Provide an inheritance mechanism that share common metadata between many packages.

Over time it became apparent that some further requirements were necessary: Handle variants of a base recipe e. Split metadata into layers and allow layers to override each other. Allow representation of a given set of input variables to a task as a checksum. Based on that checksum, allow acceleration of builds with prebuilt components. BitBake satisfies all the original requirements and many more with extensions being made to the basic functionality to reflect the additional requirements.

Flexibility and power have always been the priorities. BitBake is highly extensible and supports embedded Python code and execution of any arbitrary tasks. Concepts BitBake is a program written in the Python language.

At the highest level, BitBake interprets metadata, decides what tasks are required to run, and executes those tasks. GNU Make achieves its control through "makefiles". BitBake uses "recipes". BitBake extends the capabilities of a simple tool like GNU Make by allowing for much more complex tasks to be completed, such as assembling entire embedded Linux distributions.

The remainder of this section introduces several concepts that should be understood in order to better leverage the power of BitBake. Recipes BitBake Recipes, which are denoted by the file extension.

These recipe files provide BitBake with the following: Descriptive information about the package The version of the recipe Existing Dependencies Where the source code resides Whether the source code requires any patches How to compile the source code Where on the target machine to install the package being compiled Within the context of BitBake, or any project utilizing BitBake as its build system, files with the. Note The term "package" is also commonly used to describe recipes.

However, since the same word is used to describe packaged output from a project, it is best to maintain a single descriptive term, "recipes". Configuration Files Configuration files, which are denoted by the. These files fall into several areas that define machine configuration options, distribution configuration options, compiler tuning options, general common configuration options, and user configuration options.

The main configuration file is the sample bitbake. Classes Class files, which are denoted by the. The BitBake source tree currently comes with one class metadata file called base. You can find this file in the classes directory. The base. This class contains definitions for standard basic tasks such as fetching, unpacking, configuring empty by default , compiling runs any Makefile present , installing empty by default and packaging empty by default.

These tasks are often overridden or extended by other classes added during the project development process. Layers Layers allow you to isolate different types of customizations from each other. While you might find it tempting to keep everything in one layer when working on a single project, the more modular you organize your metadata, the easier it is to cope with future changes.

To illustrate how you can use layers to keep things modular, consider customizations you might make to support a specific target machine. These types of customizations typically reside in a special layer, rather than a general layer, called a Board Specific Package BSP Layer. Furthermore, the machine customizations should be isolated from recipes and metadata that support a new GUI environment, for example.

This situation gives you a couple of layers: one for the machine configurations and one for the GUI environment. It is important to understand, however, that the BSP layer can still make machine-specific additions to recipes within the GUI environment layer without polluting the GUI layer itself with those machine-specific changes. You can accomplish this through a recipe that is a BitBake append.

Append Files Append files, which are files that have the. BitBake expects every append file to have a corresponding recipe file. Furthermore, the append file and corresponding recipe file must use the same root filename.

The filenames can differ only in the file type suffix used e. Information in append files overrides the information in the similarly-named recipe file.

Cloning the repository makes it easy to get bug fixes and have access to stable branches and the master branch. Once you have cloned BitBake, you should use the latest stable branch for development since the master branch is for BitBake development and might contain less stable changes.

You usually need a version of BitBake that matches the metadata you are using. The metadata is generally backwards compatible but not forward compatible. Alternatively, you can designate a directory after the git clone command if you want to call the new directory something other than bitbake. Taking a snapshot of BitBake: Downloading a snapshot of BitBake from the source code repository gives you access to a known branch or release of BitBake. Note Cloning the Git repository, as described earlier, is the preferred method for getting BitBake.

Cloning the repository makes it easier to update as patches are added to the stable branches. The following example downloads a snapshot of BitBake version 1. This section presents the BitBake command syntax and provides several execution examples. While the target that failed and anything depending on it cannot be built, as much as possible will be built before stopping. The exact options available depend on the metadata.

You can specify this more than once. Examples This section presents some examples showing how to use BitBake. Executing a Task Against a Single Recipe Executing tasks for a single recipe file is relatively simple.

You specify the file in question, and BitBake parses it and executes the specified task. BitBake obeys inter-task dependencies when doing so. Other than for debugging purposes, it is instead recommended that you use the syntax presented in the next section.

Executing Tasks Against a Set of Recipe Files There are a number of additional complexities introduced when one wants to manage multiple. Clearly there needs to be a way to tell BitBake what files are available, and of those, which you want to execute. There also needs to be a way for each recipe to express its dependencies, both for build-time and runtime.

There must be a way for you to express recipe preferences when multiple recipes provide the same functionality, or when there are multiple versions of a recipe. You cannot provide anything else. Generating Dependency Graphs BitBake is able to generate dependency graphs using the dot syntax.

You can convert these graphs into images using the dot tool from Graphviz. When you generate a dependency graph, BitBake writes four files to the current working directory: package-depends. To stop depending on common depends, use the "-I" depend option and BitBake omits them from the graph. Leaving this information out can produce more readable graphs. Here are two examples that create dependency graphs.


Yocto Project Reference Manual

These tasks include preparing your host development system for kernel development, preparing a layer, modifying an existing recipe, patching the kernel, configuring the kernel, iterative development, working with your own sources, and incorporating out-of-tree modules. Note The examples presented in this chapter work with the Yocto Project 2. Part of preparing the system is creating a local Git repository of the Source Directory poky on your system. Note Be sure you check out the appropriate development branch or you create your local branch by checking out a specific tag to get the desired version of Yocto Project.


A practical guide to BitBake

For now, these files can be taken from the BitBake installation directory. Simply copy them into the tutorial project. Recipes will be added later. When executed, BitBake will search all given layer directories for additional configurations. Currently we append nothing, but we will change this later. The ".

Related Articles