Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Yocto for Raspberry Pi

You're reading from   Yocto for Raspberry Pi Create unique and amazing projects by using the powerful combination of Yocto and Raspberry Pi

Arrow left icon
Product type Paperback
Published in Jun 2016
Publisher Packt
ISBN-13 9781785281952
Length 214 pages
Edition 1st Edition
Concepts
Arrow right icon
Authors (2):
Arrow left icon
TEXIER Pierre-Jean TEXIER Pierre-Jean
Author Profile Icon TEXIER Pierre-Jean
TEXIER Pierre-Jean
Petter Mabäcker Petter Mabäcker
Author Profile Icon Petter Mabäcker
Petter Mabäcker
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Meeting the Yocto Project FREE CHAPTER 2. Building our First Poky Image for the Raspberry Pi 3. Mastering Baking with Hob and Toaster 4. Understanding BitBake 5. Creating, Developing, and Deploying on the Raspberry Pi 6. Working with External Layers 7. Deploying a Custom Layer on the Raspberry Pi 8. Diving into the Raspberry Pi's Peripherals and Yocto Recipes 9. Making a Media Hub on the Raspberry Pi 10. Playing with an LCD Touchscreen and the Linux Kernel 11. Contributing to the Raspberry Pi BSP Layer 12. Home Automation Project - Booting a Custom Image

The core components

The core components (other available tools are optional) of the Yocto Project are:

  • BitBake
  • OpenEmbedded-Core
  • Poky
  • The BSP layer (meta-raspberry, meta-fsl-arm, meta-ti, meta-intel, meta-sunxi, and so on)

The following diagram shows all the layers that we will discover through this book. We will study all the tools through various examples, allowing better comprehension.

The core components

What is Poky?

Poky is the reference Yocto Project distribution. It contains some of basic components (called the build system) of OpenEmbedded and a set of metadata for creating embedded distributions for a number of targets. It is platform independent and performs cross-compiling using the BitBake tool (a task scheduler), OpenEmbedded-Core, and a default set of metadata, as shown in the following figure. It provides the mechanism to build and combine thousands of distributed open source projects.

The Poky build system is poised to become the reference in the industrial world as evinces by industry leaders such as Wind River, Intel, Montavista, and Mentor Graphics.

What is Poky?

Note

Angstrom ( http://www.angstrom-distribution.org/ ) is another distribution based on OpenEmbedded-Core. You might consider Angstrom and Poky to be close cousins, because Poky is also based on OpenEmbedded-Core.

The Chief - BitBake

BitBake, the build engine, is a task scheduler (like GNU Make) which parses several scripts (shell and Python, for example).

Once the environment is built, BitBake will execute the task that has been requested. If no task is provided, BitBake will run the default task, called build.

To run a task, BitBake will first look for an environment variable called do_ <task name>, which will contain the task code to execute (in Python or a shell). So, to compile a Yocto recipe, use the code contained in the do_compile variable.

In short, from the information contained in the recipes (or metadata), it downloads the sources of projects from the Internet, a local directory, or a version-control system (such as Git), and then builds in the order determined by the dependency graph generated dynamically. Finally, it installs binaries, generates the corresponding package, and builds the final image, which can be installed on the target (Raspberry Pi for us).

The following picture shows how BitBake works:

The Chief - BitBake

OpenEmbedded-Core

The OpenEmbedded-Core metadata collection (meta in the following diagram) provides the engine of the Poky build tool. It is designed to provide the core features (several recipes). It provides support for six different processor architectures (ARM, x86, x86-64, PowerPC, MIPS, and MIPS64), supporting only QEMU-emulated machines.

OpenEmbedded-Core

The organization of OpenEmbedded-Core is depicted here:

OpenEmbedded-Core

This layer includes different recipes, which describe how to fetch, configure, compile and package applications and images.

Note

For the rest of the book, we will mix this layer with the BSP layer of the Raspberry Pi, meta-raspberrypi.

Exploring metadata

Metadata, which is composed of a mix of Python and shell script text files (.conf, .bb, .bbclass, and .inc), provides a tremendously flexible system. Metadata refers to the build instructions themselves as well as the data used to control what things get built and to affect how they are built. The metadata also includes commands and data used to indicate which versions of software are used and where they are obtained from. Poky uses this to extend OpenEmbedded-Core and includes two different layers, which are another metadata subset. Here are their details:

  • * meta-yocto: This layer provides the default and supported distributions, visual branding, and metadata tracking information (maintainers, upstream status, and so on)
  • * meta-yocto-bsp: This layer, on top of it, provides the hardware reference board support (BSP) for use in Poky

We will discover metadata in depth through Chapter 4, Understanding the BitBake tool.

You have been reading a chapter from
Yocto for Raspberry Pi
Published in: Jun 2016
Publisher: Packt
ISBN-13: 9781785281952
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image