Skip to content

Commit 1c7bf9f

Browse files
Wei Liuwenlingz
authored andcommitted
acrn-config: refine the vbootloader of vm
Refine the vbootloader type of vm, The vbootloader type should be select from vsbl/ovmf/none in webUI item. Tracked-On: #3879 Signed-off-by: Wei Liu <weix.w.liu@intel.com> Acked-by: Victor Sun <victor.sun@intel.com>
1 parent a716235 commit 1c7bf9f

File tree

1 file changed

+17
-8
lines changed
  • misc/acrn-config/launch_config

1 file changed

+17
-8
lines changed

misc/acrn-config/launch_config/com.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,21 @@ def set_dm_pt(names, sel, vmid, config):
403403
sel.bdf["nvme"][vmid][3:5], sel.bdf["nvme"][vmid][6:7]), file=config)
404404

405405

406+
def vboot_arg_set(dm, vmid, config):
407+
"""
408+
Set the argument of vbootloader
409+
:param dm: the dictionary of argument for acrn-dm
410+
:param vmid: ID of the vm
411+
:param config: it is a file pointer to write vboot loader information
412+
:return: None
413+
"""
414+
# TODO: Support to generate '-k' xml config from webUI and to parse it
415+
if dm['vbootloader'][vmid] == "ovmf":
416+
print(" --ovmf /usr/share/acrn/bios/OVMF.fd \\", file=config)
417+
elif dm['vbootloader'][vmid] == "vsbl":
418+
print(" $boot_image_option \\",file=config)
419+
420+
406421
def dm_arg_set(names, sel, dm, vmid, config):
407422

408423
uos_type = names['uos_types'][vmid]
@@ -447,8 +462,6 @@ def dm_arg_set(names, sel, dm, vmid, config):
447462
# hard rt os
448463
if uos_type == "PREEMPT-RT LINUX":
449464
print("acrn-dm -A -m $mem_size -s 0:0,hostbridge -U {} \\".format(scenario_uuid[vmid + sos_vmid]), file=config)
450-
#print(" -k /usr/lib/kernel/default-iot-lts2018-preempt-rt \\", file=config)
451-
print(" -k /usr/lib/kernel/default-iot-lts2018-preempt-rt \\", file=config)
452465
print(" --lapic_pt \\", file=config)
453466
print(" --rtvm \\", file=config)
454467
print(" --virtio_poll 1000000 \\", file=config)
@@ -475,10 +488,8 @@ def dm_arg_set(names, sel, dm, vmid, config):
475488
# GVT args set
476489
gvt_arg_set(uos_type, config)
477490

478-
# vbootloader of ovmf
479-
#if uos_type != "PREEMPT-RT LINUX" and dm['vbootloader'][vmid] == "ovmf":
480-
if dm['vbootloader'][vmid] == "ovmf":
481-
print(" --ovmf /usr/share/acrn/bios/OVMF.fd \\", file=config)
491+
# vbootloader setting
492+
vboot_arg_set(dm, vmid, config)
482493

483494
# redirect console
484495
if dm['console_type'][vmid] == "com1(ttyS0)":
@@ -503,8 +514,6 @@ def dm_arg_set(names, sel, dm, vmid, config):
503514
if not is_nuc_clr(names, vmid):
504515
print(" -s {},wdt-i6300esb \\".format(launch_cfg_lib.virtual_dev_slot("wdt-i6300esb")), file=config)
505516
print(" $intr_storm_monitor \\", file=config)
506-
if dm['vbootloader'][vmid] == "vsbl":
507-
print(" $boot_image_option \\",file=config)
508517
print(" -s {},virtio-blk$boot_dev_flag,/data/$3/$3.img \\".format(launch_cfg_lib.virtual_dev_slot("virtio-blk")), file=config)
509518
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)
510519
else:

0 commit comments

Comments
 (0)