Yocto and Buildroot: building the whole Linux for your board
Tools that build the bootloader, kernel, root file system and your application into a single image, reproducibly.
Why they are needed
A finished distribution such as Raspberry Pi OS is convenient for prototypes, but for a product it carries many unneeded packages and updates are hard to control. Product Linux has to contain only what is needed and be rebuildable as the same image at any time.
Comparison
| Buildroot | Yocto | |
|---|---|---|
| Learning | Easy (menuconfig) | Hard (layers, recipes) |
| Build time | Short | Long |
| Package management | The image as a whole | Per-package updates possible |
| Industrial use | Small devices | Chip-vendor BSPs, vehicles, large products |
What comes out
- Bootloader (U-Boot)
- Kernel + device tree
- Root file system (busybox or the packages you need)
- Cross toolchain and SDK
Yocto concepts
- Layer: a bundle of functionality (meta-poky, the chip vendor's BSP layer, your product layer)
- Recipe (.bb): how to fetch, build and install one piece of software
- Machine / distro / image: target board / policy / final composition
Chip companies such as NXP, TI and ST provide Yocto BSP layers, so you normally start by adding your own layer on top.