===== Download and Build AGL Source Code ===== The AGL source code and Yocto layers are maintained on the [[https://gerrit.automotivelinux.org/ | AGL gerrit server]]. For information on how to create accounts for gerrit see [[start:getting-started|Getting Started with AGL]]. Build instructions for supported hardware platforms available at [[https://docs.automotivelinux.org/en/master/#0_Getting_Started/2_Building_AGL_Image/0_Build_Process/ | AGL documentation site]]. ==== Prepare Repo Tool ==== AGL Uses the [[https://code.google.com/p/git-repo/ | Repo tool]] for managing repositories. First you need to setup layers of AGL. You can use these commands. Prepare [[https://source.android.com/source/developing.html | Repo]]: $ mkdir ~/bin $ export PATH=~/bin:$PATH $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo $ chmod a+x ~/bin/repo ==== Download Master Branch ==== To download all code from master: $ repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo $ repo sync ==== Download Latest Stable Release ==== To download all layers for the latest stable release and more see the [[agl-distro:release-notes | release notes]] $ repo init -b icefish [-m icefish_9.0.0.xml] -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo $ repo sync ==== Download Latest on stable branch ==== To download all layers on the current ​release ​branch which may be in the midst of testing or changes prior to the next stable release: $ repo init -b icefish -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo $ repo sync ==== Download previous stable releases ==== Repo set up information, release notes, and more for previous stable versions of AGL [[agl-distro:release-notes#grumpy_guppy|Grumpy Guppy Releases]] [[agl-distro:release-notes#funky_flounder|Funky Flounder Releases]] [[agl-distro:release-notes#electric_eel|Electric Eel Releases]] [[agl-distro:release-notes#daring_dab|Daring Dab Releases]] [[agl-distro:release-notes#charming_chinook|Charming Chinook Releases]] [[agl-distro:release-notes#brilliant_blowfish|Brilliant Blowfish Releases]] [[agl-distro:release-notes#agile_albacore|Agile Albacore Releases]] ==== Set up Build Environment ==== Set up the development environment for the desired target hardware. AGL has created a set up script for defining the target build and desired optional features. To get a complete list of the options available run. $ source meta-agl/scripts/aglsetup.sh -h Once you run aglsetup.sh with your desired paramaters, you can build any target desired. Some examples follow. ==== Features supported by aglsetup ==== Here is the list of features for AGL that can be specified in the aglsetup.sh command line: * in meta-agl * **agl-devel**: activate development options (empty root password, debugger, strace, valgrind ...) * **agl-netboot**: enable network boot support through TFTP and NBD (see meta-netboot layer) * **agl-appfw-smack**: enables IoT.bzh Application Framework + SMACK + Cynara * **agl-demo**: enable layer meta-agl-demo and meta-qt5 - **required to build agl-demo-platform** * **agl-localdev**: add a local layer named "meta-localdev" in meta directory and a local.dev.inc conf file if present ''CHECK OUT: source meta-agl/scripts/aglsetup.sh -h'' For newer features or to get more details on a given feature, take a look at the configuration files stored for each feature and/or each machine in meta-agl/templates and meta-agl-*/templates. ==== Building the AGL Demo Platform for QEMU ==== To build the QEMU version of the AGL demo start use machine "qemux86-64" and feature "agl-demo" $ source meta-agl/scripts/aglsetup.sh -m qemux86-64 agl-demo agl-netboot $ bitbake agl-demo-platform ==== Building the kernel ==== To get kernel source tree, you have to build kernel once, to do that, you can use these commands, $ bitbake virtual/kernel Then you can find kernel source tree at ls build/tmp/work*/*/linux-yocto/*/linux/ or ls build/tmp/work*/*/linux-*/*/git/ ===== Detailed instructions for building AGL ===== More detailed instructions are maintained in the [[https://gerrit.automotivelinux.org/gerrit/gitweb?p=AGL/meta-agl.git;a=blob_plain;f=README.md;hb=HEAD|README.md]] file located in [[https://git.automotivelinux.org/gerrit/gitweb?p=AGL/meta-agl.git;a=summary|meta-agl repository]]. ===== Developing Kernel Code for AGL ===== Here is a good manual for developing kernel code http://www.yoctoproject.org/docs/current/kernel-dev/kernel-dev.html You can choose from 2 ways to add code to AGL kernel. - Writing a patch and writing recipe to apply it. [[http://www.yoctoproject.org/docs/current/kernel-dev/kernel-dev.html#modifying-an-existing-recipe| See 2.2. Modifying an Existing Recipe]] - Writing recipe to build modules out of tree [[http://www.yoctoproject.org/docs/current/kernel-dev/kernel-dev.html#working-with-out-of-tree-modules | See 2.5. Working with Out-of-Tree Modules]] ===== Building AGL for Other Targets ===== Follow the step by step instructions for building AGL for other supported targets: * [[agl-distro:agl-raspberrypi|Building AGL for Raspberry Pi]] * [[start::building_for_the_renesas_r-car_m2|Building AGL for Renesas Porter]] * [[http://docs.automotivelinux.org/master/docs/getting_started/en/dev/reference/machines/R-Car-Starter-Kit-gen3.html|Building AGL for Renesas Gen3 boards]]