Embedded Linux Development Using Yocto Project - Third Edition

Book description

Elevate your Linux-powered system with Yocto Projects, enhancing its stability and resilience efficiently and economically — now upgraded to the latest Yocto Project version Purchase of the print or Kindle book includes a free PDF eBook

Key Features

  • Optimize your Yocto Project tools to develop efficient Linux-based projects
  • Follow a practical approach to learning Linux development using Yocto Project
  • Employ the best practices for embedded Linux and Yocto Project development

Book Description

The Yocto Project is the industry standard for developing dependable embedded Linux projects. It stands out from other frameworks by offering time-efficient development with enhanced reliability and robustness.

With Embedded Linux Development Using Yocto Project, you’ll acquire an understanding of Yocto Project tools, helping you perform different Linux-based tasks. You’ll gain a deep understanding of Poky and BitBake, explore practical use cases for building a Linux subsystem project, employ Yocto Project tools available for embedded Linux, and uncover the secrets of SDK, recipe tool, and others. This new edition is aligned with the latest long-term support release of the aforementioned technologies and introduces two new chapters, covering optimal emulation in QEMU for faster product development and best practices.

By the end of this book, you’ll be well-equipped to generate and run an image for real hardware boards. You’ll gain hands-on experience in building efficient Linux systems using the Yocto Project.

What you will learn

  • Understand the basic Poky workflows concepts along with configuring and preparing the Poky build environment
  • Learn with the help of up-to-date examples in the latest version of Yocto Project
  • Configure a build server and customize images using Toaster
  • Generate images and fit packages into created images using BitBake
  • Support the development process by setting up and using Package feeds
  • Debug Yocto Project by configuring Poky
  • Build an image for the BeagleBone Black, RaspberryPi 4, and Wandboard, and boot it from an SD card

Who this book is for

If you are an embedded Linux developer and want to broaden your knowledge about the Yocto Project with examples of embedded development, then this book is for you. Professionals looking for new insights into working methodologies for Linux development will also find plenty of helpful information in this book.

Table of contents

  1. Embedded Linux Development Using Yocto Project
  2. Contributors
  3. About the authors
  4. About the reviewers
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the color images
    5. Conventions used
    6. Get in touch
    7. Share Your Thoughts
    8. Download a free PDF copy of this book
  6. Chapter 1: Meeting the Yocto Project
    1. What is the Yocto Project?
    2. Delineating the Yocto Project
    3. The alliance of the OpenEmbedded project and the Yocto Project
    4. Understanding Poky
      1. BitBake
      2. OpenEmbedded Core
      3. Metadata
    5. The Yocto Project releases
    6. Summary
  7. Chapter 2: Baking Our First Poky-Based System
    1. Preparing the build host system
      1. Using Windows Subsystem for Linux (WSLv2)
      2. Preparing a Linux-based system
    2. Downloading the Poky source code
    3. Preparing the build environment
    4. Knowing the local.conf file
    5. Building a target image
    6. Running images in QEMU
    7. Summary
  8. Chapter 3: Using Toaster to Bake an Image
    1. What is Toaster?
    2. Installing Toaster
    3. Starting Toaster
    4. Building an image for QEMU
    5. Summary
  9. Chapter 4: Meeting the BitBake Tool
    1. Understanding the BitBake tool
    2. BitBake metadata collections
    3. Metadata types
    4. Summary
  10. Chapter 5: Grasping the BitBake Tool
    1. Parsing metadata
    2. Dependencies
    3. Preferring and providing recipes
    4. Fetching the source code
      1. Remote file downloads
      2. Git repositories
    5. Optimizing the source code download
      1. Disabling network access
    6. Understanding BitBake’s tasks
    7. Summary
  11. Chapter 6: Detailing the Temporary Build Directory
    1. Detailing the build directory
    2. Constructing the build directory
    3. Exploring the temporary build directory
    4. Understanding the work directory
    5. Understanding the sysroot directories
    6. Summary
  12. Chapter 7: Assimilating Packaging Support
    1. Using supported package formats
      1. List of supported package formats
      2. Choosing a package format
    2. Running code during package installation
    3. Understanding shared state cache
    4. Explaining package versioning
    5. Specifying runtime package dependencies
    6. Using packages to generate a rootfs image
    7. Package feeds
      1. Using package feeds
    8. Summary
  13. Chapter 8: Diving into BitBake Metadata
    1. Understanding BitBake’s metadata
      1. Working with metadata
    2. Summary
  14. Chapter 9: Developing with the Yocto Project
    1. What is a software development kit?
    2. Generating a native SDK for on-device development
    3. Understanding the types of cross-development SDKs
    4. Using the Standard SDK
    5. Using the Extensible SDK
      1. Building an image using devtool
      2. Running an image on QEMU
      3. Creating a recipe from an external Git repository
      4. Building a recipe using devtool
      5. Deploying to the target using devtool
      6. Extending the SDK
    6. Summary
  15. Chapter 10: Debugging with the Yocto Project
    1. Differentiating metadata and application debugging
    2. Tracking image, package, and SDK contents
    3. Debugging packaging
      1. Inspecting packages
    4. Logging information during task execution
    5. Debugging metadata variables
    6. Utilizing a development shell
    7. Using the GNU Debugger for debugging
    8. Summary
  16. Chapter 11: Exploring External Layers
    1. Powering flexibility with layers
    2. Detailing a layer’s source code
    3. Adding meta layers
    4. The Yocto Project layer ecosystem
    5. Summary
  17. Chapter 12: Creating Custom Layers
    1. Making a new layer
    2. Adding metadata to the layer
      1. Creating an image
      2. Adding a package recipe
      3. Adding support to a new machine definition
      4. Using a custom distribution
    3. MACHINE_FEATURES versus DISTRO_FEATURES
    4. Understanding the scope of a variable
    5. Summary
  18. Chapter 13: Customizing Existing Recipes
    1. Understanding common use cases
      1. Extending a task
    2. Adding extra options to recipes based on Autotools
    3. Applying a patch
    4. Adding extra files to the existing packages
      1. Understanding file searching paths
      2. Changing recipe feature configuration
    5. Configuration fragments for Kconfig-based projects
    6. Summary
  19. Chapter 14: Achieving GPL Compliance
    1. Understanding copyleft
      1. Understanding copyleft compliance versus proprietary code
    2. Managing software licensing with Poky
      1. Understanding commercial licenses
    3. Using Poky to achieve copyleft compliance
      1. Understanding license auditing
      2. Providing the source code
      3. Providing compilation scripts and source code modifications
      4. Providing license text
    4. Summary
  20. Chapter 15: Booting Our Custom Embedded Linux
    1. Discovering the right BSP layer
      1. Reviewing aspects that impact hardware use
      2. Taking a look at widely used BSP layers
    2. Using physical hardware
    3. BeagleBone Black
      1. Baking for BeagleBone Black
      2. Booting BeagleBone Black
    4. Raspberry Pi 4
      1. Baking for Raspberry Pi 4
      2. Booting Raspberry Pi 4
    5. VisionFive
      1. Baking for VisionFive
      2. Booting VisionFive
    6. Taking the next steps
    7. Summary
  21. Chapter 16: Speeding Up Product Development through Emulation – QEMU
    1. What is QEMU?
    2. What are the benefits of using QEMU over hardware?
    3. When is choosing real hardware preferable?
    4. Using runqemu capabilities
      1. Using runqemu to test graphical applications
      2. Using runqemu to validate memory constraints
      3. Using runqemu to help with image regression tests
    5. Summary
  22. Chapter 17: Best Practices
    1. Guidelines to follow for Yocto Project
      1. Managing layers
      2. Avoid creating too many layers
      3. Prepare the product metadata for new Yocto Project releases
      4. Create your custom distro
      5. Avoid reusing existing images for your product
      6. Standard SDK is commonly undervalued
      7. Avoid too many patches for Linux kernel and bootloader modifications
      8. Avoid using AUTOREV as SRCREV
      9. Create a Software Bill of Materials
    2. Guidelines to follow for general projects
      1. Continuously monitor the project license constraints
      2. Security can harm your project
      3. Don’t underestimate maintenance costs
      4. Tackle project risk points and constraints as soon as possible
    3. Summary
  23. Index
    1. Why subscribe?
  24. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Share Your Thoughts
    3. Download a free PDF copy of this book

Product information

  • Title: Embedded Linux Development Using Yocto Project - Third Edition
  • Author(s): Otavio Salvador, Daiane Angolini
  • Release date: April 2023
  • Publisher(s): Packt Publishing
  • ISBN: 9781804615065