You are previewing Embedded Linux Development with Yocto Project.
O'Reilly logo
Embedded Linux Development with Yocto Project

Book Description

Develop fascinating Linux-based projects using the groundbreaking Yocto Project tools

In Detail

Starting with the very basics of the Yocto Project tools, this book will provide you with all the knowledge you need to work on real Linux-based hardware.

With emphasis on practical implementation, this book starts by helping you set up and configure the Yocto Project tools. It then explains the Hob interface for BitBake in detail. You will explore different directory layouts and learn to maximize the use of the Poky build system.

Compliance is always a hassle, so you will learn the methods to share source code and modifications, and how to fulfill open source license compliance effectively and convincingly. You will then gain experience in the use and construction of layers.

This tutorial guide will teach you everything you need to know to get up and running with Yocto Project and develop amazing Linux-based projects.

What You Will Learn

  • Differentiate between OpenEmbedded, Yocto Project, Poky, and BitBake
  • Understand the BitBake metadata syntax
  • Customize an application development environment
  • Debug your application in a cross-compiled environment
  • Add and remove features in the Linux kernel configuration
  • Meet your project's license compliance requirements with less hassle
  • Make embedded Linux systems using Yocto Project
  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at If you purchased this book elsewhere, you can visit and register to have the files e-mailed directly to you.

    Table of Contents

    1. Embedded Linux Development with Yocto Project
      1. Table of Contents
      2. Embedded Linux Development with Yocto Project
      3. Credits
      4. About the Authors
      5. About the Reviewers
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the color images of the book
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Meeting the Yocto Project
        1. What is the Yocto Project?
        2. Delineating the Yocto Project
        3. Understanding Poky
          1. Using BitBake
          2. OpenEmbedded-Core
          3. Metadata
        4. The alliance of OpenEmbedded Project and Yocto Project
        5. Summary
      9. 2. Baking Our Poky-based System
        1. Configuring a host system
          1. Installing Poky on Debian
          2. Installing Poky on Fedora
        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
      10. 3. Using Hob to Bake an Image
        1. Building an image using Hob
        2. Customizing an image with Hob
        3. Summary
      11. 4. Grasping the BitBake Tool
        1. Understanding the BitBake tool
        2. Exploring metadata
        3. Parsing metadata
        4. Dependencies
        5. Preferring and providing recipes
        6. Fetching the source code
          1. Remote file downloads
          2. Git repositories
          3. Other repositories
          4. Optimizing the source code download
          5. Disabling network access
        7. Understanding BitBake's tasks
          1. Extending tasks
        8. Generating a root filesystem image
        9. Summary
      12. 5. 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
      13. 6. Assimilating Packaging Support
        1. Using supported package formats
          1. List of supported package formats
          2. Choosing a package format
          3. Running code during package installation
        2. Understanding shared state cache
        3. Explaining package versioning
        4. Package feeds
          1. Using package feeds
        5. Summary
      14. 7. Diving into BitBake Metadata
        1. Using metadata
        2. Working with metadata
          1. The basic variable setting
          2. Variable expansion
          3. Setting a default value using ?=
          4. Setting a default value using ??=
          5. Immediate variable expansion
          6. Appending and prepending
          7. Conditional metadata set
          8. Conditional appending
          9. File inclusion
          10. Python variable expansion
          11. Defining executable metadata
          12. Defining Python functions in the global namespace
          13. The inheritance system
        3. Summary
      15. 8. Developing with the Yocto Project
        1. Deciphering the software development kit
        2. Working with the Poky SDK
          1. Using an image-based SDK
          2. Generic SDK – meta-toolchain
          3. Using a SDK
        3. Developing applications on the target
        4. Integrating with Eclipse
        5. Summary
      16. 9. Debugging with the Yocto Project
        1. Differentiating metadata and application debugging
        2. Tracking image, package, and SDK contents
        3. Debugging packaging
        4. Logging information during task execution
        5. Utilizing a development shell
        6. Using the GNU Project Debugger for debugging
        7. Summary
      17. 10. Exploring External Layers
        1. Powering flexibility with layers
        2. Detailing the layer's source code
        3. Adding meta layers
        4. Summary
      18. 11. Creating Custom Layers
        1. Making a new layer
        2. Adding metadata to the layer
        3. Creating an image
        4. Adding a package recipe
        5. Writing a machine definition
        6. Using a custom distribution
        7. Machine features versus distro features
        8. Understanding the variables scope
        9. Summary
      19. 12. Customizing Existing Recipes
        1. Common use cases
        2. Adding extra options to recipes based on Autoconf
        3. Applying a patch
        4. Adding extra files to the existing packages
          1. Understanding file searching paths
        5. Changing recipe feature configuration
        6. Customizing BusyBox
        7. Customizing the linux-yocto framework
        8. Summary
      20. 13. Achieving GPL Compliance
        1. Understanding copyleft
          1. Copyleft compliance versus proprietary code
          2. Some guidelines for license compliance
        2. Managing software licensing with Poky
          1. Commercial licenses
        3. Using Poky to achieve copyleft compliance
          1. License auditing
          2. Providing the source code
          3. Providing compilation scripts and source code modifications
          4. Providing license text
        4. Summary
      21. 14. Booting Our Custom Embedded Linux
        1. Exploring the Wandboard
        2. Discovering Freescale ARM BSP
        3. Using Wandboard with the Yocto Project
        4. Building an image for Wandboard
        5. Booting Wandboard from the SD card
        6. Summary
      22. A. References
      23. Index