1 ?README-AGL.md: The Automotive Grade Linux Distribution
2 ======================================================
4 AGL is creating an automotive specific Linux distribution (AGL UCB)
5 that unifies the software that has been written in a number of places already,
6 such as GENIVI and Tizen IVI.
8 The layer 'meta-agl' provides a minimal set of software
9 to boot system of AGL Distribution. 'meta-agl' is the minimal
10 core which is used build AGL profiles on top of it.
12 The reference UI is part of 'meta-agl-demo'.
14 Additional components like the security framework are part of 'meta-agl-extra'.
16 The AGL community appreciates feedback, ideas, suggestion, bugs and
17 documentation just as much as code. Please join the irc conversation
18 at the #automotive channel on irc.freenode.net and our mailing list.
20 For infomation for subscribing to the mailing list
21 [automotive-discussions](http://lists.linuxfoundation.org/mailman/listinfo/automotive-discussions)
22 For information about AGL Distribution, see the
23 [AGL Distribution](https://wiki.automotivelinux.org/agl-distro)
24 For information abount Getting started with AGL
25 [here](https://wiki.automotivelinux.org/start/getting-started)
26 For information about contributing to the AGL Distro
27 [here](https://wiki.automotivelinux.org/agl-distro/contributing)
32 The latest version is available at [AGL wiki](https://wiki.automotivelinux.org/agl-distro/source-code) for the following targets:
33 * [QEMU](https://wiki.automotivelinux.org/agl-distro/source-code)
34 * [Renesas Porter board](https://wiki.automotivelinux.org/start/building_for_the_renesas_r-car_m2)
35 * [Raspberry Pi 2/3](https://wiki.automotivelinux.org/agl-distro/agl-raspberrypi)
37 To build an image from 'meta-agl'
41 > $ export PATH=~/bin:$PATH
42 > $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
43 > $ chmod a+x ~/bin/repo
46 > $ repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
49 3. Check available targets and extensions, select target machine:
50 > $ source meta-agl/scripts/aglsetup.sh -h
51 > $ source meta-agl/scripts/aglsetup.sh -m porter
53 4. Build agl-image-ivi
54 > $ bitbake agl-image-ivi
56 To build the agl-demo-platform (as demo'ed @ALS) replace 3. and 4. with:
57 3. Check available targets and extensions, select target machine:
58 > $ source meta-agl/scripts/aglsetup.sh -h
59 > $ source meta-agl/scripts/aglsetup.sh -m porter agl-demo [agl-appfw-smack] [agl-devel] [agl-netboot]
61 4. Build agl-demo-platform
62 > $ bitbake agl-demo-platform
63 Note: this uses more layers and not only meta-agl
65 AGL Layers and dependencies:
66 ----------------------------
67 Check the README.md of the respective layers:
68 - meta-agl (= core, no UI)
69 - meta-agl-demo (= reference UI)
70 - meta-agl-extra (= extra components)
72 In addition, the reference hardware (Renesas R-Car Gen2 / porter) has this dependency:
74 URI: https://gerrit.automotivelinux.org/gerrit/AGL/meta-renesas
75 > branch: agl-1.0-bsp-1.8.0
76 > tested revision: 82611ccadef36ab0b8a6fd6fb1cf055e115f1ef5
84 * QEMU (x86-64) - emulated machine: qemux86-64
85 * Renesas R-Car Gen2 (R-Car M2) - machine: porter
87 Community contributed hardware:
89 * See: https://wiki.automotivelinux.org/agl-distro#supported_hardware
92 Supported Target of bitbake
93 ---------------------------
97 * `agl-image-ivi` The baseline image of AGL Distributions (console only)
99 * `agl-image-minimal` For internal use to develop distribution (experimental)
100 * `agl-image-weston` For internal use to develop distribution (experimental)
104 * `agl-demo-platform` The demo/reference image (with graphical UI)
106 Run this command for a full list of machines, features and targets:
107 > $ source ./meta-agl/scripts/aglsetup.sh -h
110 Supposed Directory Tree of Layers to build
111 -------------------------------------------
113 > $ repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
123 |-- meta-fsl-arm-extra
125 |-- meta-intel-iot-security
126 |-- meta-openembedded
132 |-- meta-security-isafw
135 18 directories, 0 files
141 You can build a QEMU image using the following steps:
143 (latest version here: https://wiki.automotivelinux.org/agl-distro/source-code)
144 To build an image from 'meta-agl'
148 > $ export PATH=~/bin:$PATH
149 > $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
150 > $ chmod a+x ~/bin/repo
153 > $ repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
156 3. Check available targets and extensions, select target machine:
157 > $ source meta-agl/scripts/aglsetup.sh -h
158 > $ source meta-agl/scripts/aglsetup.sh -m qemux86-64
160 Alternatively, to enable the reference UI feature ('agl-demo'):
161 > $ source meta-agl/scripts/aglsetup.sh -m qemux86-64 agl-demo
163 Alternatively, to also enable also the security framework ('agl-appfw-smack'):
164 > $ source meta-agl/scripts/aglsetup.sh -m qemux86-64 agl-demo agl agl-appfw-smack
166 Alternatively, to also enable debugging tools ('agl-devel') and the network-boot (nbd) capabilities ('agl-netboot'):
167 > $ source meta-agl/scripts/aglsetup.sh -m qemux86-64 agl-demo agl agl-appfw-smack agl-devel agl-netboot
169 4. Build agl-image-ivi
170 > $ bitbake agl-image-ivi
172 or alternatively, if you enabled the 'agl-demo' feature:
173 > $ bitbake agl-demo-platform
175 - If you want to run QEMU directly as VM in Virtual Box or your other favorite VM software then add this line to your "conf/local.conf" file.
176 > IMAGE_FSTYPES += "vmdk"
178 5. Run in the emulator
179 > $ runqemu agl-image-ivi qemux86-64
181 > $ runqemu agl-demo-platform qemux86-64
184 > $ runqemu agl-image-ivi qemux86-64 bootparams="uvesafb.mode_option=1280x720-32"
186 To extend the amount of memory, add to runqemu:
188 > $ runqemu agl-image-ivi qemux86-64 qemuparame="-m 512" bootparams="uvesafb.mode_option=1280x720-32"
191 To separate console from VGA screen (to avoid corrupt screen while booting),
194 > $ runqemu agl-image-ivi qemux86-64 bootparams="uvesafb.mode_option=1280x720-32" serial
196 **Or use the virtual disk in Virtual Box from this location:**
197 > tmp/deploy/images/qemux86-64/agl-demo-platform-qemux86-64.vmdk
199 6. Some weston samples are available from weston terminal (click top left icon).
200 Check the folder `/opt/AGL/ALS2016`.
202 Build a R-Car M2 (porter) image
203 -------------------------------
207 NOTE: You will need to download the matching binary driver package from renesas.
208 As of this writing, the version from 20151228.
209 The main URL to retrieve these is:
211 - https://www.renesas.com/en-eu/solutions/automotive/rcar-demoboard.html
213 As of this writing, the necessary libary and driver packages linked to
215 - The subpage for the library is:
216 - https://www.renesas.com/en-eu/software/D3017410.html (registration/login required)
218 - The sub-page for the driver is:
219 - https://www.renesas.com/en-eu/media/secret/solutions/automotive/rcar-demoboard/R-Car_Series_Evaluation_Software_Package_of_Linux_Drivers-20151228.zip
221 !!! The files need to be in `${HOME}/Downloads` ( `$XDG_DOWNLOAD_DIR` ) !!!
223 #### Getting Source Code and Build image
225 (latest version here: https://wiki.automotivelinux.org/agl-distro/source-code)
226 To build an image from 'meta-agl' only:
230 > $ export PATH=~/bin:$PATH
231 > $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
232 > $ chmod a+x ~/bin/repo
235 > $ repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
238 3. Check available targets and extensions, select target machine:
239 > $ source meta-agl/scripts/aglsetup.sh -h
240 > $ source meta-agl/scripts/aglsetup.sh -m porter
242 Alternatively, to enable the reference UI:
243 > $ source meta-agl/scripts/aglsetup.sh -m porter agl-demo
245 Alternatively, to also enable also the security framework:
246 > $ source meta-agl/scripts/aglsetup.sh -m porter agl-demo agl agl-appfw-smack
248 Alternatively, to also enable debugging tools and the network-boot (nbd) capabilities:
249 > $ source meta-agl/scripts/aglsetup.sh -m porter agl-demo agl agl-appfw-smack agl-devel agl-netboot
251 4. (optional) edit conf/local.conf )* see below
252 > $ vi conf/local.conf
254 5. Build agl-image-ivi
255 > $ bitbake agl-image-ivi
257 or alternatively, if you enabled the 'agl-demo' feature:
258 > $ bitbake agl-demo-platform
263 4 . Optional edits to conf/local.conf
265 * If you want to use multimedia accelerations, uncomment
266 manually 4 `IMAGE_INSTALL_append_porter` in conf/local.conf.
268 > #IMAGE_INSTALL_append_porter = " \
269 > # gstreamer1.0-plugins-bad-waylandsink \
271 > #IMAGE_INSTALL_append_porter = " \
272 > # gstreamer1.0-plugins-base-videorate \
275 > #IMAGE_INSTALL_append_porter = " \
276 > # libegl libegl-dev libgbm-dev \
279 > #IMAGE_INSTALL_append_porter = " \
280 > # packagegroup-rcar-gen2-multimedia \
284 * Also it is needed to uncomment this:
285 > #MACHINE_FEATURES_append = " multimedia"
287 This `multimedia` MACHINE_FEATURES enables the meta-renesas's specific multimedia configuration.
288 The version of GStreamer1.0 which AGL distro will use is changed
289 to 1.2.3 (meta-renesas prefers it) over 1.4.1 (meta-agl default)
292 * If you want to install various Qt5 examples, add below
293 configuration to your local.conf.
294 > IMAGE_INSTALL_append = " \
295 > packagegroup-agl-demo-qt-examples \
297 > PACKAGECONFIG_append_pn-qtbase = " examples"
300 > To run examples with wayland-egl plugin,
301 > use ``LD_PRELOAD=/usr/lib/libEGL.so <command>``.
302 > If not, programs should not launch by error,
303 > 'EGL not available'.
306 ### Deployment (SDCARD)
308 #### Instructions on the host
310 1. Format SD-Card and then, create single EXT4 partition on it.
312 2. Mount the SD-Card, for example `/media/$SDCARD_LABEL`.
314 3. Copy AGL root file system onto the SD-Card
315 1. Go to build directory
316 > $ cd $AGL_TOP/build/tmp/deploy/images/porter
318 2. Extract the root file system into the SD-Card
319 > $ sudo tar --extract --numeric-owner --preserve-permissions --preserve-order \
320 > --totals --directory=/media/$SDCARD_LABEL --file=agl-image-ivi-porter.tar.bz2
322 3. Copy kernel and DTB into the `/boot` of the SD-Card
323 > $ sudo cp uImage uImage-r8a7791-porter.dtb /media/$SDCARD_LABEL/boot
325 4. After the copy finished, unmount SD-Card and insert it into the SD-Card slot of the porter board.
327 #### Instructions on the target
329 NOTE: There is details about porter board [here](http://elinux.org/R-Car/Boards/Porter).
331 NOTE: To boot weston on porter board, we need keyboard and mouse. (USB2.0 can be use for this)
333 ##### Change U-Boot parameters to boot from SD card
335 1. Power up the board and, using your preferred terminal emulator, stop the board's autoboot by hitting any key.
337 ``Debug serial settings are 38400 8N1. Any standard terminal emulator program can be used.**
339 2. Set the follow environment variables and save them
340 > => setenv bootargs_console console=ttySC6,${baudrate}
341 > => setenv bootargs_video vmalloc=384M video=HDMI-A-1:1024x768-32@60
342 > => setenv bootcmd_sd 'ext4load mmc 0:1 0x40007fc0 boot/uImage;ext4load mmc 0:1 0x40f00000 boot/uImage-r8a7791-porter.dtb'
343 > => setenv bootcmd 'setenv bootargs ${bootargs_console} ${bootargs_video} root=/dev/mmcblk0p1 rw rootfstype=ext4;run bootcmd_sd;bootm 0x40007fc0 - 0x40f00000'
346 ##### Boot from SD card
348 1. After board reset, U-Boot is started and after a countdown, ...
349 Linux boot message should be displayed. Please wait a moment.
351 2. Then weston is booted automatically, and weston-terminal appears.
355 ### Deployment (TFTP/NFS)
357 NOTE: These instructions are based on Embedded Linux Wiki, [here](http://www.elinux.org/R-Car/Boards/Yocto#Loading_kernel_via_TFTP_and_rootfs_via_NFS). And a Debian (wheezy, ip: 192.168.30.70) is used as the host for this instructions.
359 #### Instructions on the host
360 1. Setup a TFTP server
361 1. Install necessary packages
362 > $ sudo apt-get install tftp tftpd-hpa
364 2. Go to build directory, and copy kernel and DTB into TFTP server root (default server dir: /srv/tftp)
365 > $cd $AGL_TOP/build/tmp/deploy/images/porter
366 > $ sudo cp uImage uImage-r8a7791-porter.dtb /srv/tftp
368 3. Verify TFTP server is working
370 ls: cannot access uImage: No such file or directory
373 > $ tftp 192.168.30.70
375 > Received 3583604 bytes in 0.2 seconds
381 1. Install necessary packages
382 > $ sudo apt-get install nfs-kernel-server nfs-common
384 2. Go to build directory, and extract the root file system into a dedicated directory (here we use /nfs/porter)
385 > $ cd $AGL_TOP/build/tmp/deploy/images/porter
386 > $ sudo mkdir -p /nfs/porter
387 > $ sudo tar --extract --numeric-owner --preserve-permissions --preserve-order \
388 > --totals --directory=/nfs/porter --file=agl-demo-platform-porter.tar.bz2
391 > $ sudo vi /etc/exports
394 > /nfs/porter *(rw,no_subtree_check,sync,no_root_squash,no_all_squash)
396 Save the file and exit.
398 4. Restart nfs service
399 > $ sudo service nfs-kernel-server restart
401 5. Verify NFS server is working
402 > $ sudo mount -t nfs 192.168.30.70:/nfs/porter /tmp/
404 > bin boot dev etc home lib media mnt proc run sbin sys tmp usr var
406 #### Instructions on the target board
408 NOTE: There is details about porter board [here](http://elinux.org/R-Car/Boards/Porter).
410 NOTE: To boot weston on porter board, we need keyboard and mouse. (USB2.0 can be use for this)
412 ##### Change U-Boot parameters to boot from TFTP/NFS
414 1. Power up the board and, using your preferred terminal emulator, stop the board's autoboot by hitting any key.
416 > Debug serial settings are 38400 8N1. Any standard terminal emulator program can be used.
418 2. Set the follow environment variables and save them
419 > => setenv ipaddr <board-ip>
420 > => setenv serverip <host-ip>
421 > => setenv bootargs_console console=ttySC6,${baudrate}
422 > => setenv bootargs_video vmalloc=384M video=HDMI-A-1:1024x768-32@60
423 > => setenv bootcmd_net 'tftp 0x40007fc0 uImage; tftp 0x40f00000 uImage-r8a7791-porter.dtb'
424 > => setenv bootcmd 'setenv bootargs ${bootargs_console} ${bootargs_video} ip=${ipaddr} root=/dev/nfs nfsroot=${serverip}:/nfs/porter,vers=3;run bootcmd_net;bootm 0x40007fc0 - 0x40f00000'
427 Replace <board-ip> with a proper IP address for the board, like 192.168.30.60.
428 Replace <host-ip> with the IP address of the host, here we use 192.168.30.70.
430 ##### Boot from TFTP/NFS
432 1. After board reset, U-Boot is started and after a countdown, ...
433 Linux boot message should be displayed. Please wait a moment.
434 2. Then weston is booted automatically, and weston-terminal appears.