Chapter 4. Common Tasks

Table of Contents

4.1. Understanding and Creating Layers
4.1.1. Layers
4.1.2. Creating Your Own Layer
4.1.3. Following Best Practices When Creating Layers
4.1.4. Making Sure Your Layer is Compatible With Yocto Project
4.1.5. Enabling Your Layer
4.1.6. Using .bbappend Files in Your Layer
4.1.7. Prioritizing Your Layer
4.1.8. Managing Layers
4.1.9. Creating a General Layer Using the bitbake-layers Script
4.2. Customizing Images
4.2.1. Customizing Images Using local.conf
4.2.2. Customizing Images Using Custom IMAGE_FEATURES and EXTRA_IMAGE_FEATURES
4.2.3. Customizing Images Using Custom .bb Files
4.2.4. Customizing Images Using Custom Package Groups
4.2.5. Customizing an Image Hostname
4.3. Writing a New Recipe
4.3.1. Overview
4.3.2. Locate or Automatically Create a Base Recipe
4.3.3. Storing and Naming the Recipe
4.3.4. Running a Build on the Recipe
4.3.5. Fetching Code
4.3.6. Unpacking Code
4.3.7. Patching Code
4.3.8. Licensing
4.3.9. Dependencies
4.3.10. Configuring the Recipe
4.3.11. Using Headers to Interface with Devices
4.3.12. Compilation
4.3.13. Installing
4.3.14. Enabling System Services
4.3.15. Packaging
4.3.16. Sharing Files Between Recipes
4.3.17. Properly Versioning Pre-Release Recipes
4.3.18. Post-Installation Scripts
4.3.19. Testing
4.3.20. Examples
4.3.21. Following Recipe Style Guidelines
4.4. Adding a New Machine
4.4.1. Adding the Machine Configuration File
4.4.2. Adding a Kernel for the Machine
4.4.3. Adding a Formfactor Configuration File
4.5. Finding Temporary Source Code
4.6. Using Quilt in Your Workflow
4.7. Using a Development Shell
4.8. Using a Development Python Shell
4.9. Building Targets with Multiple Configurations
4.10. Working With Libraries
4.10.1. Including Static Library Files
4.10.2. Combining Multiple Versions of Library Files into One Image
4.10.3. Installing Multiple Versions of the Same Library
4.11. Enabling GObject Introspection Support
4.11.1. Enabling the Generation of Introspection Data
4.11.2. Disabling the Generation of Introspection Data
4.11.3. Testing that Introspection Works in an Image
4.11.4. Known Issues
4.12. Optionally Using an External Toolchain
4.13. Creating Partitioned Images Using Wic
4.13.1. Background
4.13.2. Requirements
4.13.3. Getting Help
4.13.4. Operational Modes
4.13.5. Using an Existing Kickstart File
4.13.6. Examples
4.14. Building an Initial RAM Filesystem (initramfs) Image
4.15. Flashing Images Using bmaptool
4.16. Making Images More Secure
4.16.1. General Considerations
4.16.2. Security Flags
4.16.3. Considerations Specific to the OpenEmbedded Build System
4.16.4. Tools for Hardening Your Image
4.17. Creating Your Own Distribution
4.18. Creating a Custom Template Configuration Directory
4.19. Building a Tiny System
4.19.1. Overview
4.19.2. Goals and Guiding Principles
4.19.3. Understand What Contributes to Your Image Size
4.19.4. Trim the Root Filesystem
4.19.5. Trim the Kernel
4.19.6. Remove Package Management Requirements
4.19.7. Look for Other Ways to Minimize Size
4.19.8. Iterate on the Process
4.20. Building Images for More than One Machine
4.21. Working with Packages
4.21.1. Excluding Packages from an Image
4.21.2. Incrementing a Package Version
4.21.3. Handling Optional Module Packaging
4.21.4. Using Runtime Package Management
4.21.5. Generating and Using Signed Packages
4.21.6. Testing Packages With ptest
4.22. Working with Source Files
4.22.1. Setting up Effective Mirrors
4.22.2. Getting Source Files and Suppressing the Build
4.23. Building Software from an External Source
4.24. Selecting an Initialization Manager
4.24.1. Using systemd Exclusively
4.24.2. Using systemd for the Main Image and Using SysVinit for the Rescue Image
4.25. Selecting a Device Manager
4.25.1. Using Persistent and Pre-Populated/dev
4.25.2. Using devtmpfs and a Device Manager
4.26. Using an External SCM
4.27. Creating a Read-Only Root Filesystem
4.27.1. Creating the Root Filesystem
4.27.2. Post-Installation Scripts
4.27.3. Areas With Write Access
4.28. Performing Automated Runtime Testing
4.28.1. Enabling Tests
4.28.2. Running Tests
4.28.3. Exporting Tests
4.28.4. Writing New Tests
4.28.5. Installing Packages in the DUT Without the Package Manager
4.29. Debugging With the GNU Project Debugger (GDB) Remotely
4.30. Debugging with the GNU Project Debugger (GDB) on the Target
4.31. Debugging Parallel Make Races
4.31.1. The Failure
4.31.2. Reproducing the Error
4.31.3. Creating a Patch for the Fix
4.31.4. Testing the Build
4.32. Maintaining Open Source License Compliance During Your Product's Lifecycle
4.32.1. Providing the Source Code
4.32.2. Providing License Text
4.32.3. Providing Compilation Scripts and Source Code Modifications
4.33. Using the Error Reporting Tool
4.33.1. Enabling and Using the Tool
4.33.2. Disabling the Tool
4.33.3. Setting Up Your Own Error Reporting Server

This chapter describes fundamental procedures such as creating layers, adding new software packages, extending or customizing images, porting work to new hardware (adding a new machine), and so forth. You will find that the procedures documented here occur often in the development cycle using the Yocto Project.