Home IoT & Hardware Embedded Linux Development using Yocto Projects - Second Edition

Embedded Linux Development using Yocto Projects - Second Edition

By Otavio Salvador , Daiane Angolini
books-svg-icon Book
eBook $29.99 $20.98
Print $38.99
Subscription $15.99 $10 p/m for three months
$10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
BUY NOW $10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
eBook $29.99 $20.98
Print $38.99
Subscription $15.99 $10 p/m for three months
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
  1. Free Chapter
    Meeting the Yocto Project
About this book
Yocto Project is turning out to be the best integration framework for creating reliable embedded Linux projects. It has the edge over other frameworks because of its features such as less development time and improved reliability and robustness. Embedded Linux Development using Yocto Project starts with an in-depth explanation of all Yocto Project tools, to help you perform different Linux-based tasks. The book then moves on to in-depth explanations of Poky and BitBake. It also includes some practical use cases for building a Linux subsystem project using Yocto Project tools available for embedded Linux. The book also covers topics such as SDK, recipetool, and others. By the end of the book, you will have learned how to generate and run an image for real hardware boards and will have gained hands-on experience at building efficient Linux systems using Yocto Project.
Publication date:
November 2017
Publisher
Packt
Pages
162
ISBN
9781788470469

 

Chapter 1. Meeting the Yocto Project

In this chapter we will be introduced to the Yocto Project. The main concepts of the project, which are constantly used throughout the book, are discussed here. We will discuss the Yocto Project history, OpenEmbedded, Poky, BitBake, and metadata in brief, so fasten your seat belt and welcome aboard!

 

What is the Yocto Project?


The Yocto Project is a Linux Foundation workgroup defined as:

"The Yocto Project provides open source, high-quality infrastructure and tools to help developers create their own custom Linux distributions for any hardware architecture, across multiple market segments. The Yocto Project is intended to provide a helpful starting point for developers."

The Yocto Project is an open source collaboration project that provides templates, tools, and methods to help us create custom Linux-based systems for embedded products regardless of the hardware architecture. Being managed by a Linux Foundation fellow, the project remains independent of its member organizations that participate in various ways and provide resources to the project.

It was founded in 2010 as a collaboration of many hardware manufacturers, open source operating systems, vendors, and electronics companies in an effort to reduce their work duplication, provide resources and information catering to both new and experienced users.

Among these resources is OpenEmbedded-Core, the core system component, provided by the OpenEmbedded project.

The Yocto Project is, therefore, a community open source project that aggregates several companies, communities, projects, and tools, gathering people with the same purpose to build Linux-based embedded products; all these components are in the same boat, being driven by its community needs to work together.

 

Delineating the Yocto Project


To ease our understanding of the duties and outcomes provided by the Yocto Project, we can use the analogy of a computing machine. The input is a set of data that describes what we want, that is, our specification. As an output, we have the desired Linux-based embedded product.

If the output is a product running a Linux-based operating system, the result generated is the pieces that compose the operating system, such as the Linux kernel, bootloader, and the root filesystem (rootfs) bundle which are properly organized.

To produce the resultant rootfs bundle and other deliverables, the Yocto Project's tools are present in all intermediary steps. The reuse of previously built utilities and other software components are maximized while building other applications, libraries, and any other software components in the right order and with the desired configuration, including the fetching of the required source code from their respective repositories, such as The Linux Kernel Archives (www.kernel.org), GitHub, and www.SourceForge.net.

The Yocto Project's tools prepare its own build environment, utilities, and toolchain, reducing the amount of host software dependency. A subtle but important implication is that the determinism is considerably increased as the utilities and their versions as well as their configuration options are the same, thus minimizing the number of host utilities to rely on and producing the same result independent of the host Linux distribution being used.

We can list some projects, such as Poky, BitBake, and OpenEmbedded-Core, under the Yocto Project umbrella, all of them being complementary and playing specific roles in the system. We will understand exactly how they work together in this chapter and throughout the book.

 

Understanding Poky


Poky is the Yocto Project reference system and is composed of a collection of tools and metadata. It is platform-independent and performs cross-compiling, using the BitBake tool, 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 to form a fully customizable, complete, and coherent Linux software stack.

Poky's main objective is to provide all the features an embedded developer needs.

 

Using BitBake


BitBake is a task scheduler that parses Python and shell script mixed code. The code parsed generates and runs tasks, which are basically a set of steps ordered per the code's dependencies.

It evaluates all available configuration files and recipe data (known as metadata), managing dynamic variable expansion, dependencies, and code generation. It keeps track of all tasks being processed in order to ensure completion, maximizing the use of processing resources to reduce build time and being predictable. The development of BitBake is centralized in the bitbake-devel@lists.openembedded.org mailing list, and its code can be found in the bitbake subdirectory of Poky.

 

OpenEmbedded-Core


The OpenEmbedded-Core metadata collection provides the engine of the Poky build tool. It is designed to provide the core features and to be as lean as possible. It provides support for seven different processor architectures (ARM, ARM64, x86, x86-64, PowerPC, MIPS, and MIPS64), supporting only boards to be emulated by QEMU.

The development is centralized in the openembedded-core@lists.openembedded.org mailing list and houses its metadata inside the meta subdirectory of Poky.

 

Metadata


The metadata which is composed of a mix of Python and Shell Script text files, provides a tremendously flexible system. Poky uses this to extend OpenEmbedded-Core and includes two different layers, which are another metadata subsets shown as follows:

  • meta-poky: This layer provides the default and supported distributions, visual branding, and metadata tracking information (maintainers, upstream status, and so on)
  • meta-yocto-bsp: Provides the Board Support Package (BSP) used as the reference for the Yocto Project development and Quality Assurance (QA) process

Chapter 8, Developing with Yocto Projects, explores the metadata in more detail and serves as a reference when we write our own recipes.

 

The alliance of the OpenEmbedded Project and the Yocto Project


The OpenEmbedded project was created around January 2003 when some core developers from the OpenZaurus project started to work with the new build system. The OpenEmbedded build system has been, since its beginning, a task scheduler inspired and based on the Gentoo Portage package system named BitBake. The project has grown its software collection and supported machine set at a fast pace.

As consequence of uncoordinated development, it was difficult to use OpenEmbedded in products that demand a more stable and polished code base, which is why Poky was born. Poky started as a subset of OpenEmbedded and had a more polished and stable code base across a limited set of architectures. Its reduced size allowed Poky to start to develop highlighting technologies, such as IDE plugins and QEMU integration, which are still being used today.

Around November 2010, the Yocto Project was announced by the Linux Foundation to continue this work under a Linux Foundation-sponsored project. The Yocto Project and OpenEmbedded Project consolidated their efforts on a core build system called OpenEmbedded-Core, using the best of both Poky and OpenEmbedded, thus emphasizing an increased use of additional components, metadata, and subsets.

 

Summary


This first chapter provided an overview of how the OpenEmbedded Project is related to the Yocto Project, the components which form Poky, and how it was created. In the next chapter, we will be introduced to the Poky workflow with steps to download, configure, and prepare the Poky build environment, and how to have the very first image built and running using QEMU.

 

 

About the Authors
  • Otavio Salvador

    Otavio Salvador loves technology and started his free software activities in 1999. In 2002, he founded O.S. Systems, a company focused on embedded system development services and consultancy worldwide, creating and maintaining customized BSPs, and helping companies with their product developments challenges. This resulted in his joining the OpenEmbedded community in 2008, when he became an active contributor to the OpenEmbedded project.

    Browse publications by this author
  • Daiane Angolini

    Daiane Angolini has been working with embedded Linux since 2008. She has been working as an application engineer at NXP, acting on internal development, porting custom applications from Android, and on-site customer support for i.MX architectures in areas such as the Linux kernel, u-boot, Android, Yocto Project, and user-space applications. However, it was on the Yocto Project that she found her place.

    Browse publications by this author
Latest Reviews (9 reviews total)
The hands-on experience I was looking for!
Todo o conteúdo que eu procurava de forma bem resumida e explicada sem perder os detalhes importantes. Recomendo.
Great book about embedded Linux – probably one of the best books on the market about this subject!
Embedded Linux Development using Yocto Projects - Second Edition
Unlock this book and the full library FREE for 7 days
Start now