acrn-config: enhance the target config

1. add misc.py to get systemd ram and root device
2. add more specify comments for arguments of functions

v1-v2:
    typo: Parser -> Parse
    some grammar check

v2-v3:
    add the message for Cx state

Tracked-On: #3602
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
This commit is contained in:
Wei Liu
2019-08-02 19:17:58 +08:00
committed by wenlingz
parent 6045a5e54c
commit b73f97aaba
13 changed files with 317 additions and 102 deletions

View File

@@ -8,17 +8,18 @@ import sys
import shutil
import argparse
import subprocess
import parser_lib
import pci_dev
import dmi
import acpi
import clos
import misc
import parser_lib
OUTPUT = "./out/"
PY_CACHE = "__pycache__"
# This file store information which query from hw board
BIN_LIST = ['cpuid', 'rdmsr', 'lspci', ' dmidecode']
BIN_LIST = ['cpuid', 'rdmsr', 'lspci', ' dmidecode', 'blkid']
PCI_IDS = ["/usr/share/hwdata/pci.ids", "/usr/share/misc/pci.ids"]
CPU_VENDOR = "GenuineIntel"
@@ -57,7 +58,7 @@ def vendor_check():
if len(line.split(':')) == 2:
if line.split(':')[0].strip() == "vendor_id":
vendor_name = line.split(':')[1].strip()
return vendor_name != CPU_VENDOR
return vendor_name == CPU_VENDOR
def check_env():
@@ -66,7 +67,7 @@ def check_env():
shutil.rmtree(PY_CACHE)
# check cpu vendor id
if vendor_check():
if not vendor_check():
parser_lib.print_red("Please run this tools on {}!".format(CPU_VENDOR))
sys.exit(1)
@@ -91,7 +92,6 @@ def check_env():
parser_lib.print_yel("Need CPUID version >= 20170122")
sys.exit(1)
if not native_check():
parser_lib.print_red("Please run this tools on natvie OS!")
sys.exit(1)
@@ -136,6 +136,9 @@ if __name__ == '__main__':
# Generate clos info
clos.generate_info(BOARD_INFO)
# Generate misc info
misc.generate_info(BOARD_INFO)
with open(BOARD_INFO, 'a+') as f:
print("</acrn-config>", file=f)