def parse_boot_info(): err_dic = {} if 'SOS_VM' in common.VM_TYPES.values(): sos_cmdlines = list( common.get_leaf_tag_map(common.SCENARIO_INFO_FILE, "board_private", "bootargs").values()) sos_rootfs = list( common.get_leaf_tag_map(common.SCENARIO_INFO_FILE, "board_private", "rootfs").values()) (err_dic, vuart0_dic, vuart1_dic) = scenario_cfg_lib.get_sos_vuart_settings( launch_flag=False) else: sos_cmdlines = list( common.get_leaf_tag_map(common.SCENARIO_INFO_FILE, "os_config", "bootargs").values()) sos_rootfs = list( common.get_leaf_tag_map(common.SCENARIO_INFO_FILE, "os_config", "rootfs").values()) (err_dic, vuart0_dic, vuart1_dic) = scenario_cfg_lib.get_sos_vuart_settings( launch_flag=False) return (err_dic, sos_cmdlines, sos_rootfs, vuart0_dic, vuart1_dic)
def dm_arg_set(names, sel, virt_io, dm, vmid, config): uos_type = names['uos_types'][vmid] board_name = names['board_name'] boot_image_type(dm, vmid, config) # uuid get sos_vmid = launch_cfg_lib.get_sos_vmid() scenario_uuid = launch_cfg_lib.get_scenario_uuid(vmid, sos_vmid) # clearlinux/android/alios print('acrn-dm -A -m $mem_size -s 0:0,hostbridge -U {} \\'.format( scenario_uuid), file=config) if launch_cfg_lib.is_linux_like(uos_type) or uos_type in ("ANDROID", "ALIOS"): if uos_type in ("ANDROID", "ALIOS"): print(' $npk_virt \\', file=config) print(" -s {},virtio-rpmb \\".format( launch_cfg_lib.virtual_dev_slot("virtio-rpmb")), file=config) print(" --enable_trusty \\", file=config) # mac_seed print(" --mac_seed $mac_seed \\", file=config) if dm['rtos_type'][vmid] != "no": if virt_io: print(" --virtio_poll 1000000 \\", file=config) if dm['rtos_type'][vmid] == "Soft RT": print(" --rtvm \\", file=config) if dm['rtos_type'][vmid] == "Hard RT": print(" --lapic_pt \\", file=config) # windows if uos_type == "WINDOWS": print(" --windows \\", file=config) # pm_channel set if dm['pm_channel'][vmid] and dm['pm_channel'][vmid] != None: pm_key = dm['pm_channel'][vmid] pm_vuart = "--pm_notify_channel uart" if vmid in dm["allow_trigger_s5"] and dm["allow_trigger_s5"][ vmid] == 'y': pm_vuart = pm_vuart + ",allow_trigger_s5 " else: pm_vuart = pm_vuart + " " if pm_key == "vuart1(tty)": vuart_base = launch_cfg_lib.get_vuart1_from_scenario(sos_vmid + vmid) if vuart_base == "INVALID_COM_BASE": err_key = "uos:id={}:poweroff_channel".format(vmid) launch_cfg_lib.ERR_LIST[ err_key] = "vuart1 of VM{} in scenario file should select 'SOS_COM2_BASE'".format( sos_vmid + vmid) return scenario_cfg_lib.get_sos_vuart_settings() print(" {} \\".format(pm_vuart + launch_cfg_lib.PM_CHANNEL_DIC[pm_key] + scenario_cfg_lib.SOS_UART1_VALID_NUM), file=config) elif pm_key == "vuart1(pty)": print(" {} \\".format(pm_vuart + launch_cfg_lib.PM_CHANNEL_DIC[pm_key]), file=config) else: print(" {} \\".format(launch_cfg_lib.PM_CHANNEL_DIC[pm_key]), file=config) # set logger_setting for all VMs print(" $logger_setting \\", file=config) # GVT args set gvt_arg_set(dm, vmid, uos_type, config) # XHCI args set xhci_args_set(dm, vmid, config) # VIRTIO args set virtio_args_set(dm, virt_io, vmid, config) # vbootloader setting vboot_arg_set(dm, vmid, config) # pcpu-list args set pcpu_arg_set(dm, vmid, config) # shm regions args set shm_arg_set(dm, vmid, config) # ssram set ssram_enabled = 'n' try: ssram_enabled = common.get_hv_item_tag(common.SCENARIO_INFO_FILE, "FEATURES", "SSRAM", "SSRAM_ENABLED") except: pass if uos_type == "PREEMPT-RT LINUX" and ssram_enabled == 'y': print(" --ssram \\", file=config) for value in sel.bdf.values(): if value[vmid]: print(" $intr_storm_monitor \\", file=config) break if uos_type != "PREEMPT-RT LINUX": print(" -s 1:0,lpc \\", file=config) # redirect console if dm['vuart0'][vmid] == "Enable": print(" -l com1,stdio \\", file=config) if launch_cfg_lib.is_linux_like(uos_type) or uos_type in ("ANDROID", "ALIOS"): if board_name == "apl-mrb": print(" -i /run/acrn/ioc_$vm_name,0x20 \\", file=config) print(" -l com2,/run/acrn/ioc_$vm_name \\", file=config) if not is_nuc_whl_linux(names, vmid): print(" -s {},wdt-i6300esb \\".format( launch_cfg_lib.virtual_dev_slot("wdt-i6300esb")), file=config) set_dm_pt(names, sel, vmid, config, dm) if dm['console_vuart'][vmid] == "Enable": print(" -s {},uart,vuart_idx:0 \\".format( launch_cfg_lib.virtual_dev_slot("console_vuart")), file=config) for vuart_id in dm["communication_vuarts"][vmid]: if not vuart_id: break print(" -s {},uart,vuart_idx:{} \\".format( launch_cfg_lib.virtual_dev_slot( "communication_vuart_{}".format(vuart_id)), vuart_id), file=config) print(" $vm_name", file=config) print("}", file=config)
def dm_arg_set(names, sel, virt_io, dm, vmid, config): uos_type = names['uos_types'][vmid] board_name = names['board_name'] boot_image_type(dm, vmid, config) # uuid get scenario_uuid = launch_cfg_lib.get_scenario_uuid(vmid) sos_vmid = launch_cfg_lib.get_sos_vmid() # clearlinux/android/alios print('acrn-dm -A -m $mem_size -s 0:0,hostbridge -U {} \\'.format( scenario_uuid), file=config) if launch_cfg_lib.is_linux_like(uos_type) or uos_type in ("ANDROID", "ALIOS"): if uos_type in ("ANDROID", "ALIOS"): print(' $npk_virt \\', file=config) print(" -s {},virtio-rpmb \\".format( launch_cfg_lib.virtual_dev_slot("virtio-rpmb")), file=config) print(" --enable_trusty \\", file=config) # mac_seed print(" --mac_seed $mac_seed \\", file=config) if dm['rtos_type'][vmid] != "no": if virt_io: print(" --virtio_poll 1000000 \\", file=config) if dm['rtos_type'][vmid] == "Soft RT": print(" --rtvm \\", file=config) if dm['rtos_type'][vmid] == "Hard RT": print(" --lapic_pt \\", file=config) # windows if uos_type == "WINDOWS": print(" --windows \\", file=config) # pm_channel set if dm['pm_channel'][vmid] and dm['pm_channel'][vmid] != None: pm_key = dm['pm_channel'][vmid] if pm_key == "vuart1(tty)": vuart_base = launch_cfg_lib.get_vuart1_from_scenario(sos_vmid + vmid) if vuart_base == "INVALID_COM_BASE": err_key = "uos:id={}:poweroff_channel".format(vmid) launch_cfg_lib.ERR_LIST[ err_key] = "vuart1 of VM{} in scenario file should select 'SOS_COM2_BASE'".format( sos_vmid + vmid) return scenario_cfg_lib.get_sos_vuart_settings() print(" {} \\".format(launch_cfg_lib.PM_CHANNEL_DIC[pm_key] + scenario_cfg_lib.SOS_UART1_VALID_NUM), file=config) # set logger_setting for all VMs print(" $logger_setting \\", file=config) # XHCI args set xhci_args_set(dm, vmid, config) # VIRTIO args set virtio_args_set(dm, virt_io, vmid, config) # GVT args set gvt_arg_set(dm, vmid, uos_type, config) # vbootloader setting vboot_arg_set(dm, vmid, config) # pcpu-list args set pcpu_arg_set(dm, vmid, config) # shm regions args set shm_arg_set(dm, vmid, config) for value in sel.bdf.values(): if value[vmid]: print(" $intr_storm_monitor \\", file=config) break if uos_type != "PREEMPT-RT LINUX": print(" -s 1:0,lpc \\", file=config) # redirect console if dm['vuart0'][vmid] == "Enable": print(" -l com1,stdio \\", file=config) if launch_cfg_lib.is_linux_like(uos_type) or uos_type in ("ANDROID", "ALIOS"): if uos_type != "PREEMPT-RT LINUX": print(" -s {},virtio-hyper_dmabuf \\".format( launch_cfg_lib.virtual_dev_slot("virtio-hyper_dmabuf")), file=config) if board_name == "apl-mrb": print(" -i /run/acrn/ioc_$vm_name,0x20 \\", file=config) print(" -l com2,/run/acrn/ioc_$vm_name \\", file=config) if not is_nuc_whl_linux(names, vmid): print(" -s {},wdt-i6300esb \\".format( launch_cfg_lib.virtual_dev_slot("wdt-i6300esb")), file=config) set_dm_pt(names, sel, vmid, config) print(" $vm_name", file=config) print("}", file=config)