summaryrefslogtreecommitdiffstats
path: root/documentation/dev-manual/efficiently-fetching-sources.rst
diff options
context:
space:
mode:
authorMichael Opdenacker <michael.opdenacker@bootlin.com>2022-11-24 17:50:52 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-01 19:20:29 +0000
commit945c669138a76be18c6b4da4f8f907d2a5cfd83f (patch)
treecebff3cae5021d4fcceb5aa51fce1c2aead97ed2 /documentation/dev-manual/efficiently-fetching-sources.rst
parent6fe3143800925463279d0664fc7f3372b53c6c52 (diff)
downloadpoky-945c669138a76be18c6b4da4f8f907d2a5cfd83f.tar.gz
manuals: split dev-manual/common-tasks.rst
A 500 KB source file is always harder to manage, and can have section title conflicts. So, the "Common Tasks" document is gone and all its constituents are moved up one level. You now have 40 chapters in the Development Tasks Manual. (From yocto-docs rev: 8a45bc469411410020b8e688c137395fcaf3761b) Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/dev-manual/efficiently-fetching-sources.rst')
-rw-r--r--documentation/dev-manual/efficiently-fetching-sources.rst68
1 files changed, 68 insertions, 0 deletions
diff --git a/documentation/dev-manual/efficiently-fetching-sources.rst b/documentation/dev-manual/efficiently-fetching-sources.rst
new file mode 100644
index 0000000000..a15f0a92ce
--- /dev/null
+++ b/documentation/dev-manual/efficiently-fetching-sources.rst
@@ -0,0 +1,68 @@
1.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
2
3Efficiently Fetching Source Files During a Build
4************************************************
5
6The OpenEmbedded build system works with source files located through
7the :term:`SRC_URI` variable. When
8you build something using BitBake, a big part of the operation is
9locating and downloading all the source tarballs. For images,
10downloading all the source for various packages can take a significant
11amount of time.
12
13This section shows you how you can use mirrors to speed up fetching
14source files and how you can pre-fetch files all of which leads to more
15efficient use of resources and time.
16
17Setting up Effective Mirrors
18============================
19
20A good deal that goes into a Yocto Project build is simply downloading
21all of the source tarballs. Maybe you have been working with another
22build system for which you have built up a
23sizable directory of source tarballs. Or, perhaps someone else has such
24a directory for which you have read access. If so, you can save time by
25adding statements to your configuration file so that the build process
26checks local directories first for existing tarballs before checking the
27Internet.
28
29Here is an efficient way to set it up in your ``local.conf`` file::
30
31 SOURCE_MIRROR_URL ?= "file:///home/you/your-download-dir/"
32 INHERIT += "own-mirrors"
33 BB_GENERATE_MIRROR_TARBALLS = "1"
34 # BB_NO_NETWORK = "1"
35
36In the previous example, the
37:term:`BB_GENERATE_MIRROR_TARBALLS`
38variable causes the OpenEmbedded build system to generate tarballs of
39the Git repositories and store them in the
40:term:`DL_DIR` directory. Due to
41performance reasons, generating and storing these tarballs is not the
42build system's default behavior.
43
44You can also use the
45:term:`PREMIRRORS` variable. For
46an example, see the variable's glossary entry in the Yocto Project
47Reference Manual.
48
49Getting Source Files and Suppressing the Build
50==============================================
51
52Another technique you can use to ready yourself for a successive string
53of build operations, is to pre-fetch all the source files without
54actually starting a build. This technique lets you work through any
55download issues and ultimately gathers all the source files into your
56download directory :ref:`structure-build-downloads`,
57which is located with :term:`DL_DIR`.
58
59Use the following BitBake command form to fetch all the necessary
60sources without starting the build::
61
62 $ bitbake target --runall=fetch
63
64This
65variation of the BitBake command guarantees that you have all the
66sources for that BitBake target should you disconnect from the Internet
67and want to do the build later offline.
68