Urgent.News

What's breaking now, across thousands of outlets.

Tech

Buildroot for Embedded Linux — Part 1: Your First Buildroot Root Filesystem

Buildroot builds a cross-compiler, a Linux kernel and a complete root filesystem from source, driven by one Kconfig-style configuration file. Starting from the qemu_arm_vexpress_defconfig that ships with Buildroot 2026.05.1, two commands produce a bootable ARM system you can run under QEMU. The images you ship are the ones in output/images/ ; output/target/ looks like a root filesystem but must…

This multi-part series on Buildroot for Embedded Linux begins by explaining what Buildroot does. It builds a cross-compiler, Linux kernel, and root filesystem from source using one Kconfig-style configuration file. The series assumes the decision to use Buildroot has been made, as covered in an earlier comparison with Yocto.

To get started, a Linux host with ample disk space and a network connection is required. No physical development board is needed for this part, as QEMU will simulate the hardware. On a Debian or Ubuntu host, the mandatory packages are installed using apt, including build-essential, diffutils, patch, gzip, bzip2, perl, tar, cpio, unzip, rsync, file, bc, findutils, gawk, wget, ncurses development files, and several others.

The first step is to download and unpack Buildroot 2026.05.1 from the official website and navigate to the directory. The source ships ready-made configurations for many boards and emulated machines, with each configuration file located in the configs/ directory. The make command is used to generate a configuration based on the qemu_arm_vexpress_defconfig, which is tailored for the ARM Versatile Express machine.

Examining the configuration file reveals several important options, including the selection of a Cortex-A9 core, Linux 6.18.7 kernel, custom device tree file, and a 64 MB ext2 root filesystem. Other settings, such as patch directories, DHCP on eth0, and post-image scripts, are also present but are not critical for this initial setup.

The Makefile does not support top-level parallel builds by default, so the make command is executed without the -jN flag. This step builds the cross-compilation toolchain from source before proceeding with the rest of the build process. Once the build is complete, the output/ directory contains all the generated files, with the output/images/ subdirectory holding the finished artefacts such as the kernel image, device tree blob, bootloader, and root filesystem images. These files are what you would use to boot the target.

The output/target/ directory, however, is not a usable root filesystem as-is. Buildroot does not run as root and cannot create device nodes or set permissions correctly in the /dev/ directory. Copying this directory to a device would result in a system that does not boot properly. For an extracted root filesystem, such as for NFS boot, it is recommended to build the tarball image in the output/images/ directory and extract that instead.

To boot the image under QEMU, use the command provided in the readme.txt file associated with the emulated machine. This command launches QEMU with the necessary options, such as the VExpress-A9 machine model, 1 CPU, 256 MB of memory, the kernel image, device tree blob, and root filesystem image. The console is attached to the shell, and a serial console is available for debugging. The target boots into a login prompt where you can log in as root.

Throughout this series, several defaults will be explored and discussed, including the choice of C library (glibc), init system (BusyBox), and other configuration options. Understanding these defaults is crucial for customizing your Buildroot root filesystem according to your specific needs.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

My Experience Running a Homelab on Oracle Cloud’s Free VPS

It’s been a while since I wrote a blog post. Recently, I decided to get back into writing and document something I’ve been playing around with: setting up a small homelab environment on an Oracle…

  • Author documented homelab setup on Oracle Cloud's Free Tier VPS.
  • Faced memory constraints while running K3s, stopped server eventually.
  • Learned about firewall rules, Docker containers, and domain setup.

More from Sunday 23 August →