rewrote quickstart, build-process
[AGL/documentation.git] / docs / 0_Getting_Started / 2_Building_AGL_Image / 4_Customizing_Your_Build.md
@@ -1,14 +1,7 @@
 ---
-edit_link: ''
 title: Customizing Your Build
-origin_url: >-
-  https://raw.githubusercontent.com/automotive-grade-linux/docs-sources/master/docs/getting-started/image-workflow-cust-build.md
 ---
 
-<!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/getting_started/master/image-development-workflow-getting-started-book.yml -->
-
-# 4. Customizing Your Build
-
 Because the build process is based on BitBake and the Yocto Project,
 build customizations are driven through configuration files used during
 the build.
@@ -24,11 +17,11 @@ various variables accomplish.
 
 To view and customize the `local.conf` file, use any text editor:
 
-```bash
-$ vi $AGL_TOP/build/conf/local.conf
+```sh
+$ vim $AGL_TOP/<release-branch-name>/<build-dir>/conf/local.conf
 ```
 
-As mentioned in the "[Initializing Your Build Environment](./image-workflow-initialize-build-environment.html#initializing-your-build-environment.html)" section,
+As mentioned in the "[Initializing Your Build Environment](./3_Initializing_Your_Build_Environment.md)" section,
 the `local.conf` file gets augmented with AGL configuration fragments based on
 how you execute the `aglsetup.sh` script.
 You can see those fragments at the end the configuration file.
@@ -48,13 +41,13 @@ That information is committed to a local Git repository where you can examine it
 To enable build history, make sure the following two lines are in your
 `local.conf` file:
 
-```bash
+```sh
 INHERIT += "buildhistory"
 BUILDHISTORY_COMMIT = "1"
 ```
 
 See the
-"[Maintaining Build Output Quality](https://www.yoctoproject.org/docs/2.4.4/ref-manual/ref-manual.html#maintaining-build-output-quality)"
+"[Maintaining Build Output Quality](https://www.yoctoproject.org/docs/3.1.2/ref-manual/ref-manual.html#maintaining-build-output-quality)"
 section in the Yocto Project Reference Manual for a complete discussion on
 build history.
 
@@ -66,12 +59,12 @@ to remove temporary workspace.
 
 You need to inherit the `rm_work` class by using this statement in the `local.conf` file:
 
-```bash
+```sh
 INHERIT += "rm_work"
 ```
 
 You can read about the class in the
-"[rm_work.bbclass](https://www.yoctoproject.org/docs/2.4.4/ref-manual/ref-manual.html#ref-classes-rm-work)"
+"[rm_work.bbclass](https://www.yoctoproject.org/docs/3.1.2/ref-manual/ref-manual.html#ref-classes-rm-work)"
 section of the Yocto Project Reference Manual for more information.
 
 ##  Pointing at Shared State Cache Locations
@@ -87,24 +80,23 @@ would not be different as compared to a re-built module.
 For the AGL build, you can specify the location for sstate files by including the
 following in the `local.conf` file:
 
-```bash
-SSTATE_DIR = "${HOME}/workspace_agl/sstate-cache"
+```sh
+SSTATE_DIR = "${AGL_TOP}/sstate-cache"
 ```
 
-also, in the `local.conf` file, you can specify additional directories in which the build
+Also, in the `local.conf` file, you can specify additional directories in which the build
 system can look for shared state information.
 Use the following form in your file to list out the directories you want the build
 process to look at for sstate information:
 
-
-```bash
+```sh
 SSTATE_MIRRORS ?= "\
-     file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \
-     file://.* file:///some/local/dir/sstate/PATH"
+    file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \
+    file://.* file:///some/local/dir/sstate/PATH"
 ```
 
 If you want to know more about the Yocto Project sstate mechanism, see the
-"[Shared State Cache](https://www.yoctoproject.org/docs/2.4.4/ref-manual/ref-manual.html#shared-state-cache)"
+"[Shared State Cache](https://www.yoctoproject.org/docs/3.1.2/ref-manual/ref-manual.html#shared-state-cache)"
 section in the Yocto Project Reference Manual.
 
 ## Preserving the Download Directory
@@ -114,7 +106,7 @@ from various upstream projects.
 Downloading these files can take a while, particularly if your network
 connection is slow.
 The process downloads files into a
-"[download directory](https://www.yoctoproject.org/docs/2.4.4/ref-manual/ref-manual.html#var-DL_DIR)".
+"[download directory](https://www.yoctoproject.org/docs/3.1.2/ref-manual/ref-manual.html#var-DL_DIR)".
 The `DL_DIR` variable defines the download directory.
 For subsequent builds, you can preserve this directory to speed up the download
 part of a build.
@@ -123,8 +115,8 @@ The default download directory is in a folder named "downloads".
 For the AGL build you can set the download directory by adding the following to your
 `local.conf` file:
 
-```bash
-DL_DIR = "${HOME}/workspace_agl/downloads"
+```sh
+DL_DIR = "${AGL_TOP}/downloads"
 ```
 
 ## Using a Shared State (sstate) Mirror
@@ -135,11 +127,25 @@ You can significantly speed up builds and guard against fetcher failures by
 using mirrors.
 To use mirrors, add this line to your `local.conf` file in the Build directory:
 
-```
+```sh
 SSTATE_MIRRORS_append = " file://.* https://download.automotivelinux.org/sstate-mirror/master/${DEFAULTTUNE}/PATH \n "
 ```
 
 You can learn more about shared state and how it is used in the
-"[Shared State Cache](https://yoctoproject.org/docs/2.4.4/ref-manual/ref-manual.html#shared-state-cache)"
+"[Shared State Cache](https://yoctoproject.org/docs/3.1.2/ref-manual/ref-manual.html#shared-state-cache)"
 section of the Yocto Project Reference Manual.
 
+## Common Settings using Symbolic Link with site.conf
+
+```sh
+$ echo '# reuse download directories' >> $AGL_TOP/site.conf
+$ echo 'DL_DIR = "$HOME/downloads/"' >> $AGL_TOP/site.conf
+$ echo 'SSTATE_DIR = "$AGL_TOP/sstate-cache/"' >> $AGL_TOP/site.conf
+$ cd $AGL_TOP/master/qemux86-64/
+$ ln -sf $AGL_TOP/site.conf conf/
+
+In General;
+$ cd $AGL_TOP/<release-branch-name>/<build-dir>/
+$ ln -sf $AGL_TOP/site.conf conf/
+```
+