Chapter 5. Common Tasks

Table of Contents

5.1. Understanding and Creating Layers
5.1.1. Layers
5.1.2. Creating Your Own Layer
5.1.3. Best Practices to Follow When Creating Layers
5.1.4. Enabling Your Layer
5.1.5. Using .bbappend Files
5.1.6. Prioritizing Your Layer
5.1.7. Managing Layers
5.1.8. Creating a General Layer Using the yocto-layer Script
5.2. Customizing Images
5.2.1. Customizing Images Using Custom .bb Files
5.2.2. Customizing Images Using Custom Package Groups
5.2.3. Customizing Images Using Custom IMAGE_FEATURES and EXTRA_IMAGE_FEATURES
5.2.4. Customizing Images Using local.conf
5.3. Writing a Recipe to Add a Package to Your Image
5.3.1. Single .c File Package (Hello World!)
5.3.2. Autotooled Package
5.3.3. Makefile-Based Package
5.3.4. Splitting an Application into Multiple Packages
5.3.5. Post-Installation Scripts
5.4. Adding a New Machine
5.4.1. Adding the Machine Configuration File
5.4.2. Adding a Kernel for the Machine
5.4.3. Adding a Formfactor Configuration File
5.5. Working With Libraries
5.5.1. Including Static Library Files
5.5.2. Combining Multiple Versions of Library Files into One Image
5.5.3. Installing Multiple Versions of the Same Library
5.6. Configuring the Kernel
5.6.1. Using  menuconfig
5.6.2. Creating Configuration Fragments
5.6.3. Fine-Tuning the Kernel Configuration File
5.7. Patching the Kernel
5.7.1. Create a Layer for your Changes
5.7.2. Finding the Kernel Source Code
5.7.3. Creating the Patch
5.7.4. Set Up Your Layer for the Build
5.7.5. Set Up for the Build
5.7.6. Build the Modified QEMU Kernel Image
5.7.7. Boot the Image and Verify Your Changes
5.8. Creating Your Own Distribution
5.9. Building a Tiny System
5.9.1. Overview
5.9.2. Goals and Guiding Principles
5.9.3. Understand What Gives Your Image Size
5.9.4. Trim the Root Filesystem
5.9.5. Trim the Kernel
5.9.6. Remove Package Management Requirements
5.9.7. Look for Other Ways to Minimize Size
5.9.8. Iterate on the Process
5.10. Working with Packages
5.10.1. Excluding Packages from an Image
5.10.2. Incrementing a Package Revision Number
5.10.3. Handling a Package Name Alias
5.10.4. Handling Optional Module Packaging
5.10.5. Using Runtime Package Management
5.10.6. Testing Packages With ptest
5.11. Building Software from an External Source
5.12. Selecting an Initialization Manager
5.12.1. Using systemd Exclusively
5.12.2. Using systemd for the Main Image and Using SysVinit for the Rescue Image
5.13. Excluding Recipes From the Build
5.14. Using an External SCM
5.15. Creating a Read-Only Root Filesystem
5.15.1. Creating the Root Filesystem
5.15.2. Post-Installation Scripts
5.15.3. Areas With Write Access
5.16. Performing Automated Runtime Testing
5.16.1. Enabling Tests
5.16.2. Running Tests
5.16.3. Writing New Tests
5.17. Debugging With the GNU Project Debugger (GDB) Remotely
5.17.1. Set Up the Cross-Development Debugging Environment
5.17.2. Launch Gdbserver on the Target
5.17.3. Launch GDB on the Host Computer
5.17.4. Connect to the Remote GDB Server
5.17.5. Use the Debugger
5.18. Examining Builds Using the Toaster API
5.19. Profiling with OProfile
5.19.1. Profiling on the Target
5.19.2. Using OProfileUI
5.20. Maintaining Open Source License Compliance During Your Product's Lifecycle
5.20.1. Providing the Source Code
5.20.2. Providing License Text
5.20.3. Providing Compilation Scripts and Source Code Modifications

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 the procedures documented here occur often in the develop cycle using the Yocto Project.