Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
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

Arrow left icon
Profile Icon Pierre-Jean Profile Icon Mabäcker
Arrow right icon
€8.99 €23.99
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2 (4 Ratings)
eBook Jun 2016 214 pages 1st Edition
eBook
€8.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Pierre-Jean Profile Icon Mabäcker
Arrow right icon
€8.99 €23.99
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2 (4 Ratings)
eBook Jun 2016 214 pages 1st Edition
eBook
€8.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€8.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

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 .

Understanding the build system

"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.

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.

Yocto Project - workflow

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

Yocto Project - workflow

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).

Who is this book for?

If you are a student or a developer of embedded software, embedded Linux engineer or embedded systems in competence with Raspberry Pi and want to discover the Yocto Project, then this book is for you. Experience with Yocto is not needed.

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

Product Details

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

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

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

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 99.97
Yocto for Raspberry Pi
€29.99
Learning Embedded Linux using the Yocto Project
€36.99
Using Yocto Project with BeagleBone Black
€32.99
Total 99.97 Stars icon
Banner background image

Table of Contents

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

Customer reviews

Rating distribution
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
(4 Ratings)
5 star 25%
4 star 0%
3 star 0%
2 star 0%
1 star 75%
M. Salamon Feb 20, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Perfect book for beginners. Very recommended!
Amazon Verified review Amazon
Jonathan_Costa_Rica May 08, 2017
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
For the price is too basic... as an engineer is too poor for yocto, it is for beginners or for hobbies
Amazon Verified review Amazon
pj Nov 08, 2017
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
Most of the code samples are broken or unformatted, please see the attached pictures. The text is well written, but within the many code mistakes you cannot easily reproduce the examples.
Amazon Verified review Amazon
Adam A. Feb 14, 2023
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
I bought this book for 49$ dollars , and picked it based on the Index. The index promised a wide range of topics, which made the book worth the money. When the book arrived, I was shocked to find that it was very thin, so I thought maybe its condensed material. When I opened it, I found huge fonts used for headings, and lots of over-sized pictures and lots of unnecessary space, and paragraphs that were 2 or 3 lines. The content is extremely minimal and very rough and presented poorly and with 0 depth. This should not be called a book, or even a set of notes. Absolutely disappointing, and provides no value to the customer. Its a set of notes, and not a great one too, which leaves a lot of things out. This is borderline unethical, and the publisher is to blame, making a quick buck. I will never again buy a book from a publisher that tricks me into buying an almost empty book by using monster fonts and extra space and oversized pictures.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.