This cheat sheet provides a minimal workflow for setting up a Poky-based distribution. Optimized for Ubuntu 22.04+ hosts.
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
# 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/
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"
# Build a minimal console-only image
bitbake core-image-minimal
# To run in QEMU emulator after build:
runqemu qemux86-64 nographic
devtool to modify existing recipes on the fly: devtool modify <recipe-name>