Yocto Project: Quick Deployment Guide

Target: Embedded Linux ARM/x86 | Focus: Rapid Environment Setup

This cheat sheet provides a minimal workflow for setting up a Poky-based distribution. Optimized for Ubuntu 22.04+ hosts.

1. Host Dependencies

Before starting, ensure your build host has the necessary packages:

sudo apt install gawk wget git diffstat unzip texinfo gcc build-essential \
chrpath socat cpio python3 python3-pip python3-pexpect xz-utils \
debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa \
libsdl1.2-dev pylint xterm python3-subunit mesa-common-dev zstd liblz4-tool

2. Initialize Workspace

Always use a dedicated partition with at least 100GB of free space.
# Clone the Poky repository (Scarthgap is the current LTS)
git clone -b scarthgap git://git.yoctoproject.org/poky yocto-distro
cd yocto-distro

# Initialize build environment
source oe-init-build-env build/

3. Configuration (local.conf)

Edit conf/local.conf to set your target machine and optimize build speed:

# Common Machine Targets: qemux86-64, raspberrypi4, beaglebone-yocto
MACHINE ??= "qemux86-64"

# Speed up builds by using all CPU cores
BB_NUMBER_THREADS = "${@oe.utils.cpu_count()}"
PARALLEL_MAKE = "-j ${@oe.utils.cpu_count()}"

# Save disk space (removes work files after successful build)
INHERIT += "rm_work"

4. Building the Image

# Build a minimal console-only image
bitbake core-image-minimal

# To run in QEMU emulator after build:
runqemu qemux86-64 nographic
Pro Tip: Use devtool to modify existing recipes on the fly:
devtool modify <recipe-name>