Use local mirror to build yocto filesystem from internal server

As we have seen in “Configure yocto to download from local mirror to save bandwidth” one way to setup your local server to build yocto is to modify PREMIRRORS and MIRRORS arguments permanantly in conf/distro/my_platform.conf but if we want to change between local mirrors for some reason, instead of changing distro configurations we can override those arguments from local.conf as,

 $ vim build/conf/local.conf 
# Source download dir
DL_DIR = "<em><strong>your_yocto_dir/</strong></em>sources"

# The sstate-cache dir
SSTATE_DIR = "<em><strong>your_yocto_dir/</strong></em>/sstate-cache"

# Packages source mirrors
SOURCE_MIRROR_URL = "http://your_IP/yocto-mirrors/mirrored-sources/"
INHERIT += "own-mirrors"
BB_GENERATE_MIRROR_TARBALLS = "1"

# The sstate-cache mirrors
SSTATE_MIRRORS = "http://your_IP/yocto-mirrors/sstate-cache/" 

Reference – https://www.yoctoproject.org/docs/1.5.1/ref-manual/ref-manual.html#var-BB_GENERATE_MIRROR_TARBALLS

SOURCE_MIRROR_URL => Defines your own PREMIRRORS from which to first fetch source before attempting to fetch from the upstream specified in SRC_URI.
To use this variable, you must globally inherit the own-mirrors class and then provide the URL to your mirrors. Here is an example:

INHERIT += “own-mirrors”
SOURCE_MIRROR_URL = “http://example.com/my-source-mirror”

BB_GENERATE_MIRROR_TARBALLS => Causes tarballs of the Git repositories to be placed in the DL_DIR directory. For performance reasons, creating and placing tarballs of the Git repositories is not the default action by the OpenEmbedded build system.

BB_GENERATE_MIRROR_TARBALLS = “1”

Android Android Commands Android Java Applications Application Libraries Bash / Shell Scripts Bluetooth driver Build Frameworks Commands and Packages Core Kernel C Programs Development Environment Setup Documents / Books Errors & Failures File Systems Framebuffer / Display Driver git Go Language Programs Hardware Platforms Home JAVA Programs Kernel & Device Drivers Kernel Booting and Porting Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL NDK / Middleware / HAL Network Driver OS Concepts PHP Procfs Filesystem Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded

Leave a Reply