acrn-config: expends parameters and functions to common lib

For purpose to refine the library/common and xx_cfg_lib, should have
to expands parameters and functions to common.py firstly.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
This commit is contained in:
Wei Liu
2020-03-19 21:42:01 +08:00
committed by wenlingz
parent 2d66d39529
commit 78ce220eb9
8 changed files with 344 additions and 325 deletions

View File

@@ -9,6 +9,7 @@ sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '
from launch_item import AvailablePthru, PthruSelected, VirtioDeviceSelect, AcrnDmArgs
import launch_cfg_lib
import com
import common
ACRN_PATH = launch_cfg_lib.SOURCE_ROOT_DIR
ACRN_CONFIG_TARGET = ACRN_PATH + '/misc/acrn-config/xmls/config-xmls/'
@@ -60,6 +61,9 @@ def validate_launch_setting(board_info, scenario_info, launch_info):
:return: return a dictionary contain errors
"""
launch_cfg_lib.ERR_LIST = {}
common.BOARD_INFO_FILE = board_info
common.SCENARIO_INFO_FILE = scenario_info
common.LAUNCH_INFO_FILE = launch_info
launch_cfg_lib.BOARD_INFO_FILE = board_info
launch_cfg_lib.SCENARIO_INFO_FILE = scenario_info
launch_cfg_lib.LAUNCH_INFO_FILE = launch_info
@@ -161,6 +165,9 @@ def main(args):
# 1: generate launch script for 1st post vm launch script
# 2: generate launch script for 2nd post vm launch script
common.BOARD_INFO_FILE = board_info_file
common.SCENARIO_INFO_FILE = scenario_info_file
common.LAUNCH_INFO_FILE = launch_info_file
launch_cfg_lib.BOARD_INFO_FILE = board_info_file
launch_cfg_lib.SCENARIO_INFO_FILE = scenario_info_file
launch_cfg_lib.LAUNCH_INFO_FILE = launch_info_file

View File

@@ -3,6 +3,7 @@
# SPDX-License-Identifier: BSD-3-Clause
#
import board_cfg_lib
import launch_cfg_lib
class AcrnDmArgs:
@@ -26,7 +27,7 @@ class AcrnDmArgs:
self.args["xhci"] = launch_cfg_lib.get_leaf_tag_map(self.launch_info, "usb_xhci")
def check_item(self):
rootfs = launch_cfg_lib.get_rootdev_info(self.board_info)
rootfs = board_cfg_lib.get_rootfs(self.board_info)
launch_cfg_lib.args_aval_check(self.args["uos_type"], "uos_type", launch_cfg_lib.UOS_TYPES)
launch_cfg_lib.args_aval_check(self.args["rtos_type"], "rtos_type", launch_cfg_lib.RTOS_TYPE)
launch_cfg_lib.mem_size_check(self.args["mem_size"], "mem_size")