Sunday, October 25, 2015

Creating local mirror for Buildroot package sources

When you need to frequently and quickly rebuild Buildroot for a variety of reasons, there's a neat feature in Buildroot that allows you to use a local source mirror, so you can avoid wasting bandwidth and unnecessary waiting for downloads.

Here's a list of the BR variables, which configure the mirroring behavior:


The variables usage should be pretty obvious, but as always don't hesitate to take a look at the, where the variables are documented (or use menuconfig and go to "Build options", "Mirrors and Download locations").

Basically you have 2 ways to change these variables - either edit them in file, or assign them in your boards's configuration file (configs/boardname_defconfig). The difference is that boardname_defconfig affects only your board, and affects all boards' builds.

Here's a very simple example of making a local mirror for all sources, just add this to your boardname_defconfig:

# Use local source mirror

Of course the best place to put your server is inside your LAN, which will guarantee sub-second downloads during the build process.