Opinions, rants, and straight facts to help you get the most out of open source.

Category Archives: build

What can bitbake do?

I’ve been asked many times why bitbake is useful, what it’s good for, and why anyone should bother to learn how to use it. From the down-in-the-weeds perspective I see bitbake fitting into a continuum of tools that developers already use. Compilers (like gcc) are used at the file-level to turn source code into binaries. At the next level there are make and configure which tie together many source files into a portable source package. And I see bitbake at the next level up, fetching packages from the internet or a SCM, applying patches, setting configure, make, and gcc variables, and selecting which binaries are pulled from the package, as well as defining how the binaries are packaged for delivery. Bitbake provides control down into software packages, and is extensible to allow additional steps like static analysis or testing.

While bitbake is capable of managing downward into the details of a particular software package, it is also aware of other packages – make and gcc don’t manage inter-package dependencies. Package dependencies are nothing new, and tools like RPM try to handle this also. Bitbake does allow you to differentiate between build dependencies and run-time dependencies though, so your system image won’t be polluted with extra packages that are simply needed on the host to build the software.

Finally, bitbake is capable of grouping related packages together into tasks. Tasks are not packages per-se, even though they are defined as bitbake recipes. An example would be a “printer” task that depends on cups, foomatic-filters-ppds, and ghostscript-gpl. By grouping these packages together into a task, you can now set build options for that particular task all the way down into the gcc and configure level. This task can also be re-used across multiple projects if your product line needs it.

In summary, bitbake helps you build your custom Linux distribution: it is compatible with thousands of recipes from various OpenEmbedded-based distributions, it provides low-level granular control over the build and install of each package, and provides higher level package groupings so you can leverage larger functional units. Done properly, a build can simply be bitbake my-product-image.

What can bitbake do?

I’ve been asked many times why bitbake is useful, what it’s good for, and why anyone should bother to learn how to use it. From the down-in-the-weeds perspective I see bitbake fitting into a continuum of tools that developers already use. Compilers (like gcc) are used at the file-level to turn source code into binaries. At the next level there are make and configure which tie together many source files into a portable source package. And I see bitbake at the next level up, fetching packages from the internet or a SCM, applying patches, setting configure, make, and gcc variables, and selecting which binaries are pulled from the package, as well as defining how the binaries are packaged for delivery. Bitbake provides control down into software packages, and is extensible to allow additional steps like static analysis or testing.

While bitbake is capable of managing downward into the details of a particular software package, it is also aware of other packages – make and gcc don’t manage inter-package dependencies. Package dependencies are nothing new, and tools like RPM try to handle this also. Bitbake does allow you to differentiate between build dependencies and run-time dependencies though, so your system image won’t be polluted with extra packages that are simply needed on the host to build the software.

Finally, bitbake is capable of grouping related packages together into tasks. Tasks are not packages per-se, even though they are defined as bitbake recipes. An example would be a “printer” task that depends on cups, foomatic-filters-ppds, and ghostscript-gpl. By grouping these packages together into a task, you can now set build options for that particular task all the way down into the gcc and configure level. This task can also be re-used across multiple projects if your product line needs it.

In summary, bitbake helps you build your custom Linux distribution: it is compatible with thousands of recipes from various OpenEmbedded-based distributions, it provides low-level granular control over the build and install of each package, and provides higher level package groupings so you can leverage larger functional units. Done properly, a build can simply be bitbake my-product-image.

© 2011 MontaVista Software, LLC. All Rights Reserved