Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Yocto for Raspberry Pi
Yocto for Raspberry Pi

Yocto for Raspberry Pi: Create unique and amazing projects by using the powerful combination of Yocto and Raspberry Pi

By TEXIER Pierre-Jean , Petter Mabäcker
$15.99 per month
Book Jun 2016 214 pages 1st Edition
eBook
$29.99 $20.98
Print
$38.99
Subscription
$15.99 Monthly
eBook
$29.99 $20.98
Print
$38.99
Subscription
$15.99 Monthly

What do you get with a Packt Subscription?

Free for first 7 days. $15.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details


Publication date : Jun 29, 2016
Length 214 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781785281952
Vendor :
Raspberry Pi
Category :
Concepts :
Table of content icon View table of contents Preview book icon Preview Book

Yocto for Raspberry Pi

Chapter 1.  Meeting the Yocto Project

In this chapter, we will discover the Yocto Project and its main principles. All the concepts used throughout the book will be introduced here. We will discuss the history of the Yocto Project, the build system, Poky, OpenEmbedded-Core, BitBake, metadata, and the Yocto Project workflow.

The Yocto Project


The Yocto Project is an umbrella project covering a fairly wide gamut of embedded Linux technologies. It is not a Linux distribution, as explained on the Yocto Project website:

"The Yocto Project is an open source collaboration project that provides templates, tools and methods to help you create custom Linux-based systems for embedded products regardless of the hardware architecture."

Sponsored by the Linux Foundation, the Yocto Project is more than a build system. It provides tools, processes, templates and methods so that developers can rapidly create and deploy products for embedded devices(the Raspberry Pi, Beagleboard, Nitrogen6x, SAMA5D3, Olinuxino, and so on) or QEMU. The two main components that make up the Yocto Project are:

  • Poky: This is the build system (the reference distribution).

  • BitBake: This is the scheduler. It is a tool based on the Gentoo distribution.

Around November 2010, the Linux Foundation announced that this entire work would continue under the banner of the Yocto Project as a project sponsored by the Linux Foundation (with Richard Purdie, Fellow of the Linux Foundation, as Architect). It was then established that the Yocto Project and OpenEmbedded would coordinate on a core set of package metadata called OE-Core, combining the best of both Poky and OpenEmbedded with an increased use of layering for additional components.

Understanding the build system

As mentioned before, we are in the world of build systems with the Yocto Project. A build system enables you to:

  • Compile or cross-compile applications

  • Package applications

  • Test output binaries and ecosystem compatibility

  • Deploy generated images

To perform these steps, several tools exist. These are some of them:

For example, Buildroot is a set of makefiles for automated generation in embedded systems. It supports compiling the bootloader (U-Boot, for example), kernel (zImage or bzImage), and basic controls through BusyBox and third-party applications. Buildroot works on various architectures, such as ARM, x86, and MIPS. For further information, refer to the full documentation in English at https://buildroot.org/docs.html .

"Buildroot is a tool maintained in part by a French company that specializes in embedded Linux development called Free Electrons"

Buildroot is a much more simplistic approach than the one we will discover through this book on the Yocto Project. Buildroot is rather dedicated to firmware generation, while Yocto/OpenEmbedded is oriented towards distribution. Buildroot offers 700 recipes compared to the Yocto Project, which offers over 8000.

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.

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.

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:

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.

The organization of OpenEmbedded-Core is depicted here:

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.

Yocto Project - workflow


The following diagram represents the Yocto Project development environment at a high level in order to present the cross-compilation framework:

Let's look at what the components in the diagram stand for:

  • * User Configuration : This is metadata you can use to control the build process.

  • * Metadata layers : These are various layers that provide software, machine, and distribution metadata.

  • * Source files : These contain upstream releases, local projects, and source control management (Git, SVN, and so on).

  • * Build system : These are processes under the control of BitBake. This block expands on how BitBake fetches source files, applies patches, completes compilation, analyzes output for package generation, creates and tests packages, generates images, and generates cross-development tools.

  • * Package feeds : These are directories containing output packages (RPM, DEB, or IPK), which are subsequently used in the construction of an image or SDK produced by the build system. These feeds can also be copied and shared using a web server or other means to facilitate extending or updating existing images on devices at runtime if runtime package management is enabled.

  • * Images : These are images produced by the development process (the pieces that compose the operating system, such as the kernel image, bootloader, and rootfs).

  • * Application development SDK : These are cross-development tools that are produced along with an image or separately with BitBake.

Summary


This first chapter provided an overview on how the Yocto Project works, the core components that form it, such as Poky, OpenEmbedded-Core, and BitBake, and how they work within the Yocto Project.

In the next chapter, we will practice the workflow of the Yocto Project with different steps to download, configure, and prepare the Poky build environment in order to generate our first Poky image for the Raspberry Pi.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Set up and configure the Yocto Project efficiently with Raspberry Pi
  • Deploy multimedia applications from existing Yocto/OE layers
  • An easy-to-follow guide to utilize your custom recipes on your Raspberry Pi

Description

The Yocto Project is a Linux Foundation workgroup, which produces tools (SDK) and processes (configuration, compilation, installation) that will enable the creation of Linux distributions for embedded software, independent of the architecture of embedded software (Raspberry Pi, i.MX6, and so on). It is a powerful build system that allows you to master your personal or professional development. This book presents you with the configuration of the Yocto Framework for the Raspberry Pi, allowing you to create amazing and innovative projects using the Yocto/ OpenEmbedded eco-system. It starts with the basic introduction of Yocto's build system, and takes you through the setup and deployment steps for Yocto. It then helps you to develop an understanding of Bitbake (the task scheduler), and learn how to create a basic recipe through a GPIO application example. You can then explore the different types of Yocto recipe elements (LICENSE, FILES, SRC_URI, and so on). Next, you will learn how to customize existing recipes in Yocto/OE layers and add layers to your custom environment (qt5 for example).

What you will learn

[*] Explore the basic concept of Yocto s build system and how it is organized in order to use it efficiently with Raspberry Pi [*] Generate your first image with Yocto for the Raspberry Pi [*] Understand how to customize your Linux kernel within the Yocto Project [*] Customize your image in order to integrate your own applications [*] Write your own recipes for your graphical applications [*] Integrate a custom layer for the Raspberry Pi

What do you get with a Packt Subscription?

Free for first 7 days. $15.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details


Publication date : Jun 29, 2016
Length 214 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781785281952
Vendor :
Raspberry Pi
Category :
Concepts :

Table of Contents

18 Chapters
Yocto for Raspberry Pi Chevron down icon Chevron up icon
Credits Chevron down icon Chevron up icon
About the Authors Chevron down icon Chevron up icon
About the Reviewers Chevron down icon Chevron up icon
www.PacktPub.com Chevron down icon Chevron up icon
Preface Chevron down icon Chevron up icon
Meeting the Yocto Project Chevron down icon Chevron up icon
Building our First Poky Image for the Raspberry Pi Chevron down icon Chevron up icon
Mastering Baking with Hob and Toaster Chevron down icon Chevron up icon
Understanding BitBake Chevron down icon Chevron up icon
Creating, Developing, and Deploying on the Raspberry Pi Chevron down icon Chevron up icon
Working with External Layers Chevron down icon Chevron up icon
Deploying a Custom Layer on the Raspberry Pi Chevron down icon Chevron up icon
Diving into the Raspberry Pi's Peripherals and Yocto Recipes Chevron down icon Chevron up icon
Making a Media Hub on the Raspberry Pi Chevron down icon Chevron up icon
Playing with an LCD Touchscreen and the Linux Kernel Chevron down icon Chevron up icon
Contributing to the Raspberry Pi BSP Layer Chevron down icon Chevron up icon
Home Automation Project - Booting a Custom Image Chevron down icon Chevron up icon

Customer reviews

Filter icon Filter
Top Reviews
Rating distribution
Empty star icon Empty star icon Empty star icon Empty star icon Empty star icon 0
(0 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 0%
1 star 0%

Filter reviews by


No reviews found
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.