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