Search code examples
gityoctobitbake

How to prevent bitbake from looking for mirrors for specific host?


I am building a system image with yocto where some of the recipes reference software that is hosted on out private git repository server (let's call it repo-host). The checkout works fine, but bitbake always tries to first access the downloads.yoctoproject.org mirror instead of our own server.

In the log.do_fetch of the recipe, this behaviour can be seen in log entries like the following (hostname and repo name anonymized, but the rest is unchanged):

DEBUG: Fetching http://downloads.yoctoproject.org/mirror/sources/git2_repo-host.path.to.the.repo.git..tar.gz using command
'/usr/bin/env wget -t 2 -T 30 -nv --passive-ftp --no-check-certificate -P /home/amu/projekte/yocto/motec-yocto/build/downloads 'http://downloads.yoctoproject.org/mirror/sources/git2_repo-host.path.to.the.repo.git..tar.gz''

Question: Is there a way to make bitbake globally avoid the mirroring mechanism only for certain hosts? If not, is there a way to do that per recipe?

Ideally, the mirrors would not be contacted for all sources that are fetched for git URLs starting with a specific hostname (like git://repo-host/...). All other sources (the kernel, gcc etc.) should still use the mirrors.


Solution

  • This would be the PREMIRRORS feature, the URLs you are seeing are probably coming from distro configuration you use (e.g. poky.conf). You can set (or prepend) the value of PREMIRRORS to a local download site or an empty string if it's important to you that these external pre-mirrors are not tried. You should be able to do this in your distro configuration, local configuration or in individual recipes.