7
7
import pt
8
8
9
9
10
- def is_nuc_clr (names , vmid ):
10
+ def is_nuc_whl_clr (names , vmid ):
11
11
uos_type = names ['uos_types' ][vmid ]
12
12
board_name = names ['board_name' ]
13
13
14
- if uos_type == "CLEARLINUX" and 'nuc' in board_name :
14
+ if uos_type == "CLEARLINUX" and board_name not in ( "apl-mrb" , "apl-up2" ) :
15
15
return True
16
16
17
17
return False
18
18
19
19
20
+ def is_mount_needed (names , vmid ):
21
+ uos_type = names ['uos_types' ][vmid ]
22
+ if uos_type in ("CLEARLINUX" , "ANDROID" , "ALIOS" ) and not is_nuc_whl_clr (names , vmid ):
23
+ return True
24
+
25
+ return False
26
+
27
+
20
28
def tap_uos_net (names , vmid , config ):
21
29
uos_type = names ['uos_types' ][vmid ]
22
30
board_name = names ['board_name' ]
@@ -118,7 +126,7 @@ def run_container(board_name, uos_type, config):
118
126
if 'nuc' in board_name :
119
127
board_name = 'nuc'
120
128
121
- if board_name == "apl-up2" or uos_type != "CLEARLINUX" :
129
+ if board_name not in ( "apl-mrb" , "nuc" ) or uos_type != "CLEARLINUX" :
122
130
return
123
131
124
132
print ("function run_container()" , file = config )
@@ -206,7 +214,7 @@ def boot_image_type(args, vmid, config):
206
214
def interrupt_storm (names , vmid , config ):
207
215
uos_type = names ['uos_types' ][vmid ]
208
216
209
- if uos_type not in ("CLEARLINUX" , "ANDROID" , "ALIOS" ) or is_nuc_clr (names , vmid ):
217
+ if uos_type not in ("CLEARLINUX" , "ANDROID" , "ALIOS" ) or is_nuc_whl_clr (names , vmid ):
210
218
return
211
219
212
220
print ("#interrupt storm monitor for pass-through devices, params order:" , file = config )
@@ -249,7 +257,7 @@ def mem_size_set(names, args, vmid, config):
249
257
uos_type = names ['uos_types' ][vmid ]
250
258
mem_size = args ['mem_size' ][vmid ]
251
259
252
- if uos_type not in ("CLEARLINUX" , "ANDROID" , "ALIOS" ) or is_nuc_clr (names , vmid ):
260
+ if uos_type not in ("CLEARLINUX" , "ANDROID" , "ALIOS" ) or is_nuc_whl_clr (names , vmid ):
253
261
print ("mem_size={}M" .format (mem_size ), file = config )
254
262
return
255
263
@@ -274,8 +282,11 @@ def uos_launch(names, args, vmid, config):
274
282
gvt_args = args ['gvt_args' ][vmid ]
275
283
uos_type = names ['uos_types' ][vmid ]
276
284
launch_uos = launch_cfg_lib .undline_name (uos_type ).lower ()
285
+ board_name = names ['board_name' ]
286
+ if 'nuc' in board_name :
287
+ board_name = 'nuc'
277
288
278
- if uos_type in ( "CLEARLINUX" , "ANDROID" , "ALIOS" ) and not is_nuc_clr ( names , vmid ):
289
+ if uos_type == "CLEARLINUX" and board_name in ( "apl-mrb" , "nuc" ):
279
290
print ('if [ "$1" = "-C" ];then' , file = config )
280
291
print (' if [ $(hostname) = "runc" ]; then' , file = config )
281
292
print (' echo "Already in container exit!"' , file = config )
@@ -296,7 +307,7 @@ def uos_launch(names, args, vmid, config):
296
307
if uos_type in ("CLEARLINUX" , "WINDOWS" ):
297
308
print ('launch_{} 1 "{}"' .format (launch_uos , gvt_args ), file = config )
298
309
299
- if uos_type in ( "CLEARLINUX" , "ANDROID" , "ALIOS" ) and not is_nuc_clr (names , vmid ):
310
+ if is_mount_needed (names , vmid ):
300
311
print ("" , file = config )
301
312
print ('launch_{} {} "{}" "{}" $debug' .format (launch_uos , vmid , gvt_args , vmid ), file = config )
302
313
print ("" , file = config )
@@ -309,7 +320,7 @@ def launch_end(names, args, vmid, config):
309
320
uos_type = names ['uos_types' ][vmid ]
310
321
mem_size = args ["mem_size" ][vmid ]
311
322
312
- if uos_type in ("CLEARLINUX" , "ANDROID" , "ALIOS" ) and not is_nuc_clr (names , vmid ):
323
+ if uos_type in ("CLEARLINUX" , "ANDROID" , "ALIOS" ) and not is_nuc_whl_clr (names , vmid ):
313
324
print ("debug=0" , file = config )
314
325
print ("" , file = config )
315
326
print ('while getopts "M:hdC" opt' , file = config )
@@ -335,7 +346,7 @@ def launch_end(names, args, vmid, config):
335
346
print ("done" , file = config )
336
347
print ("" , file = config )
337
348
338
- if uos_type in ( "CLEARLINUX" , "ANDROID" , "ALIOS" ) and not is_nuc_clr (names , vmid ):
349
+ if is_mount_needed (names , vmid ):
339
350
root_fs = args ['rootfs_dev' ][vmid ]
340
351
341
352
print ('if [ ! -b "{}" ]; then' .format (root_fs ), file = config )
@@ -435,7 +446,7 @@ def dm_arg_set(names, sel, dm, vmid, config):
435
446
else :
436
447
print ('{} $npk_virt \\ ' .format (dm_str ), file = config )
437
448
438
- if board_name == "apl-up2" or is_nuc_clr (names , vmid ):
449
+ if board_name == "apl-up2" or is_nuc_whl_clr (names , vmid ):
439
450
print (" $logger_setting \\ " , file = config )
440
451
441
452
if uos_type in ("CLEARLINUX" , "ANDROID" , "ALIOS" ):
@@ -446,7 +457,7 @@ def dm_arg_set(names, sel, dm, vmid, config):
446
457
if board_name == "apl-mrb" :
447
458
print (" --pm_notify_channel ioc \\ " , file = config )
448
459
449
- if is_nuc_clr (names , vmid ):
460
+ if is_nuc_whl_clr (names , vmid ):
450
461
print (" --pm_notify_channel uart \\ " , file = config )
451
462
print (' --pm_by_vuart pty,/run/acrn/life_mngr_$vm_name \\ ' , file = config )
452
463
print (' -l com2,/run/acrn/life_mngr_$vm_name \\ ' , file = config )
@@ -506,7 +517,7 @@ def dm_arg_set(names, sel, dm, vmid, config):
506
517
print (" -i /run/acrn/ioc_$vm_name,0x20 \\ " , file = config )
507
518
print (" -l com2,/run/acrn/ioc_$vm_name \\ " , file = config )
508
519
509
- if not is_nuc_clr (names , vmid ):
520
+ if not is_nuc_whl_clr (names , vmid ):
510
521
print (" -s {},wdt-i6300esb \\ " .format (launch_cfg_lib .virtual_dev_slot ("wdt-i6300esb" )), file = config )
511
522
print (" $intr_storm_monitor \\ " , file = config )
512
523
print (" -s {},xhci,1-1:1-2:1-3:2-1:2-2:2-3:cap=apl \\ " .format (launch_cfg_lib .virtual_dev_slot ("xhci" )), file = config )
0 commit comments