Quick Buildroot Tutorial: Rebuilding Packages

One of the most common and repetitive procedures is rebuilding a single package after tweaking the code a little bit. I have done this more than a hundred times while writing patches for the Linux Kernel.

For each package buildroot creates a specific file when a stage is completed, this helps the building environment to avoid steps which have been already completed. These files can be seen below:

$ ls .stamp_*
.stamp_compiled  .stamp_configured  .stamp_downloaded  .stamp_extracted  .stamp_installed  .stamp_patched

Each of this files if removed, will trigger the building process right from the stage it represents. If we remove the .stamp_compiled file buildroot will begin with the compilation step and avoid the downloading, configuring and patching.

So if you are modifying the kernel to adapt it to a custom board, tweaking a driver or tracing a vulnerability the steps should be has follow:

$ rm -f output/build/linux-<version/.stamp_compiled
$ make linux