- The Yocto Project is an open-source framework used to create custom Linux distributions for embedded systems.
- It provides a collection of tools, templates, metadata, and processes for building Embedded Linux systems.
- Yocto allows developers to create a Linux operating system tailored specifically to their hardware and application requirements instead of using a general-purpose distribution such as Ubuntu.
- Yocto is not a Linux distribution itself; it is a build system and ecosystem for generating Linux distributions.
- Create minimal and lightweight Linux images.
- Include only the components required by the target device.
- Reduce storage, memory, and boot time requirements.
Yocto provides control over:
- Bootloader
- Linux Kernel
- Device Tree
- Libraries
- Applications
- Root Filesystem
- Software Packages
Supports multiple processor architectures:
- ARM
- ARM64 (AArch64)
- x86
- x86_64
- RISC-V
- MIPS
- PowerPC
Widely used in:
- Automotive Systems
- Telecommunications Equipment
- Industrial Automation
- Medical Devices
- Consumer Electronics
- IoT Gateways
- Networking Products
BitBake is the build engine of the Yocto Project.
Responsibilities:
- Parses recipes and metadata
- Resolves dependencies
- Executes build tasks
- Creates packages
- Generates root filesystems and images
Think of BitBake as:
make + package manager + dependency resolver + build orchestrator
Example:
bitbake core-image-minimalRecipes describe how a software package should be built.
A recipe contains:
- Source location
- Dependencies
- Configure instructions
- Compilation instructions
- Installation instructions
Example:
busybox.bb
Typical recipe contents:
SRC_URI
LICENSE
DEPENDS
do_configure()
do_compile()
do_install()Layers are logical collections of:
- Recipes
- Configuration files
- Metadata
Layers improve:
- Modularity
- Reusability
- Maintainability
Common layers:
meta
meta-poky
meta-openembedded
meta-raspberrypi
meta-custom
A BSP layer provides hardware-specific support.
Contains:
- Kernel configuration
- Device Trees
- Bootloader settings
- Drivers
- Firmware
Example:
meta-raspberrypi
Supported boards may include:
- Raspberry Pi
- BeagleBone
- NXP i.MX
- STM32MP1
- Xilinx Zynq
Poky is the reference distribution of the Yocto Project.
It includes:
- BitBake
- OpenEmbedded-Core Metadata
- Build Tools
- Documentation
- Example Configurations
Poky serves as the starting point for most Yocto-based projects.
Images are the final output generated by Yocto.
Examples:
core-image-minimal
core-image-base
core-image-full-cmdline
Generated formats:
.wic
.img
.ext4
.tar.gz
Yocto can generate an SDK containing:
- Cross Compiler
- Libraries
- Header Files
- Debugging Tools
Used for application development outside the Yocto build environment.
Install required packages on the build machine.
Examples:
g++
make
chrpath
cpio
diffstat
zstd
lz4
git
python3
git clone git://git.yoctoproject.org/pokyPoky contains:
bitbake
meta
meta-poky
meta-yocto-bsp
scripts
source oe-init-build-envCreates:
build/
├── conf/
│ ├── local.conf
│ └── bblayers.conf
Configure the target machine.
Example:
MACHINE = "raspberrypi4-64"This determines:
- Kernel
- Device Tree
- Bootloader
- BSP Components
Edit:
conf/bblayers.conf
Example:
BBLAYERS += "meta-raspberrypi"Edit:
conf/local.conf
Common settings:
MACHINE
DL_DIR
SSTATE_DIR
IMAGE_INSTALL
EXTRA_IMAGE_FEATURESbitbake core-image-minimalBitBake performs:
Fetch Sources
↓
Unpack Sources
↓
Apply Patches
↓
Configure
↓
Compile
↓
Install
↓
Package
↓
Generate RootFS
↓
Create Image
Generated files are stored in:
tmp/deploy/images/<machine>/
Examples:
core-image-minimal.wic
core-image-minimal.ext4
Image
zImage
uImage
Example:
sudo dd if=image.wic of=/dev/sdX bs=4M status=progressAlternative tools:
- Raspberry Pi Imager
- Balena Etcher
Typical Embedded Linux boot sequence:
ROM Code
↓
Bootloader (U-Boot)
↓
Linux Kernel
↓
Device Tree
↓
Root Filesystem
↓
Init/Systemd
↓
Applications
poky/
├── bitbake/
├── meta/
├── meta-poky/
├── meta-yocto-bsp/
├── build/
│ ├── conf/
│ └── tmp/
Important directories:
| Directory | Purpose |
|---|---|
| build/ | Build output and configuration |
| conf/ | Build configuration files |
| meta*/ | Metadata layers |
| tmp/ | Build artifacts |
| downloads/ | Downloaded source code |
| sstate-cache/ | Shared state cache |
| deploy/ | Final images and packages |
bitbake-layers create-layer meta-customAdd the layer:
bitbake-layers add-layer meta-customCreate:
recipes-apps/myapp/myapp.bb
BitBake will:
Fetch
Compile
Install
Package
Use:
.bbappend
Example:
busybox_%.bbappend
Avoid modifying upstream recipes directly.
Configure:
meta-custom/conf/distro/
Customize:
DISTRO_FEATURES
INIT_MANAGER
PREFERRED_VERSION
PACKAGE_CLASSES- Highly customizable
- Reproducible builds
- Supports multiple architectures
- Excellent package management
- Scalable for large products
- Strong community support
- Long-Term Support (LTS) releases available
- Steep learning curve
- Long build times
- Complex dependency management
- Debugging build failures can be difficult
- Requires strong Linux fundamentals
- Embedded Linux Devices
- Automotive Infotainment Systems
- Industrial Controllers
- Medical Equipment
- Smart Home Devices
- Routers and Networking Equipment
- IoT Gateways
- Robotics Platforms
Embedded Linux Fundamentals
↓
Yocto Fundamentals
↓
Poky Architecture
↓
BitBake
↓
Layers
↓
Recipes
↓
Configuration Files
↓
Image Creation
↓
BSP Development
↓
Kernel & Device Tree Customization
↓
Custom Layers
↓
Application Integration
↓
Custom Linux Distribution
This progression mirrors the workflow followed by Embedded Linux BSP, Linux Kernel, and Device Driver engineers when developing production-grade embedded systems.