From f0d225fcd593dace7f8c383e90038996297c49ba Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Fri, 15 Mar 2019 14:41:05 -0600 Subject: 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 Signed-off-by: Richard Purdie --- .../dev-manual/dev-manual-common-tasks.xml | 90 +++++++++++++++++++++- 1 file changed, 89 insertions(+), 1 deletion(-) (limited to 'documentation') 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 @@ - +
+ Replicating a Build Offline + + It can be useful to take a "snapshot" of upstream sources + used in a build and then use that "snapshot" later to + replicate the build offline. + + + + Follow these steps to replicate a build offline by using a + known "snapshot" of source files: + + + Create a Clean Downloads Directory: + Start with an empty downloads directory + (DL_DIR). + You start with an empty downloads directory by either + removing the files in the existing directory or by + setting DL_DIR to point to either + an empty location or one that does not yet exist. + + + Create Your "own-mirror" From Your Downloads Directory: + Edit your local.conf configuration + file as follows: + + SOURCE_MIRROR_URL ?= "file:///home/your-download-dir/" + INHERIT += "own-mirrors" + BB_GENERATE_MIRROR_TARBALLS = "1" + + During the fetch process, BitBake looks in your mirror + for source files. + The + BB_GENERATE_MIRROR_TARBALLS + variable causes the build process to create source + tarballs in the downloads directory. + + + Populate Your Downloads Directory Without Building: + Use BitBake to fetch your sources but inhibit the + build: + + $ bitbake target --runonly=fetch" + + The downloads directory now has a "snapshot" of the + source files used for the build. + The directory also has the tarballs. + + + Remove Any Git or other SCM Subdirectories From the Downloads Directory: + You can clean up your downloads directory by removing + any Git or other Source Control Management (SCM) + subdirectories such as + ${DL_DIR}/git2/*. + + + Instruct the Build Process to Build Using Local Files: + Add the + BB_NO_NETWORK + variables to your local.conf. + + BB_NO_NETWORK = "1" + + Using the BB_NO_NETWORK + variable makes sure that BitBake's fetching process + stays local, which means your "own-mirror" is used. + + + Start With a Clean Build: + You can start with a clean build by removing the + ${TMPDIR} + directory or using a new + Build Directory. + + + Build Your Target: + Use BitBake to build your target again: + + $ bitbake target + + The build completes using the know local "snapshot" of + source files from your mirror. + The resulting tarballs for your "snapshot" of source + files are in the downloads directory. + + + +
+
Speeding Up a Build -- cgit v1.2.3-54-g00ecf