Fixing broken links and formatting in App Framework page
[AGL/documentation.git] / docs / 0_Getting_Started / 2_Building_AGL_Image / 2_Downloading_AGL_Software.md
1 ---
2 title: Downloading AGL Software
3 ---
4
5 Once you have determined the build host can build an AGL image,
6 you need to download the AGL source files.
7 The AGL source files, which includes the Yocto Project layers, are
8 maintained on the AGL Gerrit server.
9 For information on how to create accounts for Gerrit, see the
10 [Getting Started with AGL](https://wiki.automotivelinux.org/start/getting-started)
11 wiki page.
12
13 **NOTE:** Further information about Download and Build AGL Source Code available at [AGL wiki](https://wiki.automotivelinux.org/agl-distro/source-code).
14
15 The remainder of this section provides steps on how to download the AGL source files:
16
17 1. **Define Your Top-Level Directory:**
18    You can define an environment variable as your top-level AGL workspace folder.
19    Following is an example that defines the `$HOME/workspace_agl` folder using
20    an environment variable named "AGL_TOP":
21
22       ```sh
23       $ export AGL_TOP=$HOME/AGL
24       $ echo 'export AGL_TOP=$HOME/AGL' >> $HOME/.bashrc
25       $ mkdir -p $AGL_TOP
26       ```
27
28 2. **Download the `repo` Tool and Set Permissions:**
29    AGL Uses the `repo` tool for managing repositories.
30    Use the following commands to download the tool and then set its
31    permissions to allow for execution:
32
33       ```sh
34       $ mkdir -p $HOME/bin
35       $ export PATH=$HOME/bin:$PATH
36       $ echo 'export PATH=$HOME/bin:$PATH' >> $HOME/.bashrc
37       $ curl https://storage.googleapis.com/git-repo-downloads/repo > $HOME/bin/repo
38       $ chmod a+x $HOME/bin/repo
39       ```
40
41    **NOTE:** See the
42    "[Repo Command Reference](https://source.android.com/setup/develop/repo)"
43    for more information on the `repo` tool.
44
45 3. **Download the AGL Source Files:**
46    Depending on your development goals, you can either download the
47    latest stable AGL release branch, or the "cutting-edge" (i.e. "master"
48    branch) files.
49
50    * **Stable Release:**
51      Using the latest stable release gives you a solid snapshot of the
52      latest know release.
53      The release is static, tested, and known to work.
54      To download the [latest stable release branch](https://wiki.automotivelinux.org/agl-distro/release-notes#latest_stable_release), use
55      the following commands:
56
57      **Note:** In this below command please change the branch name to the [latest stable release branch](https://wiki.automotivelinux.org/agl-distro/release-notes#latest_stable_release). For example, for Nifty Needlefish branch use the last name i.e. "needlefish" as branch.
58
59
60      ```sh
61      $ cd $AGL_TOP
62      $ mkdir <<branch name>>
63      $ cd <<branch name>>
64      $ repo init -b <<branch name>> -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
65      $ repo sync
66      ```
67
68    * **Cutting-Edge Files:**
69      Using the "cutting-edge" AGL files gives you a snapshot of the
70      "master" branch.
71      The resulting local repository you download is dynamic and changes frequently depending on community contributions.
72      The advantage of using "cutting-edge" AGL files is that you have the
73      absolute latest features, which are often under development, for AGL.
74
75      To download the "cutting-edge" AGL files, use the following commands:
76
77      ```sh
78      $ cd $AGL_TOP
79      $ mkdir master
80      $ cd master
81      $ repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
82      $ repo sync
83      ```
84
85    Once you `sync` the repository, you have the AGL files in the form of
86    "layers" (e.g. `meta-*` folders).
87    You also have the `poky` repository in your AGL workspace.
88
89    Listing out the resulting directory structure appears as follows:
90
91    ```sh
92    $ tree -L 1
93     .
94     ├── bsp
95     ├── external
96     ├── meta-agl
97     ├── meta-agl-cluster-demo
98     ├── meta-agl-demo
99     ├── meta-agl-devel
100     ├── meta-agl-extra
101     └── meta-agl-telematics-demo
102    ```