Systems & software · topic D12 · 30 hours
BSPs & Yocto / Buildroot
Getting Linux running on a new SoC board, trimming it to product form, and maintaining several models at once — that is the embedded team's daily bread. Job postings list «Yocto/Buildroot experience» as a clear plus, because this skill only grows inside real projects.
What to learn
- Cross-compilation: toolchains, the sysroot, and why you cannot build on the target board
- Buildroot: fast, small, easy to pick up — fits a single product; Yocto: the layer/recipe system and the sstate cache — fits long-term maintenance across product lines
- Kernel trimming, root filesystem customization, boot speed optimization (systemd timing analysis, on-demand driver loading)
- Packaging your own drivers and applications as recipes/packages and building them into the image
The lesson · plain words
A BSP (board support package) engineer's job: get a Linux/RTOS running on your particular board, running stably, with reproducible builds. Yocto and Buildroot are the two mainstream tools of this trade.
This page covers the core ideas of build systems: recipes, layers, and caching.
Recipes, layers, image: a three-tier worldview
Watch the figure: recipes (how each software package gets compiled) → packages (the compiled packages) → image (the assembly manifest of the final image). Yocto schedules tens of thousands of recipes with BitBake; Buildroot uses make + menuconfig — the idea is identical: write «how to build» declaratively and clearly.
The point of layers: the chip vendor's BSP layer at the bottom, a distribution layer in the middle, and your own application layer — stacked on each other without polluting each other. When the BSP is upgraded, not one of your changes is lost — that is the entire reason layers exist.
Interactive figure · drag it and see
The sstate cache: change one line without rebuilding everything
A full build takes hours on end. Yocto's sstate cache stores each task's output: change one recipe and only the affected 12 packages rebuild, while the other 130 come straight from cache (green in the figure). Once the team shares a cache server, incremental builds take minutes.
The matching discipline: the more declaratively recipes are written (SRC_URI, complete dependency declarations), the higher the cache hit rate. Hand-hacking a recipe = cache invalidation = the whole team waits on the build with you.
Yocto or Buildroot
Buildroot: simple and direct, fits a single product with static configuration, half a day to learn. Yocto: born for many products and many versions (layers/multiple machines/multiple image recipes), weeks to learn, but irreplaceable at scale. Robot companies almost always end up on Yocto.
The decision criterion: one product with stable configuration → Buildroot; multiple hardware variants + continuous iteration + a team larger than 3 → Yocto. Choose by product matrix, not by fashion.
BSP daily work and acceptance
Three daily tasks: enabling new peripherals with device tree + driver (D11), maintaining recipes, slimming the image. Acceptance metrics: four versioned tables — full-build time, incremental-build time, image size, boot time (D11's metrics).
How deep to go: write a simple recipe (inheriting the cmake class, declaring dependencies), add your own layer, read BitBake's dependency graph (bitbake -g). Get there and you are the scarce person on the team.
Three questions — do you really get it?
1. What problem does Yocto's layer design mainly solve?
- AFaster builds
- BConfiguration reuse and isolation across many products and versions, so a BSP upgrade loses nothing custom
- CEncrypting the image
Show answer
B. Layering decouples the chip layer, distribution layer, and application layer. A single product can skip it; multiple products cannot live without it.
2. What is the precondition for sstate cache hits?
- ADeclarative recipes with complete dependencies, so task inputs are reproducible
- BA powerful build machine
- CA fast network
Show answer
A. Cache entries are keyed on task-input hashes. Hand-written hacks in a recipe make hashes drift and hits fail.
3. Single product, stable configuration, small team — which do you pick?
- ABuildroot
- BYocto
- CHand-written shell scripts
Show answer
A. Buildroot is simple, direct, and sufficient. Yocto's complexity is pure burden in a single-product setting.
Keep going deeper
Links without a marker stay on this site; the rest point to the Chinese edition until its translation batch lands.
How it fails in the field
- Treating Yocto as «a more complicated Buildroot», never understanding layer boundaries or the sstate cache — full rebuilds start at several hours
- Shipping a root filesystem that still carries ssh/debug tools/a full compiler — size and attack surface both out of control
You have learned enough when
The Chinese edition carries the full topic page for BSPs & Yocto / Buildroot, including the complete outline, depth requirements per career track, and further derivations: robotguide.dev/k/D12/.