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.
4.1. Understanding and Creating Layers¶
The OpenEmbedded build system supports organizing Metadata into multiple layers. Layers allow you to isolate different types of
customizations from each other. You might find it tempting to keep everything in one layer when working on a single project. However,
the more modular your Metadata, the easier it is to cope with future changes.
To illustrate how layers are used to keep things modular, consider machine customizations. These types of customizations typically reside
in a special layer, rather than a general layer, called a Board Support Package (BSP) Layer. Furthermore, the machine customizations
should be isolated from recipes and Metadata that support a new GUI environment, for example. This situation gives you a couple of
layers: one for the machine configurations, and one for the GUI environment. It is important to understand, however, that the BSP layer
can still make machine-specific additions to recipes within the GUI environment layer without polluting the GUI layer itself with those
machine-specific changes. You can accomplish this through a recipe that is a BitBake append (.bbappend) file, which is described
later in this section.
Note
For general information on BSP layer structure, see the Board Support Packages (BSP) - Developer's Guide.