Ground Embedded KO Subscribe

Notes / Embedded Linux

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.

GROUND EMBEDDED · NOTEEmbedded Linux 07Yocto and Buildroot 1$ make ARCH=arm 2$ insmod gnd_gpio.ko 3[ 1.024] gnd: probe ok 4$ cat /dev/gnd0 50x5A 6$ _

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
RoadmapSee where this note sits in Embedded Linux→

What comes out

BootloaderKernel imageDevice treeRoot file system
What the build system produces. Write these four to storage and the board boots.
  • 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.

FREE PDFGet the 3 free ebooksIf you want to keep reading this topic as one book: BLDC motor control, serial communication and sensors at book length. PDFs are in Korean.Get them free →