rewrote quickstart, build-process
[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 The remainder of this section provides steps on how to download the AGL source files:
14
15 1. **Define Your Top-Level Directory:**
16    You can define an environment variable as your top-level AGL workspace folder.
17    Following is an example that defines the `$HOME/workspace_agl` folder using
18    an environment variable named "AGL_TOP":
19
20       ```sh
21       $ export AGL_TOP=$HOME/AGL
22       $ echo 'export AGL_TOP=$HOME/AGL' >> $HOME/.bashrc
23       $ mkdir -p $AGL_TOP
24       ```
25
26 2. **Download the `repo` Tool and Set Permissions:**
27    AGL Uses the `repo` tool for managing repositories.
28    Use the following commands to download the tool and then set its
29    permissions to allow for execution:
30
31       ```sh
32       $ mkdir -p $HOME/bin
33       $ export PATH=$HOME/bin:$PATH
34       $ echo 'export PATH=$HOME/bin:$PATH' >> $HOME/.bashrc
35       $ curl https://storage.googleapis.com/git-repo-downloads/repo > $HOME/bin/repo
36       $ chmod a+x $HOME/bin/repo
37       ```
38
39    **NOTE:** See the
40    "[Repo Command Reference](https://source.android.com/setup/develop/repo)"
41    for more information on the `repo` tool.
42
43 3. **Download the AGL Source Files:**
44    Depending on your development goals, you can either download the
45    latest stable AGL release branch, or the "cutting-edge" (i.e. "master"
46    branch) files.
47
48    * **Stable Release:**
49      Using the latest stable release gives you a solid snapshot of the
50      latest know release.
51      The release is static, tested, and known to work.
52      To download the latest stable release branch (i.e. Jellyfish), use
53      the following commands:
54
55      ```sh
56      $ cd $AGL_TOP
57      $ mkdir jellyfish
58      $ cd jellyfish
59      $ repo init -b jellyfish -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
60      $ repo sync
61      ```
62
63    * **Cutting-Edge Files:**
64      Using the "cutting-edge" AGL files gives you a snapshot of the
65      "master" branch.
66      The resulting local repository you download is dynamic and changes frequently depending on community contributions.
67      The advantage of using "cutting-edge" AGL files is that you have the
68      absolute latest features, which are often under development, for AGL.
69
70      To download the "cutting-edge" AGL files, use the following commands:
71
72      ```sh
73      $ cd $AGL_TOP
74      $ mkdir master
75      $ cd master
76      $ repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
77      $ repo sync
78      ```
79
80    Once you `sync` the repository, you have the AGL files in the form of
81    "layers" (e.g. `meta-*` folders).
82    You also have the `poky` repository in your AGL workspace.
83
84    Listing out the resulting directory structure appears as follows:
85
86    ```sh
87    $ tree -L 1
88     .
89     ├── bsp
90     ├── external
91     ├── meta-agl
92     ├── meta-agl-cluster-demo
93     ├── meta-agl-demo
94     ├── meta-agl-devel
95     ├── meta-agl-extra
96     └── meta-agl-telematics-demo
97    ```
98