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)
31 (latest version here: https://wiki.automotivelinux.org/agl-distro/source-code)
32 To build an image from 'meta-agl'
36 > $ export PATH=~/bin:$PATH
37 > $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
38 > $ chmod a+x ~/bin/repo
41 > $ repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
44 3. Check available targets and extensions, select target machine:
45 > $ source meta-agl/scripts/aglsetup.sh -h
46 > $ source meta-agl/scripts/aglsetup.sh -m porter
48 4. Build agl-image-ivi
49 > $ bitbake agl-image-ivi
51 To build the agl-demo-platform (as demo'ed @ALS) replace 3. and 4. with:
52 3. Check available targets and extensions, select target machine:
53 > $ source meta-agl/scripts/aglsetup.sh -h
54 > $ source meta-agl/scripts/aglsetup.sh -m porter agl-demo [agl-appfw-smack] [agl-devel] [agl-netboot]
56 4. Build agl-demo-platform
57 > $ bitbake agl-demo-platform
58 Note: this uses more layers and not only meta-agl
60 AGL Layers and dependencies:
61 ----------------------------
62 Check the README.md of the respective layers:
63 - meta-agl (= core, no UI)
64 - meta-agl-demo (= reference UI)
65 - meta-agl-extra (= extra components)
67 In addition, the reference hardware (Renesas R-Car Gen2 / porter) has this dependency:
69 URI: https://gerrit.automotivelinux.org/gerrit/AGL/meta-renesas
70 > branch: agl-1.0-bsp-1.8.0
71 > tested revision: 82611ccadef36ab0b8a6fd6fb1cf055e115f1ef5
79 * QEMU (x86-64) - emulated machine: qemux86-64
80 * Renesas R-Car Gen2 (R-Car M2) - machine: porter
82 Community contributed hardware:
84 * See: https://wiki.automotivelinux.org/agl-distro#supported_hardware
87 Supported Target of bitbake
88 ---------------------------
92 * `agl-image-ivi` The baseline image of AGL Distributions (console only)
94 * `agl-image-minimal` For internal use to develop distribution (experimental)
95 * `agl-image-weston` For internal use to develop distribution (experimental)
99 * `agl-demo-platform` The demo/reference image (with graphical UI)
101 Run this command for a full list of machines, features and targets:
102 > $ source ./meta-agl/scripts/aglsetup.sh -h
105 Supposed Directory Tree of Layers to build
106 -------------------------------------------
108 > $ repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
118 |-- meta-fsl-arm-extra
120 |-- meta-intel-iot-security
121 |-- meta-openembedded
127 |-- meta-security-isafw
130 18 directories, 0 files
136 You can build a QEMU image using the following steps:
138 (latest version here: https://wiki.automotivelinux.org/agl-distro/source-code)
139 To build an image from 'meta-agl'
143 > $ export PATH=~/bin:$PATH
144 > $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
145 > $ chmod a+x ~/bin/repo
148 > $ repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
151 3. Check available targets and extensions, select target machine:
152 > $ source meta-agl/scripts/aglsetup.sh -h
153 > $ source meta-agl/scripts/aglsetup.sh -m qemux86-64
155 Alternatively, to enable the reference UI feature ('agl-demo'):
156 > $ source meta-agl/scripts/aglsetup.sh -m qemux86-64 agl-demo
158 Alternatively, to also enable also the security framework ('agl-appfw-smack'):
159 > $ source meta-agl/scripts/aglsetup.sh -m qemux86-64 agl-demo agl agl-appfw-smack
161 Alternatively, to also enable debugging tools ('agl-devel') and the network-boot (nbd) capabilities ('agl-netboot'):
162 > $ source meta-agl/scripts/aglsetup.sh -m qemux86-64 agl-demo agl agl-appfw-smack agl-devel agl-netboot
164 4. Build agl-image-ivi
165 > $ bitbake agl-image-ivi
167 or alternatively, if you enabled the 'agl-demo' feature:
168 > $ bitbake agl-demo-platform
170 - 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.
171 > IMAGE_FSTYPES += "vmdk"
173 5. Run in the emulator
174 > $ runqemu agl-image-ivi qemux86-64
176 > $ runqemu agl-demo-platform qemux86-64
179 > $ runqemu agl-image-ivi qemux86-64 bootparams="uvesafb.mode_option=1280x720-32"
181 To extend the amount of memory, add to runqemu:
183 > $ runqemu agl-image-ivi qemux86-64 qemuparame="-m 512" bootparams="uvesafb.mode_option=1280x720-32"
186 To separate console from VGA screen (to avoid corrupt screen while booting),
189 > $ runqemu agl-image-ivi qemux86-64 bootparams="uvesafb.mode_option=1280x720-32" serial
191 **Or use the virtual disk in Virtual Box from this location:**
192 > tmp/deploy/images/qemux86-64/agl-demo-platform-qemux86-64.vmdk
194 6. Some weston samples are available from weston terminal (click top left icon).
195 Check the folder `/opt/AGL/ALS2016`.
197 Build a R-Car M2 (porter) image
198 -------------------------------
202 NOTE: You will need to download the matching binary driver package from renesas.
203 As of this writing, the version from 20151228.
204 The main URL to retrieve these is:
206 - https://www.renesas.com/en-eu/solutions/automotive/rcar-demoboard.html
208 As of this writing, the necessary libary and driver packages linked to
210 - The subpage for the library is:
211 - https://www.renesas.com/en-eu/software/D3017410.html (registration/login required)
213 - The sub-page for the driver is:
214 - https://www.renesas.com/en-eu/media/secret/solutions/automotive/rcar-demoboard/R-Car_Series_Evaluation_Software_Package_of_Linux_Drivers-20151228.zip
216 !!! The files need to be in `${HOME}/Downloads` ( `$XDG_DOWNLOAD_DIR` ) !!!
218 #### Getting Source Code and Build image
220 (latest version here: https://wiki.automotivelinux.org/agl-distro/source-code)
221 To build an image from 'meta-agl' only:
225 > $ export PATH=~/bin:$PATH
226 > $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
227 > $ chmod a+x ~/bin/repo
230 > $ repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
233 3. Check available targets and extensions, select target machine:
234 > $ source meta-agl/scripts/aglsetup.sh -h
235 > $ source meta-agl/scripts/aglsetup.sh -m porter
237 Alternatively, to enable the reference UI:
238 > $ source meta-agl/scripts/aglsetup.sh -m porter agl-demo
240 Alternatively, to also enable also the security framework:
241 > $ source meta-agl/scripts/aglsetup.sh -m porter agl-demo agl agl-appfw-smack
243 Alternatively, to also enable debugging tools and the network-boot (nbd) capabilities:
244 > $ source meta-agl/scripts/aglsetup.sh -m porter agl-demo agl agl-appfw-smack agl-devel agl-netboot
246 4. (optional) edit conf/local.conf )* see below
247 > $ vi conf/local.conf
249 5. Build agl-image-ivi
250 > $ bitbake agl-image-ivi
252 or alternatively, if you enabled the 'agl-demo' feature:
253 > $ bitbake agl-demo-platform
258 4 . Optional edits to conf/local.conf
260 * If you want to use multimedia accelerations, uncomment
261 manually 4 `IMAGE_INSTALL_append_porter` in conf/local.conf.
263 > #IMAGE_INSTALL_append_porter = " \
264 > # gstreamer1.0-plugins-bad-waylandsink \
266 > #IMAGE_INSTALL_append_porter = " \
267 > # gstreamer1.0-plugins-base-videorate \
270 > #IMAGE_INSTALL_append_porter = " \
271 > # libegl libegl-dev libgbm-dev \
274 > #IMAGE_INSTALL_append_porter = " \
275 > # packagegroup-rcar-gen2-multimedia \
279 * Also it is needed to uncomment this:
280 > #MACHINE_FEATURES_append = " multimedia"
282 This `multimedia` MACHINE_FEATURES enables the meta-renesas's specific multimedia configuration.
283 The version of GStreamer1.0 which AGL distro will use is changed
284 to 1.2.3 (meta-renesas prefers it) over 1.4.1 (meta-agl default)
287 * If you want to install various Qt5 examples, add below
288 configuration to your local.conf.
289 > IMAGE_INSTALL_append = " \
290 > packagegroup-agl-demo-qt-examples \
292 > PACKAGECONFIG_append_pn-qtbase = " examples"
295 > To run examples with wayland-egl plugin,
296 > use ``LD_PRELOAD=/usr/lib/libEGL.so <command>``.
297 > If not, programs should not launch by error,
298 > 'EGL not available'.
301 ### Deployment (SDCARD)
303 #### Instructions on the host
305 1. Format SD-Card and then, create single EXT4 partition on it.
307 2. Mount the SD-Card, for example `/media/$SDCARD_LABEL`.
309 3. Copy AGL root file system onto the SD-Card
310 1. Go to build directory
311 > $ cd $AGL_TOP/build/tmp/deploy/images/porter
313 2. Extract the root file system into the SD-Card
314 > $ sudo tar --extract --numeric-owner --preserve-permissions --preserve-order \
315 > --totals --directory=/media/$SDCARD_LABEL --file=agl-image-ivi-porter.tar.bz2
317 3. Copy kernel and DTB into the `/boot` of the SD-Card
318 > $ sudo cp uImage uImage-r8a7791-porter.dtb /media/$SDCARD_LABEL/boot
320 4. After the copy finished, unmount SD-Card and insert it into the SD-Card slot of the porter board.
322 #### Instructions on the target
324 NOTE: There is details about porter board [here](http://elinux.org/R-Car/Boards/Porter).
326 NOTE: To boot weston on porter board, we need keyboard and mouse. (USB2.0 can be use for this)
328 ##### Change U-Boot parameters to boot from SD card
330 1. Power up the board and, using your preferred terminal emulator, stop the board's autoboot by hitting any key.
332 ``Debug serial settings are 38400 8N1. Any standard terminal emulator program can be used.**
334 2. Set the follow environment variables and save them
335 > => setenv bootargs_console console=ttySC6,${baudrate}
336 > => setenv bootargs_video vmalloc=384M video=HDMI-A-1:1024x768-32@60
337 > => setenv bootcmd_sd 'ext4load mmc 0:1 0x40007fc0 boot/uImage;ext4load mmc 0:1 0x40f00000 boot/uImage-r8a7791-porter.dtb'
338 > => setenv bootcmd 'setenv bootargs ${bootargs_console} ${bootargs_video} root=/dev/mmcblk0p1 rw rootfstype=ext3;run bootcmd_sd;bootm 0x40007fc0 - 0x40f00000'
341 ##### Boot from SD card
343 1. After board reset, U-Boot is started and after a countdown, ...
344 Linux boot message should be displayed. Please wait a moment.
346 2. Then weston is booted automatically, and weston-terminal appears.
350 4. (Optional) This is how to test and play multimedia contents with acceleration.
352 1. Boot porter without mouse and keyboard, it avoid to boot weston automatically.
353 For now, when running weston, V4L2 deosn't work correctly, so we have to
354 stop weston first (GST plugin `waylandsink` also doesn't work correctly for now).
356 2. Execute these instructions
359 > $ export LD_LIBRARY_PATH="/lib:/usr/lib:/usr/local/lib:"^
362 > $ amixer set "LINEOUT Mixer DACL" on
363 > $ amixer set "DVC Out" 10
365 > $ modprobe -a mmngr mmngrbuf s3ctl uvcs_cmn vspm fdpm
367 > $ media-ctl -d /dev/media0 -r
368 > $ media-ctl -d /dev/media0 -l '"vsp1.2 rpf.0":1 -> "vsp1.2 uds.0":0 [1]'
369 > $ media-ctl -d /dev/media0 -l '"vsp1.2 uds.0":1 -> "vsp1.2 wpf.0":0 [1]'
370 > $ media-ctl -d /dev/media0 -l '"vsp1.2 wpf.0":1 -> "vsp1.2 lif":0 [1]'
371 > $ media-ctl -d /dev/media0 -V '"vsp1.2 rpf.0":0 [fmt:AYUV32/1920x1080]'
372 > $ media-ctl -d /dev/media0 -V '"vsp1.2 rpf.0":1 [fmt:AYUV32/1920x1080]'
373 > $ media-ctl -d /dev/media0 -V '"vsp1.2 uds.0":0 [fmt:AYUV32/1920x1080]'
374 > $ media-ctl -d /dev/media0 -V '"vsp1.2 uds.0":1 [fmt:AYUV32/640x480]'
375 > $ media-ctl -d /dev/media0 -V '"vsp1.2 wpf.0":0 [fmt:AYUV32/640x480]'
376 > $ media-ctl -d /dev/media0 -V '"vsp1.2 wpf.0":1 [fmt:ARGB32/640x480]'
377 > $ media-ctl -d /dev/media0 -V '"vsp1.2 lif":0 [fmt:ARGB32/640x480]'
379 > # in case R-Car M2 (HDMI - DU1 - vspd0)
380 > $ modetest -M rcar-du -s 10@8:1280x720@AR24 -d -P '8@19:640x480+100+200@XR24' &
382 After these command, Test pattern will show on display connected to porter's HDMI port.
384 Then, you can play H264(MP4) movie like this:
386 > $ gst-launch-1.0 filesrc location=./sample.mp4 ! qtdemux name=d d. ! \
387 > queue ! omxh264dec no-copy=true ! v4l2sink device=/dev/video1 \
388 > io-mode=userptr d. ! queue ! faad ! alsasink device=hw:0,0
391 ### Deployment (TFTP/NFS)
393 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.
395 #### Instructions on the host
396 1. Setup a TFTP server
397 1. Install necessary packages
398 > $ sudo apt-get install tftp tftpd-hpa
400 2. Go to build directory, and copy kernel and DTB into TFTP server root (default server dir: /srv/tftp)
401 > $cd $AGL_TOP/build/tmp/deploy/images/porter
402 > $ sudo cp uImage uImage-r8a7791-porter.dtb /srv/tftp
404 3. Verify TFTP server is working
406 ls: cannot access uImage: No such file or directory
409 > $ tftp 192.168.30.70
411 > Received 3583604 bytes in 0.2 seconds
417 1. Install necessary packages
418 > $ sudo apt-get install nfs-kernel-server nfs-common
420 2. Go to build directory, and extract the root file system into a dedicated directory (here we use /nfs/porter)
421 > $ cd $AGL_TOP/build/tmp/deploy/images/porter
422 > $ sudo mkdir -p /nfs/porter
423 > $ sudo tar --extract --numeric-owner --preserve-permissions --preserve-order \
424 > --totals --directory=/nfs/porter --file=agl-demo-platform-porter.tar.bz2
427 > $ sudo vi /etc/exports
430 > /nfs/porter *(rw,no_subtree_check,sync,no_root_squash,no_all_squash)
432 Save the file and exit.
434 4. Restart nfs service
435 > $ sudo service nfs-kernel-server restart
437 5. Verify NFS server is working
438 > $ sudo mount -t nfs 192.168.30.70:/nfs/porter /tmp/
440 > bin boot dev etc home lib media mnt proc run sbin sys tmp usr var
442 #### Instructions on the target board
444 NOTE: There is details about porter board [here](http://elinux.org/R-Car/Boards/Porter).
446 NOTE: To boot weston on porter board, we need keyboard and mouse. (USB2.0 can be use for this)
448 ##### Change U-Boot parameters to boot from TFTP/NFS
450 1. Power up the board and, using your preferred terminal emulator, stop the board's autoboot by hitting any key.
452 > Debug serial settings are 38400 8N1. Any standard terminal emulator program can be used.
454 2. Set the follow environment variables and save them
455 > => setenv ipaddr <board-ip>
456 > => setenv serverip <host-ip>
457 > => setenv bootargs_console console=ttySC6,${baudrate}
458 > => setenv bootargs_video vmalloc=384M video=HDMI-A-1:1024x768-32@60
459 > => setenv bootcmd_net 'tftp 0x40007fc0 uImage; tftp 0x40f00000 uImage-r8a7791-porter.dtb'
460 > => 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'
463 Replace <board-ip> with a proper IP address for the board, like 192.168.30.60.
464 Replace <host-ip> with the IP address of the host, here we use 192.168.30.70.
466 ##### Boot from TFTP/NFS
468 1. After board reset, U-Boot is started and after a countdown, ...
469 Linux boot message should be displayed. Please wait a moment.
470 2. Then weston is booted automatically, and weston-terminal appears.