Roadmaps / Embedded Linux / Phase 1
Phase 1 of 4 · Study weeks 1-4
Reproducible builds and your own layer
This phase gives you an image you can rebuild exactly, so every later change has a baseline. Read the Yocto Project overview and the BitBake user manual sections on tasks and the shared state cache (sstate) as you go.
Topics every week
- Week 18 h
- Yocto concepts: layers, recipes, images, machines, the BitBake task graph, the sstate cache
- the first build with
kas
Hand inA build of a minimal
qemuarm64image booting in QEMU, with a record of build time, disk use and the sstate hit rate on a second build - Week 28 h
- Your own layer: an image recipe, a recipe and systemd unit for
gwd,devtoolfor changing a recipe
Hand in
meta-fleetgwwithgwdin the image, started by a unit, with the smoke test - Your own layer: an image recipe, a recipe and systemd unit for
- Week 38 h
- Pinning and reproducibility: commit pins, source mirrors, what makes a build differ between runs (timestamps, build paths, wic UUIDs),
buildhistoryanddiffoscope - image size
Hand inA diff of two clean builds: package list, versions and image hash, with each difference explained
- Pinning and reproducibility: commit pins, source mirrors, what makes a build differ between runs (timestamps, build paths, wic UUIDs),
- Week 48 h
- Read-only root (and a plan for
/varand volatile paths), a data partition and thewicimage layout - check scripts for CI
Hand inCheckpoint 1, built in four steps: the
kasfile; the layer; the pin check; the two-build diff (then the captures) - Read-only root (and a plan for
Practice projects
- Add a second package to the image with
devtool addand remove it again. Done when the package appears in and then leaves the manifest and the image size changes by the number you predicted. - Rebuild from a clean directory with a populated sstate cache and again without one. Done when you report both times and the cache hit rate, and explain the gap.
- (Optional for a fresher) Add a pre-commit check that fails on any unpinned repository. Done when the seeded fault (fault 1) makes it fail.
GitHub repos to study
| Repo | What to read | Week |
|---|---|---|
| siemens/kas | The documentation and the configuration format for pinning layers | 1, 4 |
| bootlin/yocto-kiss | A deliberately small Yocto setup (branch wrynose) to compare with yours | 1 to 3 |
| openembedded/meta-openembedded | Recipes you will copy the style of (meta-oe) | 2 |
Milestone checkpoint
Build twice from clean directories, diff the results and run the seeded unpinned layer. Done when the Checkpoint 1 row passes. Evidence: the two manifests and their diff, the check script and its failure on the seeded fault, build time and disk use, ADR-1 (why Yocto and not Buildroot: layers, a long-term release to April 2030 and the SBOM and CVE tooling, against a smaller build, with your numbers; the ten-year promise outlasts that release, so state the migration plan).
Check yourself
Answer each question in your head first, then open it to check.
What is the difference between a recipe, a layer and an image?
A recipe says how to fetch, build and package one piece of software; a layer is a directory of recipes and settings; an image recipe lists what goes into the root filesystem.Why does a branch name make a build non-reproducible?
The branch moves, so the same name gives different source on different days.What does the sstate cache save, and what can make it miss?
It saves task outputs (compiled packages) keyed by their inputs; a change to a recipe, a variable or a dependency invalidates the key and forces a rebuild.Why mount the root filesystem read-only?
A power cut cannot corrupt what is never written, and a changed system file is easy to detect; writable state goes to a data partition, and/varand other volatile paths need a plan (tmpfs or the data partition).What is a machine, and what changes when you switch from
qemuarm64to a real board?A machine names the hardware settings (CPU architecture, kernel, bootloader, image layout). A real board changes the kernel configuration, the device tree and the bootloader.