bca5ef681f67d0447db589e1cd3c587579ebceb6
[AGL/documentation.git] / docs / 01_Getting_Started / 03_Build_and_Boot_guide_Profile / 01_Instrument_Cluster_(IC-IVI_with_Container_isolation).md
1 ---
2 title: Instrument Cluster (IC-IVI with Container isolation)
3 ---
4
5 # Build and Boot AGL Instrument Cluster demo image (IC-IVI with Container isolation)
6
7
8 This document describe how to build AGL instrument cluster with
9 container integration.
10
11 ## 1. Select Image type and target board
12
13 AGL IC container integration has various type.  Developer need to choice
14 which integration type.  Those type show in table1. 
15
16 **Table 1. Integration type.**
17
18 | No. | Type name | Detail of type | Required storage (SD card) size - board. | Build time AMD R9 5900HX /64GByte RAM | Required storage size-build. |  |
19 |:---:|:---:|:---:|:---:|:---:|:---:|:---:|
20 | 1 | Simple container host | This integration aim to core package definition for container host using LXC.  This integration is not include demo package. This integration aim to define starting point for downstream product development. | 1G Byte |  | 150GByte | Console only. |
21 | 2a | Instrument cluster with simple demo IVI install to one partition. | This integration aim to get most simple integration with demo feature.  This container runtime and management is constructed with LXC package only.  On the other hand, it has limitation for supported use case.  This integration support two demo guest run in one board (instrument cluster guest and momi IVI guest). This integration aim to learn drm lease and LXC container by developer. | 2GByte | 2h | 300GByte | ![](images/image1.png) |
22 | 3a | Instrument cluster with demo IVI install to one by one partition. | This integration aim to get simple integration with demo feature.  This container runtime and management is constructed with container management daemon with liblxc.  This integration will improve to support many embedded use case.  This integration support two demo guest run in one board (instrument cluster guest and momi IVI guest). This integration aim to learn and develop AGL IC container integration by developer. | 16GByte (Including pre-allocated partition for 3 guests.) | 2h | 300GByte | ![](images/image1.png) |
23 | 3b | Instrument cluster with four demo IVI install to one by one partition. | This integration aim to get full demo integration with AGL demo IVI.  This integration is extend from 3a integration.  This integration support instrument cluster guest and four IVI guest (momi, qt, flutter, html5).   This integration aim to use AGL demonstration in each event by developer. | 16GByte | 3a+6h | 600GByte | ![](images/image2.png) |
24
25 We recommend to choice 3a.  It can extend to 3b.
26
27 AGL IC container integration supported two board.  Those board show in
28 table2.
29
30 **Table2. Supported board.**
31
32 | Board type | Support integration type | status |
33 |:---:|:---:|:---:|
34 | AGL RefHW | 1,2a,3a,3b | Tested |
35 | R-CarH3 Starter Kit with Kingfisher board | 1,2a,3a,3b | Not tested. |
36 | R-CarM3 Starter Kit with Kingfisher board | 1,2a,3a,3b | EOL Board. Not tested. |
37 | R-CarH3 Starter Kit | 1,2a | End of Supported in latest release. |
38 | R-CarM3 Starter Kit | 1,2a | EOL Board. End of  support in latest release. |
39 | Raspberry Pi4 (4G or 8G) | 1,2a,3a,3b | Tested. |
40
41
42 We recommend to choice AGL RefHW or Raspberry Pi4 (4G or 8G).
43
44 **Typical Hardware Set is shown in Appendix.1. **
45
46 ## 2. Setup build environment
47
48 Build environment for AGL IC container integration is same as AGL other
49 profile build environment. 
50
51 ### 1st step:
52 Please read [[Build Process Overview]](https://docs.automotivelinux.org/en/master/#01_Getting_Started/02_Building_AGL_Image/01_Build_Process_Overview/) in AGL doc.
53
54 ### 2nd step:
55 Please read [[Preparing Your Build Host]](https://docs.automotivelinux.org/en/master/#01_Getting_Started/02_Building_AGL_Image/02_Preparing_Your_Build_Host/) in AGL doc.
56
57 ### 3rd step: 
58 Define Your Top-Level Directory.
59
60 ```bash
61 $ export AGL_TOP=$HOME/AGL
62 $ mkdir -p $AGL_TOP
63 ```
64
65 ### 4th step: Download the repo Tool and Set Permissions
66
67 If your environment already install google repo, please skip this step.
68
69 ```bash
70 $ mkdir -p $HOME/bin
71 $ export PATH=$HOME/bin:$PATH
72 $ curl https://storage.googleapis.com/git-repo-downloads/repo > $HOME/bin/repo
73 $ chmod a+x $HOME/bin/repo
74 ```
75
76 ### 5th step: Setup git
77
78 If your environment already setup user information for git, please skip this step.
79
80 ```bash
81 $ git config \--global user.email "you@example.com"
82 $ git config \--global user.name "Your Name"
83 ```
84
85 ### 6th step: Download the AGL Source Files
86
87 ```bash
88 $ cd $AGL_TOP
89 $ mkdir master
90 $ export AGL_TOP=$HOME/AGL/master
91 $ cd $AGL_TOP
92 $ repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
93 $ repo sync
94 ```
95
96 ### 7th step: Downloading Proprietary Drivers  (AGL RefHW and R-Car H3/M3 with Kingfisher board only procedure)
97
98 If your board is Raspberry Pi4, please skip this step.
99
100 #### 7-1: Downloading Proprietary Drivers from [Renesas-automotive-products](https://www.renesas.com/us/en/products/automotive-products/automotive-system-chips-socs/r-car-h3-m3-documents-software).
101
102 In case of Optimistic Octopus and master, please download this.
103
104 ![](images/image3.png)
105
106 #### 7-2: To check the files to download.
107 ```bash
108 $ grep -rn ZIP_.= $AGL_TOP/meta-agl/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh
109 $ export XDG_DOWNLOAD_DIR=$HOME/Downloads
110 ```
111
112 #### 7-3: Download and copy Proprietary Drivers files (Run commands at downloaded files directory).
113
114 ```bash
115 $ cp R-Car_Gen3_Series_Evaluation_Software_Package_* $XDG_DOWNLOAD_DIR/
116 $ chmod a+rw $XDG_DOWNLOAD_DIR/*.zip
117 ```
118
119 ## 3. Configure to target board and build.
120
121 ### 1st step:  Run the aglsetup.sh Script.
122
123 ```bash
124 $ cd $AGL_TOP
125 ```
126
127 When your board is AGL RefHW.
128
129 ```bash
130 $ source meta-agl/scripts/aglsetup.sh -f -m h3ulcb -b build-ic-refhw agl-ic-container agl-refhw-h3
131 ```
132
133 When your board is R- CarH3 Starter Kit with Kingfisher board.
134
135 ```bash
136 $ source meta-agl/scripts/aglsetup.sh -f -m h3ulcb-kf -b build-ic-h3kf agl-ic-container
137 ```
138
139 When your board is Raspberry Pi 4
140 ```bash
141 $ source meta-agl/scripts/aglsetup.sh -f -m raspberrypi4 -b build-ic-rpi4 agl-ic-container
142 ```
143
144 ### 2nd step: Build target image.
145
146 In this time, you can build 1,2a and 3a.  If you want to build 3b,
147 please do extra step in next section.
148
149 When you choice integration type 1.
150
151 ```bash
152 $ bitbake lxc-host-image-minimal
153 ```
154
155 When you choice integration type 2a.
156
157 ```bash
158 $ bitbake agl-cluster-demo-lxc-host
159 ```
160
161 When you choice integration type 3a.
162
163 ```bash
164 $ bitbake agl-instrument-cluster-container-demo
165 ```
166
167 ## 4. Extra step for type 3b build.
168
169 This extra step can select 4a or 4b.  When you want to build AGL demo
170 IVI container guest in myself, please select 4a work flow.  When you
171 want to create AGL IC container demo quicly, please select 4b work flow.
172
173 Typically 4a step require long build time about 6h.  When you want to
174 build AGL Ref HW/ SK+ Kinfgisher software, you can\'t select select 4b
175 work flow that depend to Renesas propriety license limitation.
176
177 ### 4a. Extra step for type 3b build myself.
178
179 #### 1st step: Configure 2nd build tree.
180
181 We recommend to open new terminal to do this extra section.
182
183 ```bash
184 $ export AGL_TOP=$HOME/AGL/master
185 $ cd $AGL_TOP
186 ```
187
188 When your board is AGL RefHW.
189
190 ```bash
191 $ source meta-agl/scripts/aglsetup.sh -f -m h3ulcb -b build-ivi-refhw agl-container-guest-demo agl-demo agl-refhw-h3
192 ```
193
194 When your board is R- CarH3 Starter Kit with Kingfisher board.
195
196 ```bash
197 $ source meta-agl/scripts/aglsetup.sh -f -m h3ulcb-kf -b build-ivi-h3kf agl-container-guest-demo agl-demo
198 ```
199
200 When your board is Raspberry Pi 4
201 ```bash
202 $ source meta-agl/scripts/aglsetup.sh -f -m raspberrypi4 -b build-ivi-rpi4 agl-container-guest-demo agl-demo
203 ```
204
205 #### 2nd step: Build target images.
206
207 Type 3b integration need to build 3 image, these image are
208 agl-ivi-demo-qt, agl-ivi-demo-flutter and agl-ivi-demo-html5.
209
210 ```bash
211 $ bitbake agl-ivi-demo-qt
212 $ bitbake agl-ivi-demo-flutter
213 $ bitbake agl-ivi-demo-html5
214 ```
215
216 #### 3rd step: Set deploy path of AGL IVI Demo to IC side config.
217
218 Type 3b integration refer to IVI pre build image.  Please set IVI side
219 deploy directory in ic side local.conf (or site.conf).
220
221 At $AGL_TOP/build-ic-XXXX/conf/local.conf
222
223 Add to
224 ```bash
225 OUT_OF_TREE_CONTAINER_IMAGE_DEPLOY_DIR = "/path/to/deploy/"
226 ```
227
228 ex.  When your board is AGL RefHW and your home directory is "/home/user/".
229 ```bash
230 OUT_OF_TREE_CONTAINER_IMAGE_DEPLOY_DIR = "/home/user/AGL/octopus/build-ivi-refhw/tmp/deploy"
231 ```
232
233 ex.  When your board is R- CarH3 Starter Kit with Kingfisher board and your home directory is "/home/user/".
234
235 ```bash
236 OUT_OF_TREE_CONTAINER_IMAGE_DEPLOY_DIR = "/home/user/AGL/octopus/build-ivi-h3kf/tmp/deploy"
237 ```
238
239 ex.  When your board is Raspberry Pi 4 and your home directory is "/home/user/".
240
241 ```bash
242 OUT_OF_TREE_CONTAINER_IMAGE_DEPLOY_DIR = "/home/user/AGL/octopus/build-ivi-rpi4/tmp/deploy"
243 ```
244
245 #### 4th step: Build all in one image (3b).
246
247 Back to terminal for ic build.
248
249 ```bash
250 $ bitbake agl-instrument-cluster-container-demo
251 ```
252
253 ### 4b. Extra step for type 3b using pre build image.
254
255 The 4b can select Raspberry Pi 4 board only, this limitation depend to
256 Renesas propriety license limitation.
257
258 #### 1st step: Download stable prebuild image from AGL site.
259
260 Download IVI guest images from this link.
261
262 [[Prebuild AGL Demo IVI container images for Raspberry Pi
263 4.]](https://drive.google.com/file/d/1uXel0K9_IK7SAEc8msKyXvNWhFRWgF4C/view?usp=sharing)
264
265 Extract download tar.bz2 archive to any directory.
266
267 ```bash
268 $ cd /path/to/directory/
269 $ tar xvJf /path/to/download/agl-demo-ivi-container-guest-raspberrypi4-64.tar.bz2
270 ```
271
272 #### 2nd step: Set deploy path of AGL IVI Demo to IC side config.
273
274 Set extracted directory using OUT_OF_TREE_CONTAINER_IMAGE_DEPLOY_DIR in
275 local.conf (or site.conf).
276
277 ```bash
278 OUT_OF_TREE_CONTAINER_IMAGE_DEPLOY_DIR="/path/to/directory/prebuild/"
279 ```
280
281 #### 3rd step: Build all in one image (3b).
282
283 Back to terminal for ic build.
284
285 ```bash
286 $ bitbake agl-instrument-cluster-container-demo
287 ```
288
289 ## 5. Write image to SD card.
290
291 The 3a and 3b image is constructed by wic image, that include partition
292 table and each partition data into one image file.
293
294 In default setting, that wic image is compressed xz.  When that wic
295 image write to SD card, you need to use xzcat ant dd command in build
296 PC.
297
298 ```bash
299 $ sudo bash -c "xzcat /path/to/image/directory/agl-instrument-cluster-container-demo-XXXXX.rootfs.wic.xz | dd of=/dev/sdXXX bs=128M"
300 ```
301
302 **If you are missing to set SD card device "/dev/sdXXX", it cause
303 SSD/HDD data break (only logical, not physical).**
304
305 For example;
306
307 A /dev/sda is SSD for your PC.  A /dev/sdb is SD card.  You should use
308 /dev/sdb, must not use /dev/sda.
309
310 When your PC has direct SD card interface not a use card reader, your SD
311 card device is /dev/mmcblkX may be.
312
313 ## 6. Power on.
314
315 ## 7. How to use container exchange UI.
316
317 ### 7a. Momi Web
318
319 The Momi web is a web interface for container exchange.  When you want
320 to use Momi web, you must connect network between board and
321 PC/Tablet/Phone.
322
323 **The Momi web is completely demo feature, that open many security hole.
324  You shall not use out of standalone demo.**
325
326 #### 1st step: Check IP address in your board.
327
328 After booting, you check IP address in your board.
329
330 ```bash
331 root@raspberrypi4-64:\~# ifconfig\
332 eth0      Link encap:Ethernet  HWaddr E4:XX:YY:ZZ:WW:VV\
333            inet addr:192.168.10.128  Bcast:192.168.10.255
334   Mask:255.255.255.0
335 ```
336
337 In this case, this board set IP address by 192.168.10.128.
338
339 #### 2nd step: Connect to board using web browser.
340
341 Open "[http://a.b.c.d:8080](http://a.b.c.d:8080)".  When
342 a board is set IP address 192.168.10.128, you open
343 "[http://192.168.10.128:8080](http://192.168.10.128:8080)".
344
345 When you success to connect to board, your web browser show these web
346 UI.
347
348 #### PC View
349
350 ![](images/image4.png)
351
352 #### Mobile View
353
354 ![](images/image5.png)
355
356 ### 7b. Keyboard Interface
357
358 Please refer to Appendix 3.
359
360 ## Appendix.1.  Typical Hardware set.
361
362 ### AGL Reference Hardware.
363
364 ![](images/image6.png)
365
366
367 | **No** | **Name** | **num** | **Where to buy** |
368 |---|---|---|---|
369 | 1 | AGL Ref HW | 1 | Ask to Panasonic. [Contact about purchase](https://confluence.automotivelinux.org/display/RHSA/Contact+about+purchase) |
370 | 2 | Touch Display (Full HD) | 1 | [https://amzn.asia/d/7URb6r8](https://amzn.asia/d/7URb6r8) |
371 | 3 | Cluster Display (1920x720 or Full HD) | 1 | [https://amzn.asia/d/bGircST](https://amzn.asia/d/bGircST) |
372 | 4 | HDMI Cable (Need to check how to connect this cable to Touch/Cluster Display, that depend to display side connector) | 2 | [https://amzn.asia/d/auuhnTK](https://amzn.asia/d/auuhnTK) |
373 | 5 | Optional: Special Keyboard | 1 | [https://amzn.asia/d/dZdbp9X](https://amzn.asia/d/dZdbp9X) |
374
375 ### Raspberry PI4
376
377 ![](images/image7.png)
378
379 | **No** | **Name** | **num** | **Where to buy** |
380 |---|---|---|---|
381 | 1 | Raspberry PI 4(4G or 8G) with Power supply | 1 | [https://akizukidenshi.com/catalog/g/gM-14778/](https://akizukidenshi.com/catalog/g/gM-14778/) [https://akizukidenshi.com/catalog/g/gM-16293/](https://akizukidenshi.com/catalog/g/gM-16293/) |
382 | 2 | Touch Display (Full HD) | 1 | [https://amzn.asia/d/7URb6r8](https://amzn.asia/d/7URb6r8) |
383 | 3 | Cluster Display (1920x720 or Full HD) | 1 | [https://amzn.asia/d/bGircST](https://amzn.asia/d/bGircST) |
384 | 4 | HDMI Cable (Need to check how to connect this cable to Touch/Cluster Display, that depend to display side connector) | 2 | [https://akizukidenshi.com/catalog/g/gC-15002/](https://akizukidenshi.com/catalog/g/gC-15002/) |
385 | 5 | Optional: Special Keyboard | 1 | [https://amzn.asia/d/dZdbp9X](https://amzn.asia/d/dZdbp9X) |
386
387
388 ## Appendix.2. Cluster with IVI Containers View.
389
390 ### Qt IVI
391
392 ![](images/image8.jpeg)
393
394 ### Flutter IVI
395
396 ![](images/image9.jpeg)
397
398 ### HTML5 IVI
399
400 ![](images/image10.jpeg)
401
402 ### Momi IVI
403
404 ![](images/image11.jpeg)
405
406 ## Appendix 3. How to configure Special Keyboard.
407
408 ### How to get configuration tool.
409
410 This description is targeting to [this type of special
411 keyboard](https://amzn.asia/d/dUxGK5Q). 
412
413 The usb-12key-kbd-prog is unofficial community tool of this key board
414 that is possible to use linux.  Official windows tool is possible to get
415 official site.
416
417 Usage of usb-12key-kbd-prog is please refer to upstream site.
418
419 Upstream:
420 [https://github.com/NeoCat/usb-12key-kbd-prog](https://github.com/NeoCat/usb-12key-kbd-prog)
421
422 ### Key Map.
423 | Key | Container |
424 |---|---|
425 | A | Momi IVI |
426 | C | Crash IVI guest |
427 | D | Qt IVI |
428 | G | Flutter IVI |
429 | H | HTML5 IVI |
430
431 # Reference webpages
432  1. [eLinux](https://elinux.org/R-Car/AGL)
433  1. [Kingfisher Board](https://elinux.org/R-Car/Boards/Kingfisher)
434  1. [R-Car M3SK](https://elinux.org/R-Car/Boards/M3SK#Flashing_firmware)
435  1. [agl reference machines](https://docs.automotivelinux.org/en/master/#02_hardware_support/01_Supported_Hardware_Overview/)
436  1. [AGL Tech Day Presenation](https://static.sched.com/hosted_files/agltechday2022/3b/agl-techday-202204.pdf)
437  1. [Build AGL Image](https://docs.automotivelinux.org/en/master/#01_Getting_Started/02_Building_AGL_Image/0_Build_Process_Overview/)
438  1. [Building for Supported Renesas Boards](https://docs.automotivelinux.org/en/master/#01_Getting_Started/02_Building_AGL_Image/09_Building_for_Supported_Renesas_Boards/)