AGL has been initially ported to Raspberry Pi 2 and 3 by Leon Anavi thanks to the existing knowledge for enabling hardware graphics acceleration in Wayland and Weston from the Tizen Project and GENIVI Development Platform.
Follow the general steps for building AGL, download master branch and set raspberrypi2 or raspberrypi3 as a machine depending on the version and the model of your Raspberry Pi.
The standard Yocto process is made of the following steps:
For convenience, the resulting development images are made available Here
If you want to bypass the build phase and quick boot the board, you can download the image tarball and the kernel then follow the installation procedure.
The very first step is to ensure that your system can run the build system of the Yocto Project.
Important: it only runs on Linux
For AGL 2.1, Yocto Project 2.1, known as krogoth, has been selected for the BSP and build system.
Reference data for configuring your system can be found in the Yocto documentation Here
Here after an extract of this documentation for most common Linux distributions:
The essential and graphical support packages you need for a supported Ubuntu or Debian distribution are shown in the following command:
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \ build-essential chrpath socat libsdl1.2-dev xterm cpio curl
The essential and graphical packages you need for a supported Fedora distribution are shown in the following command:
sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \ diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \ ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue socat \ SDL-devel xterm curl
The essential and graphical packages you need for a supported OpenSUSE distribution are shown in the following command:
sudo zypper install python gcc gcc-c++ git chrpath make wget python-xml \ diffstat texinfo python-curses patch socat libSDL-devel xterm curl
The essential and graphical packages you need for a supported CentOS distribution are shown in the following command:
sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \ diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \ socat SDL-devel xterm curl
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.
In the following, your top level directory is noted as “AGL_TOP”.
For example, we will set AGL_TOP to point to a directory “$HOME/workspace_agl”:
export AGL_TOP=$HOME/workspace_agl mkdir -p $AGL_TOP
AGL Uses the 'repo' tool for managing repositories.
You need to setup layers of AGL.
You can use the commands below to prepare Repo:
mkdir -p ~/bin export PATH=~/bin:$PATH curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo chmod a+x ~/bin/repo
You can choose your source release
To download all layers for the for the latest stable release, Chinook 3.0.3:
cd $AGL_TOP repo init -b chinook -m chinook_3.0.3.xml -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo repo sync
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:
cd $AGL_TOP repo init -b chinook -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo repo sync
To download all code from master:
cd $AGL_TOP repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo repo sync
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.
cd $AGL_TOP source meta-agl/scripts/aglsetup.sh -h
Once you run aglsetup.sh with your desired parameters, you can build any target desired.
Here is the list of features for AGL 2.1 that can be specified in the aglsetup.sh command line:
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.
To build AGL demo platform for Raspberry Pi 3 use machine raspberrypi3 and feature agl-demo:
source meta-agl/scripts/aglsetup.sh -m raspberrypi3 agl-demo agl-netboot agl-appfw-smack bitbake agl-demo-platform
To build AGL demo platform for Raspberry Pi 2 use machine raspberrypi2 and feature agl-demo:
source meta-agl/scripts/aglsetup.sh -m raspberrypi2 agl-demo agl-netboot agl-appfw-smack bitbake agl-demo-platform
Follow the steps below to copy the image to microSD card and to boot it on Raspberry Pi 2 or 3:
Note: the sdimage files can also be named rpi-sdimg-ota in case you have the “agl-sota” feature enabled
sudo umount [sdcard device] sudo dd if=[output image] of=[sdcard device] bs=4M sync
IMPORTANT, The extended attribute set during image construction MUST be copied to the SD card.
When using tar to create the SDcard, it is a common error to not copy the extended attributes. Find below instruction for using tar.
Verify that tar version is 1.28 or newer:
tar --version tar (GNU tar) 1.28 [snip]
If it is not the case, a native up-to-date version of tar is also generated while building AGL distribution:
tmp/sysroots/x86_64-linux/usr/bin/tar-native/tar --version tar (GNU tar) 1.28 [snip]
To copy Automotive Grade Linux (AGL) files AND EXTENDED ATRIBUTES onto the SDcard using tar the command is:
tar --extract --numeric-owner --preserve-permissions --preserve-order --totals \ --xattrs-include='*' --directory=DESTINATION_DIRECTORY --file=agl-demo-platform.....tar.bz2
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"
Problem: new installed applications are not available on Homescreen and even if started manually through afm-util, the application starts but no surface appears.
Answer: this is due to IVI-Shell integration with Qt and Homescreen.
To disable IVI-Shell and revert to the “plain old” weston desktop, you can follow the 4 steps below:
[core] backend=drm-backend.so #shell=ivi-shell.so ...
... #Environment=QT_WAYLAND_SHELL_INTEGRATION=ivi-shell ...
# systemctl disable HomeScreenAppFrameworkBinderAGL.service # systemctl disable HomeScreen.service # systemctl disable InputEventManager.service # systemctl disable WindowManager.service
Append to following lines to conf/local.conf to include libomxil under a commercial license to your build:
# For libomxil LICENSE_FLAGS_WHITELIST = "commercial" IMAGE_INSTALL_append = " libomxil"
If you have Raspberry Pi official 7“ touchscreen connected, you can rotate it with these lines in /etc/xdg/weston/weston.ini
root@raspberrypi3:/etc/xdg/weston# cat weston.ini [core] backend=drm-backend.so shell=desktop-shell.so [shell] locking=true # Uncomment below to hide panel #panel-location=none [launcher] icon=/usr/share/weston/terminal.png path=/usr/bin/weston-terminal [launcher] icon=/usr/share/weston/icon_flower.png path=/usr/bin/weston-flower [output] name=DSI-1 transform=270
It is possible to debug AGL images on Raspberry Pi using 3.3V USB to serial cable, such as Olimex USB-Serial-Cable-F, connected to the UART of the board. Follow the instructions below to connect a cable to the board (do it on your own risk, no warranty is provided):
sudo screen /dev/ttyUSB0 115200
Pay attention that the colors of the cable may vary depending on the vendor. If you have USB console cable from Adafruit please have a look here.