Add new Yocto layer for common packages to IVI systems
[AGL/meta-agl.git] / README.md
1 meta-agl, the Yocto layer for Automotive Grade Linux Distribution
2 =================================================================
3
4 This layer's purpose is ... [TBD]
5
6 Layer Dependencies
7 ------------------
8
9 URI: git://git.yoctoproject.org/poky
10 > branch:   dizzy
11 > revision: 5f0d25152bac2d3798663a4ebfdd2df24060f153
12
13 URI: git://git.openembedded.org/meta-openembedded
14 > layer:    meta-oe
15 > branch:   dizzy
16 > revision: 853dcfa0d618dc26bd27b3a1b49494b98d6eee97
17
18 ## The Renesas R-Car Gen2 (Porter) board depends in addition on: ##
19
20 URI: https://gerrit.automotivelinux.org/gerrit/AGL/meta-renesas
21 > branch:   agl-1.0-bsp-1.8.0
22 > revision: 13a2551505942808752a1721c9a27ce7d35cec33
23
24 Layers
25 ------
26
27 There are 3 layers in top-level `meta-agl`.
28
29 `meta-ivi-common` is a layer which contains common packages to AGL
30 Distribution and other platforms for In-Vehicle Infotainment system.
31 > meta-agl/meta-ivi-common
32
33 `meta-agl` is a layer which contains AGL common and middleware packages.
34 > meta-agl/meta-agl
35
36 `meta-agl-bsp` is a layer which contains required packages to boot AGL distribution on an emulated machine(QEMU).
37 > meta-agl/meta-agl-bsp
38
39 Packagegroups
40 -------------
41
42 AGL package group design:
43
44 These are the top-level packagegroups for AGL Distribution.
45 > packagegroup-agl-core  (minimal packages to boot system)
46 > packagegroup-agl-ivi   (middlewares for AGL IVI)
47 > packagegroup-ivi-common (common packages to AGL and others)
48
49 Each package group can contain sub-package groups like these.
50 > packagegroup-agl-core-multimedia
51 > packagegroup-agl-core-connectivity
52 > ...
53 > packagegroup-agl-ivi-multimedia
54 > packagegroup-agl-ivi-connectivity
55 > ...
56 > packagegroup-ivi-common-multimedia
57 > packagegroup-ivi-common-connectivity
58
59 The recipe for `packagegroup-ivi-common-*.bb` will contain common packages to
60 AGL Distribution(meta-agl) and other In-Vehicle Infotainment system(e.g. meta-ivi and meta-tizen).
61 > directory: meta-agl/meta-ivi-common/recipes-core/packagegroups
62 > recipes  : packagegroup-ivi-common-[subsystem].bb
63
64 The "packagegroups-agl-ivi-*" will contain AGL specific middleware packages.
65 > directory: meta-agl/meta-agl/recipes-ivi/packagegroups
66 > recipes  : packagegroup-agl-ivi-[subsystem].bb
67
68 Supported Machine
69 -----------------
70
71 * QEMU (x86-64) - emulated machine: qemux86-64
72 * Renesas R-Car Gen2 (R-Car M2) - machine: porter
73
74 Supported Target of bitbake
75 ------------------------
76
77 * `agl-image-ivi` The baseline image of AGL Distributions
78
79 * `agl-image-minimal` For internal use to develop distribution (experimental)
80 * `agl-image-weston`  For internal use to develop distribution (experimental)
81
82 Supposed Directory Trees of Layers to build
83 -------------------------------------------
84
85 * For QEMU
86
87       ${TOPDIR}/
88                 meta-agl/
89                 meta-openembedded/
90                 poky/
91
92 * For R-Car M2
93
94       ${TOPDIR}/
95                 meta-agl/
96                 meta-openembedded/
97                 meta-renesas/
98                 poky/
99
100 Build a QEMU image
101 ------------------
102
103 You can build a QEMU image using the following steps:
104
105 1. Export TEMPLATECONF to pick up correct configuration for the build
106    > $ export TEMPLATECONF=/full/path/to/meta-agl/meta-agl/conf
107
108 2. Run the following command:
109    > $ source poky/oe-init-build-env
110
111 3. Build the minimal image of AGL Distribution
112    > $ bitbake agl-image-ivi
113
114 4. Run the emulator
115    > $ PATH_TO_POKY/poky/scripts/runqemu agl-image-ivi qemux86-64
116
117    For large screen:
118    > $ PATH_TO_POKY/poky/scripts/runqemu agl-image-ivi qemux86-64 bootparams="uvesafb.mode_option=1280x720-32"
119
120 5. Some weston samples are available from weston terminal.
121
122 Build a R-Car M2 (porter) image
123 -------------------------------
124
125 ### Software setup
126
127 NOTE: These instructions are based on GENIVI wiki, [here](http://wiki.projects.genivi.org/index.php/Hardware_Setup_and_Software_Installation/koelsch%26porter). If these didn't work correctly especially around Renesas Binary Packages, please check there and updated instructions.
128
129 #### Getting Source Code and Build image
130
131 1. Create a directory for working, then go to there.
132         $ mkdir -p $HOME/ANYWHERE_YOU_WANT_TO_WORK_THERE
133         $ cd $HOME/ANYWHERE_YOU_WANT_TO_WORK_THERE
134         $ export AGL_TOP=`pwd`
135
136 2. Get the meta data and checkout
137         $ git clone git://git.yoctoproject.org/poky
138         $ cd poky
139         $ git checkout 5f0d25152bac2d3798663a4ebfdd2df24060f153
140         $ cd -
141         $ git clone git://git.openembedded.org/meta-openembedded
142         $ cd meta-openembedded
143         $ git checkout 853dcfa0d618dc26bd27b3a1b49494b98d6eee97
144         $ cd -
145         $ git clone https://gerrit.automotivelinux.org/gerrit/AGL/meta-renesas
146         $ cd meta-renesas
147         $ git checkout c28172567a6325f5692e5d33b1ae1c1e64e59ddf
148         $ cd -
149         $ git clone https://gerrit.automotivelinux.org/gerrit/AGL/meta-agl
150
151 #### Obtain and Install Renesas Graphics Drivers
152
153 1. Download packages from Renesas
154
155   The graphics and multimedia acceleration packages for the R-Car M2 Porter board
156   can be download directory from [here](http://www.renesas.com/secret/r_car_download/rcar_demoboard.jsp).
157
158   There are 2 ZIP files can be downloaded.
159     * Multimedia and Graphics library which require registeration and click through license
160     > r-car_series_evaluation_software_package_for_linux-*.zip
161     * Related Linux drivers
162     > r-car_series_evaluation_software_package_of_linux_drivers-*.zip
163
164 2. Unzip the two downloads into a temporary directory.
165         $ cd $AGL_TOP
166         $ mkdir binary-tmp
167         $ cd binary-tmp
168         $ unzip PATH_TO_DOWNLOAD/r-car_series_evaluation_software_package_for_linux-*.zip
169         $ unzip PATH_TO_DOWNLOAD/r-car_series_evaluation_software_package_of_linux_drivers-*.zip
170
171    After this step there should be two files in binary-tmp:
172    * Multimedia and Graphics library
173    > R-Car_Series_Evaluation_Software_Package_for_Linux-*.tar.gz
174    * Related Linux drivers
175    > R-Car_Series_Evaluation_Software_Package_of_Linux_Drivers-*.tar.gz
176
177 3. Extract 2 tar archives
178         $ tar xf R-Car_Series_Evaluation_Software_Package_for_Linux-*.tar.gz
179         $ tar xf R-Car_Series_Evaluation_Software_Package_of_Linux_Drivers-*.tar.gz
180
181 4. Copy 2 files manually
182    1. Locate `EVA_r8a7791_linux_sgx_binaries_gles2.tar.bz2` in the Multimedia and Graphics library deliverable and copy it into the BSP layer.
183           $ cd $AGL_TOP
184           $ cp <path_to_file>/EVA_r8a7791_linux_sgx_binaries_gles2.tar.bz2 \
185           meta-renesas/meta-rcar-gen2/recipes-graphics/gles-module/\
186           gles-user-module/r8a7791_linux_sgx_binaries_gles2.tar.bz2
187
188    2. Locate `SGX_KM_M2.tar.bz2` in the related linux drivers deliverable and copy it into the BSP layer.
189           $ cp <path_to_file>SGX_KM_M2.tar.bz2 \
190           $ meta-renesas/meta-rcar-gen2/recipes-kernel/gles-module/gles-kernel-module
191
192 #### Build from the Source code
193
194 You can build a R-Car2 M2 (porter) image using the following steps:
195
196 1. Export TEMPLATECONF to pick up correct configuration for the build
197         $ export TEMPLATECONF=$AGL_TOP/meta-renesas/meta-rcar-gen2/conf
198
199 2. Run the following command:
200         $ cd $AGL_TOP
201         $ source poky/oe-init-build-env
202
203 3. Build the minimal image of AGL Distribution
204         $ bitbake agl-image-ivi
205
206 ### Deployment (SDCARD)
207
208 NOTE: These instructions are based on GENIVI wiki, [here](http://wiki.projects.genivi.org/index.php/Hardware_Setup_and_Software_Installation/koelsch%26porter#Deployment_.28SDCARD.29).
209
210 #### Instructions on the host
211
212 1. Format SD-Card and then, create single EXT3 partition on it.
213
214 2. Mount the SD-Card, for example `/media/$SDCARD_LABEL`.
215
216 3. Copy AGL root file system onto the SD-Card
217    1. Go to build directory
218            $ cd $AGL_TOP/build/tmp/deploy/images/porter
219    2. Extract the root file system into the SD-Card
220            $ sudo tar --extract --numeric-owner --preserve-permissions --preserve-order \
221            --totals --directory=/media/$SDCARD_LABEL --file=agl-image-ivi-porter.tar.bz2
222    3. Copy kernel and DTB into the `/boot` of the SD-Card
223            $ sudo cp uImage uImage-r8a7791-porter.dtb /media/$SDCARD_LABEL
224
225 4. After the copy finished, unmount SD-Card and insert it into the SD-Card slot of the porter board.
226
227 #### Instructions on the host
228
229 NOTE: There is details about porter board [here](http://elinux.org/R-Car/Boards/Porter).
230
231 NOTE: To boot weston on porter board, we need keyboard and mouse. (USB2.0 can be use for this)
232
233 ##### Change U-Boot parameters to boot from SD card
234
235 1. Power up the board and, using your preferred terminal emulator, stop the board's autoboot by hitting any key.
236
237   > Debug serial settings are 38400 8N1. Any standard terminal emulator program can be used.
238
239 2. Set the follow environment variables and save them
240         => setenv bootargs_console console=ttySC6,${baudrate}
241         => setenv bootargs_video vmalloc=384M video=HDMI-A-1:1024x768-32@60
242         => setenv bootcmd_sd 'ext4load mmc 0:1 0x40007fc0 boot/uImage;ext4load mmc 0:1 0x40f00000 boot/uImage-r8a7791-porter.dtb'
243         => setenv bootcmd 'setenv bootargs ${bootargs_console} ${bootargs_video} root=/dev/mmcblk0p1 rw rootfstype=ext3;run bootcmd_sd;bootm 0x40007fc0 - 0x40f00000'
244         => saveenv
245
246 ##### Boot from SD card
247
248 1. After board reset, U-Boot is started and after a countdown, ...
249    Linux boot message should be displayed. Please wait a moment.
250 2. Then weston is booted automatically, and weston-terminal appears.
251
252 3. Have fun! :)