0

I am new to buildroot, I built a simple OS and it took a lot of time downloading the kernel and the packages.

The next time I built it (after doing some changes) buildroot downloaded the kernel and the packages again.

I want to save the kernel and the packages in my computer and link them to buildroot in a way that it fetches them for each build, re-downloading is a waste of time.

Tsyvarev
  • 60,011
  • 17
  • 110
  • 153
drpilot
  • 1
  • 1
  • 1
  • Welcome to the Stack Overflow! For delimit paragraphs in the post, use just `Enter` (return). Markup `---` is used for other purposes. – Tsyvarev Nov 11 '15 at 11:04

1 Answers1

5

From the Buildroot user manual, section Location of downloaded packages (slightly modified):

If you maintain several Buildroot trees, it might be better to have a shared download location. This can be achieved by pointing the BR2_DL_DIR environment variable to a directory. If this is set, then the value of BR2_DL_DIR in the Buildroot configuration is overridden. The following line should be added to ~/.bashrc.

export BR2_DL_DIR=<shared download location>

The download location can also be set in the .config file, with the BR2_DL_DIR option. Unlike most options in the .config file, this value is overridden by the BR2_DL_DIR environment variable.

Luca Ceresoli
  • 1,591
  • 8
  • 19
  • There may be a problem to use a shared download location. If we create a package which PACKAGE_SITE_METHOD = git and PACKAGE_VERSION = master, buildroot will only download the source code once and put the zipped code under dl folder. Every time user use the shared location, buildroot seems not check the code version with local downloads and keeps using the downloaded one. – Maruku May 23 '18 at 08:13
  • 1
    @Maruku: the PACKAGE_VERSION cannot be a branch, it won't work. It has to be something that always downloads the same source, i.e. a tag or a SHA-1. The Buildroot manual was wrong about this, it has been fixed a few days ago (https://git.buildroot.org/buildroot/commit/?id=970cb26ec22e165c9b1fea27a85cfe5762096b19). Look for the nightly manual for the correct version: http://nightly.buildroot.org/manual.html#_infrastructure_for_packages_with_specific_build_systems – Luca Ceresoli May 23 '18 at 08:54