@@ -23,8 +23,8 @@ def tap_uos_net(names, vmid, config):
23
23
24
24
if uos_type in ("CLEARLINUX" , "ANDROID" , "ALIOS" ):
25
25
if board_name in ("apl-mrb" , "apl-up2" ):
26
- print ('if [ ! -f "/data/$5/$5 .img" ]; then' , file = config )
27
- print (' echo "no /data/$5/$5 .img, exit"' , file = config )
26
+ print ('if [ ! -f "/data/$3/$3 .img" ]; then' , file = config )
27
+ print (' echo "no /data/$3/$3 .img, exit"' , file = config )
28
28
print (" exit" , file = config )
29
29
print ("fi" , file = config )
30
30
print ("" , file = config )
@@ -40,7 +40,7 @@ def tap_uos_net(names, vmid, config):
40
40
if uos_type in ("CLEARLINUX" , "ANDROID" , "ALIOS" ):
41
41
if board_name in ("apl-mrb" , "apl-up2" ):
42
42
print ("# create a unique tap device for each VM" , file = config )
43
- print ("tap=tap_$6 " , file = config )
43
+ print ("tap=tap_$4 " , file = config )
44
44
print ('tap_exist=$(ip a | grep "$tap" | awk \' {print $1}\' )' , file = config )
45
45
print ('if [ "$tap_exist"x != "x" ]; then' , file = config )
46
46
print (' echo "tap device existed, reuse $tap"' , file = config )
@@ -155,7 +155,7 @@ def boot_image_type(args, vmid, config):
155
155
return
156
156
157
157
print ('boot_dev_flag=",b"' , file = config )
158
- print ("if [ $7 == 1 ];then" , file = config )
158
+ print ("if [ $5 == 1 ];then" , file = config )
159
159
print (' boot_image_option="--vsbl /usr/share/acrn/bios/VSBL_debug.bin"' , file = config )
160
160
print ("else" , file = config )
161
161
print (' boot_image_option="--vsbl /usr/share/acrn/bios/VSBL.bin"' , file = config )
@@ -177,11 +177,9 @@ def interrupt_storm(names, vmid, config):
177
177
178
178
def gvt_arg_set (uos_type , config ):
179
179
180
- if uos_type not in ('CLEARLINUX' , 'ANDROID' , 'ALIOS' ):
180
+ if uos_type not in ('CLEARLINUX' , 'ANDROID' , 'ALIOS' , 'WINDOWS' ):
181
181
return
182
- print ("GVT_args=$3" , file = config )
183
- print ('boot_GVT_option=" -s 0:2:0,pci-gvt -G "' , file = config )
184
- print ("" , file = config )
182
+ print (' -s 2,pci-gvt -G "$2" \\ ' , file = config )
185
183
186
184
187
185
def log_level_set (uos_type , config ):
@@ -246,8 +244,8 @@ def function_help(config):
246
244
247
245
248
246
def uos_launch (names , args , vmid , config ):
247
+
249
248
gvt_args = args ['gvt_args' ][vmid ]
250
- cpu_num = int (args ['cpu_num' ][vmid ])
251
249
uos_type = names ['uos_types' ][vmid ]
252
250
launch_uos = '_' .join (uos_type .lower ().split ())
253
251
@@ -256,39 +254,40 @@ def uos_launch(names, args, vmid, config):
256
254
print ("" , file = config )
257
255
print ("case $launch_type in" , file = config )
258
256
print (' 1) echo "Launch clearlinux UOS"' , file = config )
259
- print (' launch_clearlinux 1 {} "{}" 0x070F00 clearlinux "LaaG" $debug' .format (cpu_num , gvt_args ), file = config )
257
+ print (' launch_clearlinux 1 "{}" clearlinux "LaaG" $debug' .format (gvt_args ), file = config )
260
258
print (" ;;" , file = config )
261
259
print (' 2) echo "Launch android UOS"' , file = config )
262
- print (' launch_android 1 {} "{}" 0x070F00 android "AaaG" $debug' .format (cpu_num , gvt_args ), file = config )
260
+ print (' launch_android 1 "{}" android "AaaG" $debug' .format (gvt_args ), file = config )
263
261
print (" ;;" , file = config )
264
262
print (' 4) echo "Launch two clearlinux UOSs"' , file = config )
265
- print (' launch_clearlinux 1 {} "{}" 0x00000C clearlinux "L1aaG" $debug &' .format (cpu_num , gvt_args ), file = config )
263
+ print (' launch_clearlinux 1 "{}" clearlinux "L1aaG" $debug &' .format (gvt_args ), file = config )
266
264
print (" sleep 5" , file = config )
267
- print (' launch_clearlinux 2 {} "{}" 0x070F00 clearlinux_dup "L2aaG" $debug' .format (cpu_num , gvt_args ), file = config )
265
+ print (' launch_clearlinux 2 "{}" clearlinux_dup "L2aaG" $debug' .format (gvt_args ), file = config )
268
266
print (" ;;" , file = config )
269
267
print (' 5) echo "Launch alios UOS"' , file = config )
270
- print (' launch_alios 1 {} "{}" 0x070F00 alios "AliaaG" $debug' .format (cpu_num , gvt_args ), file = config )
268
+ print (' launch_alios 1 "{}" alios "AliaaG" $debug' .format (gvt_args ), file = config )
269
+
271
270
print (" ;;" , file = config )
272
271
print ("esac" , file = config )
273
272
print ("" , file = config )
274
273
print ("umount /data" , file = config )
275
274
276
275
if uos_type not in ("CLEARLINUX" , "ANDROID" , "ALIOS" ):
277
276
if uos_type == "VXWORKS" :
278
- print ("launch_{} 1 {} " .format (launch_uos , cpu_num ), file = config )
277
+ print ("launch_{} 1" .format (launch_uos ), file = config )
279
278
if uos_type == "PREEMPT-RT LINUX" :
280
- print ("launch_{} {} " .format (launch_uos , cpu_num ), file = config )
279
+ print ("launch_{}" .format (launch_uos ), file = config )
281
280
if uos_type == "WINDOWS" :
282
- print ('launch_{} 1 {} "{}"' .format (launch_uos , cpu_num , gvt_args ), file = config )
281
+ print ('launch_{} 1 "{}"' .format (launch_uos , gvt_args ), file = config )
283
282
if uos_type == "ZEPHYR" :
284
- print ("launch_{} 1 {} " .format (launch_uos , cpu_num ), file = config )
283
+ print ("launch_{} 1" .format (launch_uos ), file = config )
285
284
286
285
if is_nuc_clr (names , vmid ):
287
286
print ('if [ "$1" = "-C" ];then' , file = config )
288
287
print (' echo "runc_container"' , file = config )
289
288
print (" run_container" , file = config )
290
289
print ("else" , file = config )
291
- print (' launch_{} 1 {} "{}" 0x070F00 ' .format (launch_uos , cpu_num , gvt_args ), file = config )
290
+ print (' launch_{} 1 "{}"' .format (launch_uos , gvt_args ), file = config )
292
291
print ("fi" , file = config )
293
292
294
293
@@ -421,7 +420,7 @@ def dm_arg_set(names, sel, dm, vmid, config):
421
420
sos_vmid = launch_cfg_lib .get_sos_vmid ()
422
421
423
422
# clearlinux/android/alios
424
- dm_str = 'acrn-dm -A -m $mem_size $boot_GVT_option"$GVT_args" -s 0:0,hostbridge -s 1:0,lpc -U {}' .format (scenario_uuid [vmid + sos_vmid ])
423
+ dm_str = 'acrn-dm -A -m $mem_size -s 0:0,hostbridge -s 1:0,lpc -U {}' .format (scenario_uuid [vmid + sos_vmid ])
425
424
if uos_type in ("CLEARLINUX" , "ANDROID" , "ALIOS" ):
426
425
if uos_type == "CLEARLINUX" :
427
426
print ("{} \\ " .format (dm_str ), file = config )
@@ -474,10 +473,12 @@ def dm_arg_set(names, sel, dm, vmid, config):
474
473
# windows
475
474
if uos_type == "WINDOWS" :
476
475
print ("acrn-dm -A -m $mem_size -s 0:0,hostbridge -s 1:0,lpc -U {} \\ " .format (scenario_uuid [vmid + sos_vmid ]), file = config )
477
- print (' -s 2,pci-gvt -G "$3" \\ ' , file = config )
478
476
print (" -s {},virtio-blk,./win10-ltsc.img \\ " .format (launch_cfg_lib .virtual_dev_slot ("virtio-blk" )), file = config )
479
477
480
- # vbootloader of ovmf
478
+ # GVT args set
479
+ gvt_arg_set (uos_type , config )
480
+
481
+ # vbootloader of ovmf
481
482
#if uos_type != "PREEMPT-RT LINUX" and dm['vbootloader'][vmid] == "ovmf":
482
483
if dm ['vbootloader' ][vmid ] == "ovmf" :
483
484
print (" --ovmf /usr/share/acrn/bios/OVMF.fd \\ " , file = config )
@@ -507,7 +508,7 @@ def dm_arg_set(names, sel, dm, vmid, config):
507
508
print (" $intr_storm_monitor \\ " , file = config )
508
509
if dm ['vbootloader' ][vmid ] == "vsbl" :
509
510
print (" $boot_image_option \\ " ,file = config )
510
- print (" -s {},virtio-blk$boot_dev_flag,/data/$5/$5 .img \\ " .format (launch_cfg_lib .virtual_dev_slot ("virtio-blk" )), file = config )
511
+ print (" -s {},virtio-blk$boot_dev_flag,/data/$3/$3 .img \\ " .format (launch_cfg_lib .virtual_dev_slot ("virtio-blk" )), file = config )
511
512
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 )
512
513
else :
513
514
print (" -s {},virtio-blk,/home/clear/uos/uos.img \\ " .format (launch_cfg_lib .virtual_dev_slot ("virtio-blk" )), file = config )
@@ -540,7 +541,6 @@ def gen(names, pt_sel, dm, vmid, config):
540
541
delay_use_usb_storage (uos_type , config )
541
542
mem_size_set (names , dm , vmid , config )
542
543
interrupt_storm (names , vmid , config )
543
- gvt_arg_set (uos_type , config )
544
544
log_level_set (uos_type , config )
545
545
546
546
# gen acrn-dm args
0 commit comments