acrn-config: remove rootfs item from PRE Launched VM

The bootarg of rootfs for pre-launched VM is for Linux only and it
should not limited to physical block device which is selectable from
native rootfs list, it might be a USB or RAM device that "X" is variable
in root=/dev/sdX or /dev/ramX. So remove the rootfs setting in XML and
leave it configured in kernel bootargs directly.
Given the SOS must be Linux and its rootfs must be a physical block
device, rootfs item tag is still reserved in xml for SOS VM section.

Tracked-On: #4808
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
This commit is contained in:
Wei Liu 2020-05-18 09:03:17 +08:00 committed by wenlingz
parent 3ecaa62510
commit 65c0cc7362
15 changed files with 18 additions and 65 deletions

View File

@ -434,20 +434,6 @@ def os_kern_entry_addr_check(id_kern_entry_addr_dic, prime_item, item):
ERR_LIST[key] = "VM os config kernel entry address should Hex format"
def os_kern_root_dev_check(id_kern_rootdev_dic, prime_item, item):
"""
Check os kernel rootfs partitions
:param prime_item: the prime item in xml file
:param item: vm os config rootdev item in xml
:return: None
"""
for id_key, kern_rootdev in id_kern_rootdev_dic.items():
if not kern_rootdev:
key = "vm:id={},{},{}".format(id_key, prime_item, item)
ERR_LIST[key] = "VM os config kernel root device should not empty"
def pci_devs_check(pci_bdf_devs, branch_tag, tag_str):
"""
Check vm pci devices

View File

@ -54,9 +54,6 @@ def get_scenario_item_values(board_info, scenario_info):
# pre board_private
(scenario_item_values["vm,board_private,rootfs"], num) = board_cfg_lib.get_rootfs(board_info)
# os config
(scenario_item_values["vm,os_config,rootfs"], num) = board_cfg_lib.get_rootfs(board_info)
scenario_item_values["hv,DEBUG_OPTIONS,RELEASE"] = hv_cfg_lib.N_Y
scenario_item_values["hv,DEBUG_OPTIONS,NPK_LOGLEVEL"] = hv_cfg_lib.get_select_range("DEBUG_OPTIONS", "LOG_LEVEL")
scenario_item_values["hv,DEBUG_OPTIONS,MEM_LOGLEVEL"] = hv_cfg_lib.get_select_range("DEBUG_OPTIONS", "LOG_LEVEL")

View File

@ -76,8 +76,6 @@ class CfgOsKern:
kern_console = {}
kern_load_addr = {}
kern_entry_addr = {}
kern_root_dev = {}
kern_args_append = {}
ramdisk_mod = {}
def __init__(self, scenario_file):
@ -101,12 +99,8 @@ class CfgOsKern:
self.scenario_info, "os_config", "kern_load_addr")
self.kern_entry_addr = common.get_leaf_tag_map(
self.scenario_info, "os_config", "kern_entry_addr")
self.kern_root_dev = common.get_leaf_tag_map(
self.scenario_info, "os_config", "rootfs")
self.ramdisk_mod = common.get_leaf_tag_map(
self.scenario_info, "os_config", "ramdisk_mod")
self.kern_args_append = common.get_leaf_tag_map(
self.scenario_info, "boot_private", "bootargs")
def check_item(self):
"""
@ -120,7 +114,6 @@ class CfgOsKern:
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")
scenario_cfg_lib.os_kern_root_dev_check(self.kern_root_dev, "os_config", "rootdev")
class VuartInfo:

View File

@ -308,7 +308,6 @@ def gen_pre_launch_vm(vm_type, vm_i, vm_info, 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\tVM{0}_CONFIG_OS_BOOTARG_ROOT\t\t\\".format(vm_i), file=config)
split_cmdline(vm_info.os_cfg.kern_args[vm_i].strip(), config)
print("\t\t},", file=config)
# VUART

View File

@ -85,9 +85,6 @@ def gen_pre_launch_vm(vm_info, config):
vm_i, vm_info.mem_info.mem_start_hpa2[vm_i]), file=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)
if vm_info.os_cfg.kern_root_dev:
print('#define VM{0}_CONFIG_OS_BOOTARG_ROOT\t\t"root={1} "'.format(
vm_i, vm_info.os_cfg.kern_root_dev[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:

View File

@ -76,9 +76,8 @@
<kern_type desc="Specify the kernel image type so that hypervisor could load it correctly. Currently support KERNEL_BZIMAGE and KERNEL_ZEPHYR.">KERNEL_BZIMAGE</kern_type>
<kern_mod desc="The tag for kernel image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline.">Linux_bzImage</kern_mod>
<ramdisk_mod desc="The tag for ramdisk image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline."></ramdisk_mod>
<rootfs desc="rootfs for Linux kernel">/dev/mmcblk1p1</rootfs>
<bootargs desc="Specify kernel boot arguments">
rw rootwait noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable
rw root=/dev/mmcblk1p1 rootwait noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable
</bootargs>
</os_config>
<vuart id="0">
@ -127,9 +126,8 @@
<kern_type desc="kernel name">KERNEL_BZIMAGE</kern_type>
<kern_mod desc="The tag for kernel image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline.">Linux_bzImage</kern_mod>
<ramdisk_mod desc="The tag for ramdisk image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline."></ramdisk_mod>
<rootfs desc="rootfs for Linux kernel" readonly="true">/dev/sda3</rootfs>
<bootargs desc="Specify kernel boot arguments">
rw rootwait noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M
rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M
consoleblank=0 tsc=reliable
</bootargs>
</os_config>

View File

@ -76,9 +76,8 @@
<kern_type desc="Specify the kernel image type so that hypervisor could load it correctly. Currently support KERNEL_BZIMAGE and KERNEL_ZEPHYR.">KERNEL_BZIMAGE</kern_type>
<kern_mod desc="The tag for kernel image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline.">Linux_bzImage</kern_mod>
<ramdisk_mod desc="The tag for ramdisk image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline."></ramdisk_mod>
<rootfs desc="rootfs for Linux kernel">/dev/sda3</rootfs>
<bootargs desc="Specify kernel boot arguments">
rw rootwait noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable
rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable
</bootargs>
</os_config>
<vuart id="0">
@ -126,9 +125,8 @@
<kern_type desc="kernel name">KERNEL_BZIMAGE</kern_type>
<kern_mod desc="The tag for kernel image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline.">Linux_bzImage</kern_mod>
<ramdisk_mod desc="The tag for ramdisk image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline."></ramdisk_mod>
<rootfs desc="rootfs for Linux kernel" readonly="true">/dev/sda3</rootfs>
<bootargs desc="Specify kernel boot arguments">
rw rootwait noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M
rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M
consoleblank=0 tsc=reliable
</bootargs>
</os_config>

View File

@ -77,9 +77,8 @@
<kern_type desc="Specify the kernel image type so that hypervisor could load it correctly. Currently support KERNEL_BZIMAGE and KERNEL_ZEPHYR.">KERNEL_BZIMAGE</kern_type>
<kern_mod desc="The tag for kernel image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline.">Linux_bzImage</kern_mod>
<ramdisk_mod desc="The tag for ramdisk image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline."></ramdisk_mod>
<rootfs desc="rootfs for Linux kernel">/dev/sda3</rootfs>
<bootargs desc="Specify kernel boot arguments">
rw rootwait noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable
rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable
</bootargs>
</os_config>
<vuart id="0">
@ -128,9 +127,8 @@
<kern_type desc="kernel name">KERNEL_BZIMAGE</kern_type>
<kern_mod desc="The tag for kernel image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline.">Linux_bzImage</kern_mod>
<ramdisk_mod desc="The tag for ramdisk image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline."></ramdisk_mod>
<rootfs desc="rootfs for Linux kernel" readonly="true">/dev/sda3</rootfs>
<bootargs desc="Specify kernel boot arguments">
rw rootwait noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M
rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M
consoleblank=0 tsc=reliable
</bootargs>
</os_config>

View File

@ -74,9 +74,8 @@
<kern_type desc="Specify the kernel image type so that hypervisor could load it correctly. Currently support KERNEL_BZIMAGE and KERNEL_ZEPHYR.">KERNEL_BZIMAGE</kern_type>
<kern_mod desc="The tag for kernel image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline.">Linux_bzImage</kern_mod>
<ramdisk_mod desc="The tag for ramdisk image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline." />
<rootfs desc="rootfs for Linux kernel">/dev/sda3</rootfs>
<bootargs desc="Specify kernel boot arguments">
rw rootwait noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable
rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable
</bootargs>
</os_config>
<vuart id="0">
@ -126,9 +125,8 @@
<kern_type desc="kernel name">KERNEL_BZIMAGE</kern_type>
<kern_mod desc="The tag for kernel image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline.">Linux_bzImage</kern_mod>
<ramdisk_mod desc="The tag for ramdisk image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline." />
<rootfs desc="rootfs for Linux kernel" readonly="true">/dev/sda3</rootfs>
<bootargs desc="Specify kernel boot arguments">
rw rootwait noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M
rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M
consoleblank=0 tsc=reliable
</bootargs>
</os_config>

View File

@ -78,9 +78,8 @@
<kern_type desc="Specify the kernel image type so that hypervisor could load it correctly. Currently support KERNEL_BZIMAGE and KERNEL_ZEPHYR.">KERNEL_BZIMAGE</kern_type>
<kern_mod desc="The tag for kernel image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline.">Linux_bzImage</kern_mod>
<ramdisk_mod desc="The tag for ramdisk image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline."></ramdisk_mod>
<rootfs desc="rootfs for Linux kernel">/dev/sda3</rootfs>
<bootargs desc="Specify kernel boot arguments">
rw rootwait noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable
rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable
</bootargs>
</os_config>
<vuart id="0">
@ -130,9 +129,8 @@
<kern_type desc="kernel name">KERNEL_BZIMAGE</kern_type>
<kern_mod desc="The tag for kernel image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline.">Linux_bzImage</kern_mod>
<ramdisk_mod desc="The tag for ramdisk image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline."></ramdisk_mod>
<rootfs desc="rootfs for Linux kernel" readonly="true">/dev/sda3</rootfs>
<bootargs desc="Specify kernel boot arguments">
rw rootwait noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M
rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M
consoleblank=0 tsc=reliable
</bootargs>
</os_config>

View File

@ -77,9 +77,8 @@
<kern_type desc="Specify the kernel image type so that hypervisor could load it correctly. Currently support KERNEL_BZIMAGE and KERNEL_ZEPHYR.">KERNEL_BZIMAGE</kern_type>
<kern_mod desc="The tag for kernel image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline.">Linux_bzImage</kern_mod>
<ramdisk_mod desc="The tag for ramdisk image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline."></ramdisk_mod>
<rootfs desc="rootfs for Linux kernel">/dev/sda3</rootfs>
<bootargs desc="Specify kernel boot arguments">
rw rootwait noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable
rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable
</bootargs>
</os_config>
<vuart id="0">
@ -128,9 +127,8 @@
<kern_type desc="kernel name">KERNEL_BZIMAGE</kern_type>
<kern_mod desc="The tag for kernel image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline.">Linux_bzImage</kern_mod>
<ramdisk_mod desc="The tag for ramdisk image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline."></ramdisk_mod>
<rootfs desc="rootfs for Linux kernel" readonly="true">/dev/sda3</rootfs>
<bootargs desc="Specify kernel boot arguments">
rw rootwait noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M
rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M
consoleblank=0 tsc=reliable
</bootargs>
</os_config>

View File

@ -77,9 +77,8 @@
<kern_type desc="Specify the kernel image type so that hypervisor could load it correctly. Currently support KERNEL_BZIMAGE and KERNEL_ZEPHYR.">KERNEL_BZIMAGE</kern_type>
<kern_mod desc="The tag for kernel image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline.">Linux_bzImage</kern_mod>
<ramdisk_mod desc="The tag for ramdisk image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline."></ramdisk_mod>
<rootfs desc="rootfs for Linux kernel">/dev/sda3</rootfs>
<bootargs desc="Specify kernel boot arguments">
rw rootwait noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable
rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable
</bootargs>
</os_config>
<vuart id="0">
@ -129,9 +128,8 @@
<kern_type desc="kernel name">KERNEL_BZIMAGE</kern_type>
<kern_mod desc="The tag for kernel image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline.">Linux_bzImage</kern_mod>
<ramdisk_mod desc="The tag for ramdisk image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline."></ramdisk_mod>
<rootfs desc="rootfs for Linux kernel" readonly="true">/dev/sda3</rootfs>
<bootargs desc="Specify kernel boot arguments">
rw rootwait noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M
rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M
consoleblank=0 tsc=reliable
</bootargs>
</os_config>

View File

@ -26,7 +26,6 @@
<kern_type desc="Specify the kernel image type so that hypervisor could load it correctly. Currently support KERNEL_BZIMAGE and KERNEL_ZEPHYR."></kern_type>
<kern_mod desc="The tag for kernel image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline."></kern_mod>
<ramdisk_mod desc="The tag for ramdisk image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline."></ramdisk_mod>
<rootfs desc="rootfs for Linux kernel"></rootfs>
<bootargs desc="Specify kernel boot arguments"></bootargs>
</os_config>
<vuart id="0">

View File

@ -77,9 +77,8 @@
<kern_type desc="Specify the kernel image type so that hypervisor could load it correctly. Currently support KERNEL_BZIMAGE and KERNEL_ZEPHYR.">KERNEL_BZIMAGE</kern_type>
<kern_mod desc="The tag for kernel image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline.">Linux_bzImage</kern_mod>
<ramdisk_mod desc="The tag for ramdisk image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline."></ramdisk_mod>
<rootfs desc="rootfs for Linux kernel">/dev/sda3</rootfs>
<bootargs desc="Specify kernel boot arguments">
rw rootwait noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable
rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable
</bootargs>
</os_config>
<vuart id="0">
@ -128,9 +127,8 @@
<kern_type desc="kernel name">KERNEL_BZIMAGE</kern_type>
<kern_mod desc="The tag for kernel image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline.">Linux_bzImage</kern_mod>
<ramdisk_mod desc="The tag for ramdisk image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline."></ramdisk_mod>
<rootfs desc="rootfs for Linux kernel" readonly="true">/dev/sda3</rootfs>
<bootargs desc="Specify kernel boot arguments">
rw rootwait noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M
rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M
consoleblank=0 tsc=reliable
</bootargs>
</os_config>

View File

@ -77,9 +77,8 @@
<kern_type desc="Specify the kernel image type so that hypervisor could load it correctly. Currently support KERNEL_BZIMAGE and KERNEL_ZEPHYR.">KERNEL_BZIMAGE</kern_type>
<kern_mod desc="The tag for kernel image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline.">Linux_bzImage</kern_mod>
<ramdisk_mod desc="The tag for ramdisk image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline."></ramdisk_mod>
<rootfs desc="rootfs for Linux kernel">/dev/sda3</rootfs>
<bootargs desc="Specify kernel boot arguments">
rw rootwait noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable
rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable
</bootargs>
</os_config>
<vuart id="0">
@ -128,9 +127,8 @@
<kern_type desc="kernel name">KERNEL_BZIMAGE</kern_type>
<kern_mod desc="The tag for kernel image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline.">Linux_bzImage</kern_mod>
<ramdisk_mod desc="The tag for ramdisk image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline."></ramdisk_mod>
<rootfs desc="rootfs for Linux kernel" readonly="true">/dev/sda3</rootfs>
<bootargs desc="Specify kernel boot arguments">
rw rootwait noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M
rw rootwait root=/dev/sda3 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M
consoleblank=0 tsc=reliable
</bootargs>
</os_config>