---
title: "Sources and mirrors"
---

# Sources and mirrors

The build's fetcher settings with warnings when it can reach the internet or the company mirror is missing, where each source of a finished build came from, a mirror check before release, and mirror settings written after a confirmation.

Regulated builds fetch from the company's mirror, often offline, and the release record says where every source came from.

**State:** modelled with BitBake 2.8.1 (poky scarthgap, meta-freescale) and a local HTTP mirror: a `site.conf` write read back by `bitbake -e`; a real fetch with two sources from the mirror and one from PyPI flagged; a mirror check of one recipe (38 missing, the build's stamps unchanged); in the running app a check of a full image (323 recipes, 2 from the mirror, 304 missing with reasons). Not run against your company mirror, build server or on Windows. A check run with `--runall=checkuri` cannot prove a mirror complete, so the module fetches instead.

## Declare the company mirror

`neuralInverse.embeddedLinux.companyMirrors` lists the company's source and shared-state mirrors and the hosts builds may fetch from: URLs (`https://mirror.example.com/yocto/sources/`, `file:///srv/yocto-mirror/`) or host names (`mirror.example.com`, `*.example.com`).

## The fetcher settings

**Open Sources and Mirrors** shows, each with the value in effect and the file and line that decided it: PREMIRRORS (in the order BitBake tries them), MIRRORS, SSTATE_MIRRORS, BB_NO_NETWORK, BB_ALLOWED_NETWORKS, BB_FETCH_PREMIRRORONLY, BB_GENERATE_MIRROR_TARBALLS, BB_GIT_SHALLOW, DL_DIR, SSTATE_DIR and `own-mirrors`. It warns when the build can reach the internet, when the company mirror is missing or not first, and when outside mirrors, shared-state mirrors or hash servers are used.

## Where the sources came from

**Show Where the Build's Sources Came From** reads a finished build's cooker log and every `log.do_fetch`, and shows each source as from a premirror, from a mirror, from upstream (flagged) or not fetched. **Export Evidence (Markdown)...** or **(CSV)...** writes it with the console log's SHA-256 for the audit record.

## Check the mirror before release

**Check Mirror Before Release...** picks the image and the network limits, then, after a confirmation that shows the command and both configuration files, runs `bitbake -k <image> --runall=fetch` in a build directory of its own (its own downloads and TMPDIR; the build's stamps, parse cache and downloads untouched). It lists every recipe the mirror lacks with BitBake's reason, and the check exports to Markdown or CSV. Its fetch failures stay in the check's own list, not in Problems.

## Write mirror settings

**Write Mirror Settings...** writes the company mirror settings into the product distribution or `site.conf`, after a confirmation with the exact lines. Other targets go through [Build configuration](https://neuralinverse.com/docs/modules/embedded-linux/build-configuration/).

## Agent tools

Three read-only tools and two that ask first.

Next: [Tests and coverage on the board](https://neuralinverse.com/docs/modules/embedded-linux/testing/).
