diff options
| author | Scott Rifenbark <srifenbark@gmail.com> | 2019-03-15 14:41:05 -0600 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-03-19 23:54:02 +0000 |
| commit | f0d225fcd593dace7f8c383e90038996297c49ba (patch) | |
| tree | ccc1b5724343f855f18e1aaf63648d4055dac93d /documentation | |
| parent | 28f9cf565a8def94b69e3e0e23f08e72d4dde2da (diff) | |
| download | poky-f0d225fcd593dace7f8c383e90038996297c49ba.tar.gz | |
dev-manual: Added section on offline "snapshot" build.
This is a new section in the tasks chapter of the
dev-manual titled "Replicating a Build Offline".
It is in response to multiple hits in the
yocto@yoctoproject.org list asking how to do something
like this.
(From yocto-docs rev: 61b091be49517548e639808f6b6de4bf07e2a300)
Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation')
| -rw-r--r-- | documentation/dev-manual/dev-manual-common-tasks.xml | 90 |
1 files changed, 89 insertions, 1 deletions
diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index af0e4d53bf..8e78a247ce 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml | |||
| @@ -6323,9 +6323,97 @@ | |||
| 6323 | </literallayout> | 6323 | </literallayout> |
| 6324 | </para> | 6324 | </para> |
| 6325 | </section> | 6325 | </section> |
| 6326 | </section> | ||
| 6327 | 6326 | ||
| 6327 | <section id="replicating-a-build-offline"> | ||
| 6328 | <title>Replicating a Build Offline</title> | ||
| 6328 | 6329 | ||
| 6330 | <para> | ||
| 6331 | It can be useful to take a "snapshot" of upstream sources | ||
| 6332 | used in a build and then use that "snapshot" later to | ||
| 6333 | replicate the build offline. | ||
| 6334 | </para> | ||
| 6335 | |||
| 6336 | <para> | ||
| 6337 | Follow these steps to replicate a build offline by using a | ||
| 6338 | known "snapshot" of source files: | ||
| 6339 | <orderedlist> | ||
| 6340 | <listitem><para> | ||
| 6341 | <emphasis>Create a Clean Downloads Directory:</emphasis> | ||
| 6342 | Start with an empty downloads directory | ||
| 6343 | (<ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'><filename>DL_DIR</filename></ulink>). | ||
| 6344 | You start with an empty downloads directory by either | ||
| 6345 | removing the files in the existing directory or by | ||
| 6346 | setting <filename>DL_DIR</filename> to point to either | ||
| 6347 | an empty location or one that does not yet exist. | ||
| 6348 | </para></listitem> | ||
| 6349 | <listitem><para> | ||
| 6350 | <emphasis>Create Your "own-mirror" From Your Downloads Directory:</emphasis> | ||
| 6351 | Edit your <filename>local.conf</filename> configuration | ||
| 6352 | file as follows: | ||
| 6353 | <literallayout class='monospaced'> | ||
| 6354 | SOURCE_MIRROR_URL ?= "file:///home/<replaceable>your-download-dir</replaceable>/" | ||
| 6355 | INHERIT += "own-mirrors" | ||
| 6356 | BB_GENERATE_MIRROR_TARBALLS = "1" | ||
| 6357 | </literallayout> | ||
| 6358 | During the fetch process, BitBake looks in your mirror | ||
| 6359 | for source files. | ||
| 6360 | The | ||
| 6361 | <ulink url='&YOCTO_DOCS_REF_URL;#var-BB_GENERATE_MIRROR_TARBALLS'><filename>BB_GENERATE_MIRROR_TARBALLS</filename></ulink> | ||
| 6362 | variable causes the build process to create source | ||
| 6363 | tarballs in the downloads directory. | ||
| 6364 | </para></listitem> | ||
| 6365 | <listitem><para> | ||
| 6366 | <emphasis>Populate Your Downloads Directory Without Building:</emphasis> | ||
| 6367 | Use BitBake to fetch your sources but inhibit the | ||
| 6368 | build: | ||
| 6369 | <literallayout class='monospaced'> | ||
| 6370 | $ bitbake <replaceable>target</replaceable> --runonly=fetch" | ||
| 6371 | </literallayout> | ||
| 6372 | The downloads directory now has a "snapshot" of the | ||
| 6373 | source files used for the build. | ||
| 6374 | The directory also has the tarballs. | ||
| 6375 | </para></listitem> | ||
| 6376 | <listitem><para> | ||
| 6377 | <emphasis>Remove Any Git or other SCM Subdirectories From the Downloads Directory:</emphasis> | ||
| 6378 | You can clean up your downloads directory by removing | ||
| 6379 | any Git or other Source Control Management (SCM) | ||
| 6380 | subdirectories such as | ||
| 6381 | <filename>${DL_DIR}/git2/*</filename>. | ||
| 6382 | </para></listitem> | ||
| 6383 | <listitem><para> | ||
| 6384 | <emphasis>Instruct the Build Process to Build Using Local Files:</emphasis> | ||
| 6385 | Add the | ||
| 6386 | <ulink url='&YOCTO_DOCS_BB_URL;#var-bb-BB_NO_NETWORK'><filename>BB_NO_NETWORK</filename></ulink> | ||
| 6387 | variables to your <filename>local.conf</filename>. | ||
| 6388 | <literallayout class='monospaced'> | ||
| 6389 | BB_NO_NETWORK = "1" | ||
| 6390 | </literallayout> | ||
| 6391 | Using the <filename>BB_NO_NETWORK</filename> | ||
| 6392 | variable makes sure that BitBake's fetching process | ||
| 6393 | stays local, which means your "own-mirror" is used. | ||
| 6394 | </para></listitem> | ||
| 6395 | <listitem><para> | ||
| 6396 | <emphasis>Start With a Clean Build:</emphasis> | ||
| 6397 | You can start with a clean build by removing the | ||
| 6398 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink><filename>}</filename> | ||
| 6399 | directory or using a new | ||
| 6400 | <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>. | ||
| 6401 | </para></listitem> | ||
| 6402 | <listitem><para> | ||
| 6403 | <emphasis>Build Your Target:</emphasis> | ||
| 6404 | Use BitBake to build your target again: | ||
| 6405 | <literallayout class='monospaced'> | ||
| 6406 | $ bitbake <replaceable>target</replaceable> | ||
| 6407 | </literallayout> | ||
| 6408 | The build completes using the know local "snapshot" of | ||
| 6409 | source files from your mirror. | ||
| 6410 | The resulting tarballs for your "snapshot" of source | ||
| 6411 | files are in the downloads directory. | ||
| 6412 | </para></listitem> | ||
| 6413 | </orderedlist> | ||
| 6414 | </para> | ||
| 6415 | </section> | ||
| 6416 | </section> | ||
| 6329 | 6417 | ||
| 6330 | <section id='speeding-up-a-build'> | 6418 | <section id='speeding-up-a-build'> |
| 6331 | <title>Speeding Up a Build</title> | 6419 | <title>Speeding Up a Build</title> |
