3ecc77d846a6512e747ec5bb8643589e79c0bd8d
[AGL/documentation.git] /
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 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 2 guests.) | 2h | 300GByte | ![](images/image1.png) |
22 | 2b | Instrument cluster with AGL 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 2a integration.  This integration support instrument cluster guest and four IVI guest (momi, qt, flutter).   This integration aim to use AGL demonstration in each event by developer. | 16GByte | 2a+6h | 600GByte | ![](images/image2.png) |
23
24
25 AGL IC container integration supported two board.  Those board show in
26 table2.
27
28 **Table2. Supported board.**
29
30 | Board type | Support integration type | status |
31 |:---:|:---:|:---:|
32 | AGL RefHW | 1,2a,2b | Tested. |
33 | R-CarH3 Starter Kit with Kingfisher board | 1,2a,2b | Not tested. |
34 | NanoPC-T6 (4G or 8G or 16G) | 1,2a,2b | Tested by 16G board. |
35 | Raspberry Pi4/5 (4G or 8G) | 1,2a,2b | Tested. |
36
37 We recommend to choice AGL RefHW or Raspberry Pi4 (4G or 8G) or NanoPC-T6 (4G or 8G or 16G) . 
38
39 **Typical Hardware Set is shown in Appendix.1. **
40
41 ## 2. Setup build environment
42
43 Build environment for AGL IC container integration is same as AGL other
44 profile build environment. 
45
46 ### 1st step:
47 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.
48
49 ### 2nd step:
50 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.
51
52 ### 3rd step: 
53 Define Your Top-Level Directory.
54
55 ```bash
56 $ export AGL_TOP=$HOME/AGL
57 $ mkdir -p $AGL_TOP
58 ```
59
60 ### 4th step: Download the repo Tool and Set Permissions
61
62 If your environment already install google repo, please skip this step.
63
64 ```bash
65 $ mkdir -p $HOME/bin
66 $ export PATH=$HOME/bin:$PATH
67 $ curl https://storage.googleapis.com/git-repo-downloads/repo > $HOME/bin/repo
68 $ chmod a+x $HOME/bin/repo
69 ```
70
71 ### 5th step: Setup git
72
73 If your environment already setup user information for git, please skip this step.
74
75 ```bash
76 $ git config \--global user.email "you@example.com"
77 $ git config \--global user.name "Your Name"
78 ```
79
80 ### 6th step: Download the AGL Source Files
81
82 ```bash
83 $ cd $AGL_TOP
84 $ mkdir master
85 $ export AGL_TOP=$HOME/AGL/master
86 $ cd $AGL_TOP
87 $ repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
88 $ repo sync
89 ```
90
91 ### 7th step: Downloading Proprietary Drivers  (AGL RefHW and R-Car H3/M3 with Kingfisher board only procedure)
92
93 If your board is Raspberry Pi4, please skip this step.
94
95 #### 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).
96
97 In case of master, please download this.
98
99 ***Note.  Latest AGL use same binary as kirkstone.***
100
101 ![](images/image3.png)
102
103 #### 7-2: To check the files to download.
104 ```bash
105 $ grep -rn ZIP_.= $AGL_TOP/meta-agl/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh
106 $ export XDG_DOWNLOAD_DIR=$HOME/Downloads
107 ```
108
109 #### 7-3: Download and copy Proprietary Drivers files (Run commands at downloaded files directory).
110
111 ```bash
112 $ cp R-Car_Gen3_Series_Evaluation_Software_Package_* $XDG_DOWNLOAD_DIR/
113 $ chmod a+rw $XDG_DOWNLOAD_DIR/*.zip
114 ```
115
116 ## 3. Configure to target board and build.
117
118 ### 1st step:  Run the aglsetup.sh Script.
119
120 ```bash
121 $ cd $AGL_TOP
122 ```
123
124 When your board is AGL RefHW.
125
126 ```bash
127 $ source meta-agl/scripts/aglsetup.sh -f -m h3ulcb -b build-ic-refhw agl-ic-container agl-refhw-h3
128 ```
129
130 When your board is R- CarH3 Starter Kit with Kingfisher board.
131
132 ```bash
133 $ source meta-agl/scripts/aglsetup.sh -f -m h3ulcb-kf -b build-ic-h3kf agl-ic-container
134 ```
135
136 When your board is NanoPC T6
137 ```bash
138 $ source meta-agl/scripts/aglsetup.sh -f -m nanopc-t6 -b build-ic-nanopc-t6 agl-ic-container
139 ```
140
141 When your board is Raspberry Pi 4
142 ```bash
143 $ source meta-agl/scripts/aglsetup.sh -f -m raspberrypi4 -b build-ic-rpi4 agl-ic-container
144 ```
145
146 When your board is Raspberry Pi 5
147 ```bash
148 $ source meta-agl/scripts/aglsetup.sh -f -m raspberrypi5 -b build-ic-rpi5 agl-ic-container
149 ```
150
151
152 ### 2nd step: Build target image.
153
154 In this time, you can build 1 and 2a.  If you want to build 2b,
155 please do extra step in next section.
156
157 When you choice integration type 1.
158
159 ```bash
160 $ bitbake lxc-host-image-minimal
161 ```
162
163 When you choice integration type 2a.
164
165 ```bash
166 $ bitbake agl-instrument-cluster-container-demo
167 ```
168
169 ## 4. Extra step for type 2b build.
170
171 This extra step can select 4.1 or 4.2.  When you want to build AGL demo
172 IVI container guest in myself, please select 4.1 work flow.  When you
173 want to create AGL IC container demo quicly, please select 4.2 work flow.
174
175 Typically 4.1 step require long build time about 6h.  When you want to
176 build AGL Ref HW/ SK+ Kinfgisher software, you can\'t select select 4.2
177 work flow that depend to Renesas propriety license limitation.
178
179 ### 4.1. Extra step for type 2b build myself.
180
181 #### 1st step: Configure 2nd build tree.
182
183 We recommend to open new terminal to do this extra section.
184
185 ```bash
186 $ export AGL_TOP=$HOME/AGL/master
187 $ cd $AGL_TOP
188 ```
189
190 When your board is AGL RefHW.
191
192 ```bash
193 $ source meta-agl/scripts/aglsetup.sh -f -m h3ulcb -b build-ivi-refhw agl-container-guest-demo agl-demo agl-refhw-h3
194 ```
195
196 When your board is R- CarH3 Starter Kit with Kingfisher board.
197
198 ```bash
199 $ source meta-agl/scripts/aglsetup.sh -f -m h3ulcb-kf -b build-ivi-h3kf agl-container-guest-demo agl-demo
200 ```
201
202 When your board is NanoPC T6
203 ```bash
204 $ source meta-agl/scripts/aglsetup.sh -f -m nanopc-t6 -b build-ivi-nanopc-t6 agl-container-guest-demo agl-demo
205 ```
206
207 When your board is Raspberry Pi 4
208 ```bash
209 $ source meta-agl/scripts/aglsetup.sh -f -m raspberrypi4 -b build-ivi-rpi4 agl-container-guest-demo agl-demo
210 ```
211
212 When your board is Raspberry Pi 5
213 ```bash
214 $ source meta-agl/scripts/aglsetup.sh -f -m raspberrypi5 -b build-ivi-rpi5 agl-container-guest-demo agl-demo
215 ```
216
217 #### 2nd step: Build target images.
218
219 Type 2b integration need to build 3 image, these image are
220 agl-ivi-demo-qt and agl-ivi-demo-flutter.
221
222 ```bash
223 $ bitbake agl-ivi-demo-qt
224 $ bitbake agl-ivi-demo-flutter
225 ```
226
227 #### 3rd step: Set deploy path of AGL IVI Demo to IC side config.
228
229 Type 2b integration refer to IVI pre build image.  Please set IVI side
230 deploy directory in ic side local.conf (or site.conf).
231
232 At $AGL_TOP/build-ic-XXXX/conf/local.conf
233
234 Add to
235 ```bash
236 OUT_OF_TREE_CONTAINER_IMAGE_DEPLOY_DIR = "/path/to/deploy/"
237 ```
238
239 ex.  When your board is AGL RefHW and your home directory is "/home/user/".
240 ```bash
241 OUT_OF_TREE_CONTAINER_IMAGE_DEPLOY_DIR = "/home/user/AGL/master/build-ivi-refhw/tmp/deploy"
242 ```
243
244 ex.  When your board is R- CarH3 Starter Kit with Kingfisher board and your home directory is "/home/user/".
245
246 ```bash
247 OUT_OF_TREE_CONTAINER_IMAGE_DEPLOY_DIR = "/home/user/AGL/master/build-ivi-h3kf/tmp/deploy"
248 ```
249
250 ex.  When your board is NanoPC T6 board and your home directory is "/home/user/".
251
252 ```bash
253 OUT_OF_TREE_CONTAINER_IMAGE_DEPLOY_DIR = "/home/user/AGL/master/build-ivi-nanopc-t6/tmp/deploy"
254 ```
255
256 ex.  When your board is Raspberry Pi 4 and your home directory is "/home/user/".
257
258 ```bash
259 OUT_OF_TREE_CONTAINER_IMAGE_DEPLOY_DIR = "/home/user/AGL/master/build-ivi-rpi4/tmp/deploy"
260 ```
261
262 ex.  When your board is Raspberry Pi 5 and your home directory is "/home/user/".
263
264 ```bash
265 OUT_OF_TREE_CONTAINER_IMAGE_DEPLOY_DIR = "/home/user/AGL/master/build-ivi-rpi5/tmp/deploy"
266 ```
267
268 #### 4th step: Build all in one image (2b).
269
270 Back to terminal for ic build.
271
272 ```bash
273 $ bitbake agl-instrument-cluster-container-demo
274 ```
275
276 ### 4.2. Extra step for type 2b using pre build image.
277
278 The 4.2 can select Raspberry Pi 4 board only, this limitation depend to
279 Renesas propriety license limitation.
280
281 #### 1st step: Download stable prebuild image from AGL site.
282
283 Download IVI guest images from this link.
284
285 [[Prebuild AGL Demo IVI container images for Raspberry Pi
286 4.]]()
287
288 Extract download tar.bz2 archive to any directory.
289
290 ```bash
291 $ cd /path/to/directory/
292 $ tar xvJf /path/to/download/agl-demo-ivi-container-guest-raspberrypi4-64.tar.bz2
293 ```
294
295 #### 2nd step: Set deploy path of AGL IVI Demo to IC side config.
296
297 Set extracted directory using OUT_OF_TREE_CONTAINER_IMAGE_DEPLOY_DIR in
298 local.conf (or site.conf).
299
300 ```bash
301 OUT_OF_TREE_CONTAINER_IMAGE_DEPLOY_DIR="/path/to/directory/prebuild/"
302 ```
303
304 #### 3rd step: Build all in one image (2b).
305
306 Back to terminal for ic build.
307
308 ```bash
309 $ bitbake agl-instrument-cluster-container-demo
310 ```
311
312 ## 5. Write image to SD card.
313
314 The 2a and 2b image is constructed by wic image, that include partition
315 table and each partition data into one image file.
316
317 In default setting, that wic image is compressed xz.  When that wic
318 image write to SD card, you need to use xzcat ant dd command in build
319 PC.
320
321 ```bash
322 $ sudo bash -c "xzcat /path/to/image/directory/agl-instrument-cluster-container-demo-XXXXX.rootfs.wic.xz | dd of=/dev/sdXXX bs=128M"
323 ```
324
325 **If you are missing to set SD card device "/dev/sdXXX", it cause
326 SSD/HDD data break (only logical, not physical).**
327
328 For example;
329
330 A /dev/sda is SSD for your PC.  A /dev/sdb is SD card.  You should use
331 /dev/sdb, must not use /dev/sda.
332
333 When your PC has direct SD card interface not a use card reader, your SD
334 card device is /dev/mmcblkX may be.
335
336 ## 6. Power on.
337
338 ## 7. How to use container exchange UI.
339
340 IC container integration has three method for container exchange.
341
342 | No. | Method | Refer to |
343 |:---|:---|:---|
344 | 1 | Command line interface | Sub section 7a. |
345 | 2 | Web UI | Appendix 3. |
346 | 3 | Key board UI | Appendix 4. |
347
348
349 ### 7a. How to change guest using command line interface
350
351 The cmcontrol is a command line interface for the container manager.  It supports container listing, shutdown, reboot, force reboot, and active guest change. 
352
353 ```bash
354 $ cmcontrol
355 usage: [options]
356
357  --help                   print help strings.
358  --get-guest-list         get guest container list from container manager.
359  --get-guest-list-json    get guest container list from container manager by json.
360  --shutdown-guest-name=N  shutdown request to container manager. (N=guest name)
361  --shutdown-guest-role=R  shutdown request to container manager. (R=guest role)
362  --reboot-guest-name=N    reboot request to container manager. (N=guest name)
363  --reboot-guest-role=R    shutdown request to container manager. (R=guest role)
364  --force-reboot-guest-name=N    reboot request to container manager. (N=guest name)
365  --force-reboot-guest-role=R    shutdown request to container manager. (R=guest role)
366  --change-active-guest-name=N    change active guest request to container manager. (N=guest name)
367 ```
368
369 You can get installed container guests in the system using --get-guest-list option.
370
371 ```bash
372 $ cmcontrol --get-guest-list
373 HEADER:                             name,        role,      status
374                             cluster-demo,     cluster,     started
375                     agl-flutter-ivi-demo,         ivi,     disable
376                        agl-momi-ivi-demo,         ivi,     started
377                          agl-qt-ivi-demo,         ivi,     disable
378 ```
379
380 The name is a guest name.  The role is a guest role (cluster or ivi).  The status is a status of guest.  Current inactive guest status is disable.
381
382
383 If you want to change guest from agl-momi-ivi-demo to agl-flutter-ivi-demo, it uses these command.
384
385 ```bash
386 $ cmcontrol --change-active-guest-name=agl-flutter-ivi-demo
387 $ cmcontrol --shutdown-guest-role=ivi
388 ```
389
390 If you want to reboot IVI guest with shutdown process, it uses these command.
391
392 ```bash
393 $ cmcontrol --reboot-guest-role=ivi
394 ```
395
396 If you want to force reboot IVI guest without shutdown process, it uses these command.
397
398 ```bash
399 $ cmcontrol --force-reboot-guest-role=ivi
400 ```
401
402 ## Frequently Asked Questions
403
404 | Questions | Answer |
405 |:---|:---|
406 | Why not show map in default screen of Momi IVI. | When you want show map, you need extra step.  Please fallow [this page](../../06_Component_Documentation/Demo_Application/01_Momi_Navi.md).|
407
408
409 ## Appendix.1.  Typical Hardware set.
410
411 ### AGL Reference Hardware.
412
413 ![](images/image6.png)
414
415
416 | **No** | **Name** | **num** | **Where to buy** |
417 |---|---|---|---|
418 | 1 | AGL Ref HW | 1 | Ask to Panasonic. [Contact about purchase](https://confluence.automotivelinux.org/display/RHSA/Contact+about+purchase) |
419 | 2 | Touch Display (Full HD) | 1 | [https://amzn.asia/d/7URb6r8](https://amzn.asia/d/7URb6r8) |
420 | 3 | Cluster Display (1920x720 or Full HD) | 1 | [https://amzn.asia/d/bGircST](https://amzn.asia/d/bGircST) |
421 | 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) |
422 | 5 | Optional: Special Keyboard | 1 | [https://amzn.asia/d/dZdbp9X](https://amzn.asia/d/dZdbp9X) |
423
424 ### Raspberry PI4
425
426 ![](images/image7.png)
427
428 | **No** | **Name** | **num** | **Where to buy** |
429 |---|---|---|---|
430 | 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/) |
431 | 2 | Touch Display (Full HD) | 1 | [https://amzn.asia/d/7URb6r8](https://amzn.asia/d/7URb6r8) |
432 | 3 | Cluster Display (1920x720 or Full HD) | 1 | [https://amzn.asia/d/bGircST](https://amzn.asia/d/bGircST) |
433 | 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/) |
434 | 5 | Optional: Special Keyboard | 1 | [https://amzn.asia/d/dZdbp9X](https://amzn.asia/d/dZdbp9X) |
435
436
437 ## Appendix.2. Cluster with IVI Containers View.
438
439 ### Qt IVI
440
441 ![](images/image8.jpeg)
442
443 ### Flutter IVI
444
445 ![](images/image9.jpeg)
446
447 ### Momi IVI
448
449 ![](images/image11.jpeg)
450
451 ## Appendix 3. How to use Web UI (Momi Web).
452
453 The Momi web is a web interface for container exchange.  When you want
454 to use Momi web, you must connect network between board and
455 PC/Tablet/Phone.
456
457 **The Momi web is completely demo feature, that open many security hole.
458  You shall not use out of standalone demo.**
459
460 ### 1st step: Check IP address in your board.
461
462 After booting, you check IP address in your board.
463
464 ```bash
465 root@raspberrypi4-64:\~# ifconfig\
466 eth0      Link encap:Ethernet  HWaddr E4:XX:YY:ZZ:WW:VV\
467            inet addr:192.168.10.128  Bcast:192.168.10.255
468   Mask:255.255.255.0
469 ```
470
471 In this case, this board set IP address by 192.168.10.128.
472
473 ### 2nd step: Connect to board using web browser.
474
475 Open "[http://a.b.c.d:8080](http://a.b.c.d:8080)".  When
476 a board is set IP address 192.168.10.128, you open
477 "[http://192.168.10.128:8080](http://192.168.10.128:8080)".
478
479 When you success to connect to board, your web browser show these web
480 UI.
481
482 ### PC View
483
484 ![](images/image4.png)
485
486 ### Mobile View
487
488 ![](images/image5.png)
489
490
491 ## Appendix 4. How to configure Special Keyboard.
492
493 ### How to get configuration tool.
494
495 This description is targeting to [this type of special
496 keyboard](https://amzn.asia/d/dUxGK5Q). 
497
498 The usb-12key-kbd-prog is unofficial community tool of this key board
499 that is possible to use linux.  Official windows tool is possible to get
500 official site.
501
502 Usage of usb-12key-kbd-prog is please refer to upstream site.
503
504 Upstream:
505 [https://github.com/NeoCat/usb-12key-kbd-prog](https://github.com/NeoCat/usb-12key-kbd-prog)
506
507 ### Key Map.
508 | Key | Container |
509 |---|---|
510 | A | Momi IVI |
511 | C | Crash IVI guest |
512 | D | Qt IVI |
513 | G | Flutter IVI |
514
515 # Reference webpages
516  1. [eLinux](https://elinux.org/R-Car/AGL)
517  1. [Kingfisher Board](https://elinux.org/R-Car/Boards/Kingfisher)
518  1. [R-Car M3SK](https://elinux.org/R-Car/Boards/M3SK#Flashing_firmware)
519  1. [agl reference machines](https://docs.automotivelinux.org/en/master/#02_hardware_support/01_Supported_Hardware_Overview/)
520  1. [AGL Tech Day Presenation](https://static.sched.com/hosted_files/agltechday2022/3b/agl-techday-202204.pdf)
521  1. [Build AGL Image](https://docs.automotivelinux.org/en/master/#01_Getting_Started/02_Building_AGL_Image/0_Build_Process_Overview/)
522  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/)