From fca8750ba600e3d3cbad3d4b5030c07cbd88842e Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Thu, 14 May 2020 16:27:18 +0800 Subject: [PATCH] acrn-config: generate console=ttyS0 for PRE Launched VM Remove pre-launched VM console setting in scenario xml and leave it configured in bootargs directly. Tracked-On: #4808 Signed-off-by: Wei Liu Acked-by: Victor Sun --- misc/acrn-config/library/scenario_cfg_lib.py | 13 ----- .../scenario_config/scenario_item.py | 4 -- .../scenario_config/vm_configurations_c.py | 49 +++++++++---------- .../scenario_config/vm_configurations_h.py | 3 -- .../config-xmls/apl-mrb/logical_partition.xml | 4 +- .../apl-up2-n3350/logical_partition.xml | 4 +- .../config-xmls/apl-up2/logical_partition.xml | 4 +- .../xmls/config-xmls/ehl-crb-b/hybrid.xml | 2 +- .../ehl-crb-b/logical_partition.xml | 4 +- .../config-xmls/generic/logical_partition.xml | 4 +- .../nuc6cayh/logical_partition.xml | 4 +- .../nuc7i7dnb/logical_partition.xml | 4 +- .../whl-ipc-i5/logical_partition.xml | 4 +- .../whl-ipc-i7/logical_partition.xml | 4 +- 14 files changed, 43 insertions(+), 64 deletions(-) diff --git a/misc/acrn-config/library/scenario_cfg_lib.py b/misc/acrn-config/library/scenario_cfg_lib.py index 4ac0a3e11..30a39c865 100644 --- a/misc/acrn-config/library/scenario_cfg_lib.py +++ b/misc/acrn-config/library/scenario_cfg_lib.py @@ -381,19 +381,6 @@ def os_kern_args_check(id_kern_args_dic, prime_item, item): ERR_LIST[key] = "VM os config kernel service os should be SOS_VM_BOOTARGS" -def os_kern_console_check(tty_console, prime_item, item): - """ - Check os kernel console - :param prime_item: the prime item in xml file - :param item: vm os config console item in xml - :return: None - """ - - if tty_console and "ttyS" not in tty_console: - key = "hv:{},{}".format(prime_item, item) - ERR_LIST[key] = "VM os config kernel console should be ttyS[0..3]" - - def os_kern_load_addr_check(id_kern_load_addr_dic, prime_item, item): """ Check os kernel load address diff --git a/misc/acrn-config/scenario_config/scenario_item.py b/misc/acrn-config/scenario_config/scenario_item.py index 4eeb56bdd..35642a260 100644 --- a/misc/acrn-config/scenario_config/scenario_item.py +++ b/misc/acrn-config/scenario_config/scenario_item.py @@ -73,7 +73,6 @@ class CfgOsKern: kern_type = {} kern_mod = {} kern_args = {} - kern_console = {} kern_load_addr = {} kern_entry_addr = {} ramdisk_mod = {} @@ -93,8 +92,6 @@ class CfgOsKern: self.scenario_info, "os_config", "kern_mod") self.kern_args = common.get_leaf_tag_map( self.scenario_info, "os_config", "bootargs") - self.kern_console = common.get_hv_item_tag( - self.scenario_info, "DEBUG_OPTIONS", "SERIAL_CONSOLE") self.kern_load_addr = common.get_leaf_tag_map( self.scenario_info, "os_config", "kern_load_addr") self.kern_entry_addr = common.get_leaf_tag_map( @@ -111,7 +108,6 @@ class CfgOsKern: scenario_cfg_lib.os_kern_type_check(self.kern_type, "os_config", "kern_type") scenario_cfg_lib.os_kern_mod_check(self.kern_mod, "os_config", "kern_mod") scenario_cfg_lib.os_kern_args_check(self.kern_args, "os_config", "kern_args") - scenario_cfg_lib.os_kern_console_check(self.kern_console, "DEBUG_OPTIONS", "SERIAL_CONSOLE") scenario_cfg_lib.os_kern_load_addr_check(self.kern_load_addr, "os_config", "kern_load_addr") scenario_cfg_lib.os_kern_entry_addr_check(self.kern_entry_addr, "os_config", "kern_entry_addr") diff --git a/misc/acrn-config/scenario_config/vm_configurations_c.py b/misc/acrn-config/scenario_config/vm_configurations_c.py index 0f9af4e2a..cde6ef315 100644 --- a/misc/acrn-config/scenario_config/vm_configurations_c.py +++ b/misc/acrn-config/scenario_config/vm_configurations_c.py @@ -136,6 +136,29 @@ def vuart_output(vm_type, i, vm_info, config): print("\t\t},", file=config) +def split_cmdline(cmd_str, config): + + cmd_list = [i for i in cmd_str.strip('"').split() if i != ''] + + if cmd_list: + cmd_len = len(cmd_list) + i = 0 + for cmd_arg in cmd_list: + if not cmd_arg.strip(): + continue + + if i == 0: + print('"', end="", file=config) + + if i % 4 == 0 and i != 0: + print("\\\n\t\t\t\t", end="", file=config) + + print('{} '.format(cmd_arg), end="", file=config) + i += 1 + if i == cmd_len: + print('"', file=config) + + def is_need_epc(epc_section, i, config): """ Check if it is need epc section @@ -306,8 +329,7 @@ def gen_pre_launch_vm(vm_type, vm_i, vm_info, config): print("\t\t\t.kernel_entry_addr = {0},".format(vm_info.os_cfg.kern_entry_addr[vm_i]), file=config) if vm_i in vm_info.os_cfg.kern_args.keys() and vm_info.os_cfg.kern_args[vm_i]: - print("\t\t\t.bootargs = VM{0}_CONFIG_OS_BOOTARG_CONSOLE\t\\".format(vm_i), file=config) - print("\t\t\t\tVM{0}_CONFIG_OS_BOOTARG_MAXCPUS\t\t\\".format(vm_i), file=config) + print("\t\t\t.bootargs = ", end="", file=config) split_cmdline(vm_info.os_cfg.kern_args[vm_i].strip(), config) print("\t\t},", file=config) # VUART @@ -337,29 +359,6 @@ def gen_post_launch_vm(vm_type, vm_i, vm_info, config): print("\t},", file=config) -def split_cmdline(cmd_str, config): - - cmd_list = [i for i in cmd_str.split() if i != ''] - - if cmd_list: - cmd_len = len(cmd_list) - i = 0 - for cmd_arg in cmd_list: - if not cmd_arg.strip(): - continue - - if i == 0: - print('\\\n\t\t\t\t"', end="", file=config) - - if i % 4 == 0 and i != 0: - print("\\\n\t\t\t\t", end="", file=config) - - print('{} '.format(cmd_arg), end="", file=config) - i += 1 - if i == cmd_len: - print('"', file=config) - - def pre_launch_definiation(vm_info, config): for vm_i,vm_type in common.VM_TYPES.items(): diff --git a/misc/acrn-config/scenario_config/vm_configurations_h.py b/misc/acrn-config/scenario_config/vm_configurations_h.py index 886dc7007..204f76858 100644 --- a/misc/acrn-config/scenario_config/vm_configurations_h.py +++ b/misc/acrn-config/scenario_config/vm_configurations_h.py @@ -86,9 +86,6 @@ def gen_pre_launch_vm(vm_info, config): print("#define VM{0}_CONFIG_MEM_SIZE_HPA2\t\t{1}UL".format( vm_i, vm_info.mem_info.mem_size_hpa2[vm_i]), file=config) - print('#define VM{0}_CONFIG_OS_BOOTARG_MAXCPUS\t\t"maxcpus={1} "'.format(vm_i, cpu_bits['cpu_num']), file=config) - if vm_info.os_cfg.kern_console: - print('#define VM{0}_CONFIG_OS_BOOTARG_CONSOLE\t\t"console={1} "'.format(vm_i, vm_info.os_cfg.kern_console.strip('/dev/')), file=config) print("", file=config) vm_i += 1 diff --git a/misc/acrn-config/xmls/config-xmls/apl-mrb/logical_partition.xml b/misc/acrn-config/xmls/config-xmls/apl-mrb/logical_partition.xml index 04dee8479..21b976f33 100644 --- a/misc/acrn-config/xmls/config-xmls/apl-mrb/logical_partition.xml +++ b/misc/acrn-config/xmls/config-xmls/apl-mrb/logical_partition.xml @@ -77,7 +77,7 @@ Linux_bzImage - rw root=/dev/mmcblk1p1 rootwait noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable + rw root=/dev/mmcblk1p1 rootwait console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable @@ -127,7 +127,7 @@ Linux_bzImage - rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M + rw rootwait root=/dev/sda3 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable diff --git a/misc/acrn-config/xmls/config-xmls/apl-up2-n3350/logical_partition.xml b/misc/acrn-config/xmls/config-xmls/apl-up2-n3350/logical_partition.xml index 23c044da7..442e74f11 100644 --- a/misc/acrn-config/xmls/config-xmls/apl-up2-n3350/logical_partition.xml +++ b/misc/acrn-config/xmls/config-xmls/apl-up2-n3350/logical_partition.xml @@ -77,7 +77,7 @@ Linux_bzImage - rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable + rw rootwait root=/dev/sda3 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable @@ -126,7 +126,7 @@ Linux_bzImage - rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M + rw rootwait root=/dev/sda3 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable diff --git a/misc/acrn-config/xmls/config-xmls/apl-up2/logical_partition.xml b/misc/acrn-config/xmls/config-xmls/apl-up2/logical_partition.xml index 4451e9e5b..b0ba88217 100644 --- a/misc/acrn-config/xmls/config-xmls/apl-up2/logical_partition.xml +++ b/misc/acrn-config/xmls/config-xmls/apl-up2/logical_partition.xml @@ -78,7 +78,7 @@ Linux_bzImage - rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable + rw rootwait root=/dev/sda3 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable @@ -128,7 +128,7 @@ Linux_bzImage - rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M + rw rootwait root=/dev/sda3 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable diff --git a/misc/acrn-config/xmls/config-xmls/ehl-crb-b/hybrid.xml b/misc/acrn-config/xmls/config-xmls/ehl-crb-b/hybrid.xml index 151ea62e2..c880f5fa6 100644 --- a/misc/acrn-config/xmls/config-xmls/ehl-crb-b/hybrid.xml +++ b/misc/acrn-config/xmls/config-xmls/ehl-crb-b/hybrid.xml @@ -71,7 +71,7 @@ KERNEL_ZEPHYR Zephyr_RawImage - + 0x100000 0x100000 diff --git a/misc/acrn-config/xmls/config-xmls/ehl-crb-b/logical_partition.xml b/misc/acrn-config/xmls/config-xmls/ehl-crb-b/logical_partition.xml index e52f5b750..8b348463e 100644 --- a/misc/acrn-config/xmls/config-xmls/ehl-crb-b/logical_partition.xml +++ b/misc/acrn-config/xmls/config-xmls/ehl-crb-b/logical_partition.xml @@ -75,7 +75,7 @@ Linux_bzImage - rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable + rw rootwait root=/dev/sda3 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable @@ -126,7 +126,7 @@ Linux_bzImage - rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M + rw rootwait root=/dev/sda3 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable diff --git a/misc/acrn-config/xmls/config-xmls/generic/logical_partition.xml b/misc/acrn-config/xmls/config-xmls/generic/logical_partition.xml index 92ecb6e1a..856dbd69c 100644 --- a/misc/acrn-config/xmls/config-xmls/generic/logical_partition.xml +++ b/misc/acrn-config/xmls/config-xmls/generic/logical_partition.xml @@ -79,7 +79,7 @@ Linux_bzImage - rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable + rw rootwait root=/dev/sda3 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable @@ -130,7 +130,7 @@ Linux_bzImage - rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M + rw rootwait root=/dev/sda3 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable diff --git a/misc/acrn-config/xmls/config-xmls/nuc6cayh/logical_partition.xml b/misc/acrn-config/xmls/config-xmls/nuc6cayh/logical_partition.xml index 02ba761a3..47873271d 100644 --- a/misc/acrn-config/xmls/config-xmls/nuc6cayh/logical_partition.xml +++ b/misc/acrn-config/xmls/config-xmls/nuc6cayh/logical_partition.xml @@ -78,7 +78,7 @@ Linux_bzImage - rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable + rw rootwait root=/dev/sda3 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable @@ -128,7 +128,7 @@ Linux_bzImage - rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M + rw rootwait root=/dev/sda3 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable diff --git a/misc/acrn-config/xmls/config-xmls/nuc7i7dnb/logical_partition.xml b/misc/acrn-config/xmls/config-xmls/nuc7i7dnb/logical_partition.xml index 23313d6f8..29710164c 100644 --- a/misc/acrn-config/xmls/config-xmls/nuc7i7dnb/logical_partition.xml +++ b/misc/acrn-config/xmls/config-xmls/nuc7i7dnb/logical_partition.xml @@ -78,7 +78,7 @@ Linux_bzImage - rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable + rw rootwait root=/dev/sda3 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable @@ -129,7 +129,7 @@ Linux_bzImage - rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M + rw rootwait root=/dev/sda3 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable diff --git a/misc/acrn-config/xmls/config-xmls/whl-ipc-i5/logical_partition.xml b/misc/acrn-config/xmls/config-xmls/whl-ipc-i5/logical_partition.xml index 11b1e3fa5..df60b9bbb 100644 --- a/misc/acrn-config/xmls/config-xmls/whl-ipc-i5/logical_partition.xml +++ b/misc/acrn-config/xmls/config-xmls/whl-ipc-i5/logical_partition.xml @@ -78,7 +78,7 @@ Linux_bzImage - rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable + rw rootwait root=/dev/sda3 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable @@ -128,7 +128,7 @@ Linux_bzImage - rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M + rw rootwait root=/dev/sda3 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable diff --git a/misc/acrn-config/xmls/config-xmls/whl-ipc-i7/logical_partition.xml b/misc/acrn-config/xmls/config-xmls/whl-ipc-i7/logical_partition.xml index 437800559..436eba565 100644 --- a/misc/acrn-config/xmls/config-xmls/whl-ipc-i7/logical_partition.xml +++ b/misc/acrn-config/xmls/config-xmls/whl-ipc-i7/logical_partition.xml @@ -78,7 +78,7 @@ Linux_bzImage - rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable + rw rootwait root=/dev/sda3 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable @@ -128,7 +128,7 @@ Linux_bzImage - rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M + rw rootwait root=/dev/sda3 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable