Hello again. In the previous lesson, you traced Buildroot artifacts from source cache through output/build, host, staging, target, and finally images. That map now gives us the right insertion point for filesystem customization: an overlay and post-build script act on the target filesystem tree before Buildroot turns it into a deployable image.
In this lesson, you will add product-owned configuration files with a skeleton overlay, then use a post-build script to generate one controlled file and normalize the timestamps of the files it owns. The goal is not merely to make a QEMU image boot with a custom banner; it is to establish a maintainable pattern for the automotive/industrial gateway prototype: static configuration is explicit, generated configuration has declared inputs, and no build host details, secrets, or wall-clock time leak into the target filesystem.
Two complementary mechanisms, with different responsibilities
A Buildroot configuration selects packages and system-wide settings, but a deployable product also needs files that do not naturally belong to any package: product defaults, site-wide configuration, legal notices, small system policies, and board-level settings.
Buildroot recommends two mechanisms that can coexist:
- A root filesystem overlay is a directory tree copied onto the completed target filesystem tree.
- A post-build script runs after selected software has been installed into that tree and before filesystem images are assembled.
Buildroot - Making Embedded Linux Easy
Read the relevant part of the official Buildroot manual. It establishes the lifecycle boundary for overlays and post-build scripts, including the script arguments and the recommended board-directory layout.
In the subsection “Root filesystem overlays,” read the overlay behavior, including the guidance about relative paths and excluded version-control artifacts. Continue to the merged-/usr constraint and recommended board/<company>/<boardname>/rootfs-overlay location. Then read the “Post-build scripts” subsection, especially the script interface. Note that every configured post-build script receives the same argument list, so arguments must describe a common, stable build policy rather than a script-specific accident.
Can't find a good explanation? Sign up and we'll make it for you
Sign up