User Tools

Site Tools


agl-distro:source-code

This is an old revision of the document!


Download and Build AGL Source Code

The AGL source code and Yocto layers are maintained on the AGL gerrit server. For information on how to create accounts for gerrit see Getting Started with AGL.

Prepare Repo Tool

AGL Uses the Repo tool for managing repositories. First you need to setup layers of AGL. You can use these commands.

Prepare 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 for the latest stable release, Charming Chinook 3.0.x, as well as release notes and more see the Charming Chinook Release

Download Latest on Chinook 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 chinook -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

Brilliant Blowfish Releases

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 2.0 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)
  • in meta-agl-extra
    • 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
    • agl-sota: enable SOTA components and dependencies (meta-sota, meta-filesystems, meta-ruby, meta-rust are added)

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-extra/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 agl-appfw-smack   
  
  $ 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

  build/tmp/work/qemux86_64-poky-linux/linux-yocto/3.14.19*/linux/

or

  build/tmp/work/porter-poky-linux-gnueabi/linux-renesas/3.10*/git/

Detailed instructions for building AGL

More detailed instructions are maintained in the README.md file located in 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.

  1. Writing a patch and writing recipe to apply it. See 2.2. Modifying an Existing Recipe
  2. Writing recipe to build modules out of tree See 2.5. Working with Out-of-Tree Modules

Troubleshooting

Due to a known bug in the upstream of meta-rust the Yocto/OE recipe for rust-cross may fail while building RVI SOTA Client or another application written in the Rust programming language. Until the complete resolution of the issue the workaround is to disable all use of the CXX11 ABI by applying the following lines to conf/local.conf:

  LD_CXXFLAGS_append = " -D_GLIBCXX_USE_CXX11_ABI=0"
  TARGET_CXXFLAGS_append = " -D_GLIBCXX_USE_CXX11_ABI=0"
  CXXFLAGS_append = " -D_GLIBCXX_USE_CXX11_ABI=0"
  
  BUILD_CXXFLAGS_remove_pn-gcc-runtime = "-D_GLIBCXX_USE_CXX11_ABI=0"
  TARGET_CXXFLAGS_remove_pn-gcc-runtime = "-D_GLIBCXX_USE_CXX11_ABI=0"
  CXXFLAGS_remove_pn-gcc-runtime = "-D_GLIBCXX_USE_CXX11_ABI=0"

Building AGL for Other Targets

Follow the step by step instructions for building AGL for other supported targets:

agl-distro/source-code.1484689600.txt.gz · Last modified: 2017/01/17 21:46 by waltminer