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=ext3;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 4. (Optional) This is how to test and play multimedia contents with acceleration.
357 1. Boot porter without mouse and keyboard, it avoid to boot weston automatically.
358 For now, when running weston, V4L2 deosn't work correctly, so we have to
359 stop weston first (GST plugin `waylandsink` also doesn't work correctly for now).
361 2. Execute these instructions
364 > $ export LD_LIBRARY_PATH="/lib:/usr/lib:/usr/local/lib:"^
367 > $ amixer set "LINEOUT Mixer DACL" on
368 > $ amixer set "DVC Out" 10
370 > $ modprobe -a mmngr mmngrbuf s3ctl uvcs_cmn vspm fdpm
372 > $ media-ctl -d /dev/media0 -r
373 > $ media-ctl -d /dev/media0 -l '"vsp1.2 rpf.0":1 -> "vsp1.2 uds.0":0 [1]'
374 > $ media-ctl -d /dev/media0 -l '"vsp1.2 uds.0":1 -> "vsp1.2 wpf.0":0 [1]'
375 > $ media-ctl -d /dev/media0 -l '"vsp1.2 wpf.0":1 -> "vsp1.2 lif":0 [1]'
376 > $ media-ctl -d /dev/media0 -V '"vsp1.2 rpf.0":0 [fmt:AYUV32/1920x1080]'
377 > $ media-ctl -d /dev/media0 -V '"vsp1.2 rpf.0":1 [fmt:AYUV32/1920x1080]'
378 > $ media-ctl -d /dev/media0 -V '"vsp1.2 uds.0":0 [fmt:AYUV32/1920x1080]'
379 > $ media-ctl -d /dev/media0 -V '"vsp1.2 uds.0":1 [fmt:AYUV32/640x480]'
380 > $ media-ctl -d /dev/media0 -V '"vsp1.2 wpf.0":0 [fmt:AYUV32/640x480]'
381 > $ media-ctl -d /dev/media0 -V '"vsp1.2 wpf.0":1 [fmt:ARGB32/640x480]'
382 > $ media-ctl -d /dev/media0 -V '"vsp1.2 lif":0 [fmt:ARGB32/640x480]'
384 > # in case R-Car M2 (HDMI - DU1 - vspd0)
385 > $ modetest -M rcar-du -s 10@8:1280x720@AR24 -d -P '8@19:640x480+100+200@XR24' &
387 After these command, Test pattern will show on display connected to porter's HDMI port.
389 Then, you can play H264(MP4) movie like this:
391 > $ gst-launch-1.0 filesrc location=./sample.mp4 ! qtdemux name=d d. ! \
392 > queue ! omxh264dec no-copy=true ! v4l2sink device=/dev/video1 \
393 > io-mode=userptr d. ! queue ! faad ! alsasink device=hw:0,0
396 ### Deployment (TFTP/NFS)
398 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.
400 #### Instructions on the host
401 1. Setup a TFTP server
402 1. Install necessary packages
403 > $ sudo apt-get install tftp tftpd-hpa
405 2. Go to build directory, and copy kernel and DTB into TFTP server root (default server dir: /srv/tftp)
406 > $cd $AGL_TOP/build/tmp/deploy/images/porter
407 > $ sudo cp uImage uImage-r8a7791-porter.dtb /srv/tftp
409 3. Verify TFTP server is working
411 ls: cannot access uImage: No such file or directory
414 > $ tftp 192.168.30.70
416 > Received 3583604 bytes in 0.2 seconds
422 1. Install necessary packages
423 > $ sudo apt-get install nfs-kernel-server nfs-common
425 2. Go to build directory, and extract the root file system into a dedicated directory (here we use /nfs/porter)
426 > $ cd $AGL_TOP/build/tmp/deploy/images/porter
427 > $ sudo mkdir -p /nfs/porter
428 > $ sudo tar --extract --numeric-owner --preserve-permissions --preserve-order \
429 > --totals --directory=/nfs/porter --file=agl-demo-platform-porter.tar.bz2
432 > $ sudo vi /etc/exports
435 > /nfs/porter *(rw,no_subtree_check,sync,no_root_squash,no_all_squash)
437 Save the file and exit.
439 4. Restart nfs service
440 > $ sudo service nfs-kernel-server restart
442 5. Verify NFS server is working
443 > $ sudo mount -t nfs 192.168.30.70:/nfs/porter /tmp/
445 > bin boot dev etc home lib media mnt proc run sbin sys tmp usr var
447 #### Instructions on the target board
449 NOTE: There is details about porter board [here](http://elinux.org/R-Car/Boards/Porter).
451 NOTE: To boot weston on porter board, we need keyboard and mouse. (USB2.0 can be use for this)
453 ##### Change U-Boot parameters to boot from TFTP/NFS
455 1. Power up the board and, using your preferred terminal emulator, stop the board's autoboot by hitting any key.
457 > Debug serial settings are 38400 8N1. Any standard terminal emulator program can be used.
459 2. Set the follow environment variables and save them
460 > => setenv ipaddr <board-ip>
461 > => setenv serverip <host-ip>
462 > => setenv bootargs_console console=ttySC6,${baudrate}
463 > => setenv bootargs_video vmalloc=384M video=HDMI-A-1:1024x768-32@60
464 > => setenv bootcmd_net 'tftp 0x40007fc0 uImage; tftp 0x40f00000 uImage-r8a7791-porter.dtb'
465 > => 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'
468 Replace <board-ip> with a proper IP address for the board, like 192.168.30.60.
469 Replace <host-ip> with the IP address of the host, here we use 192.168.30.70.
471 ##### Boot from TFTP/NFS
473 1. After board reset, U-Boot is started and after a countdown, ...
474 Linux boot message should be displayed. Please wait a moment.
475 2. Then weston is booted automatically, and weston-terminal appears.