acrn-hypervisor/misc/acrn-config/target/dmi.py
Wei Liu 8adefe26ac acrn-config: generate board information on target board
These tools run on the target board and genearate board information.

usage: python3 board_parser.py <board_name> [--out board_info_file]

sample:
	$ sudo python3 board_parser.py apl-up2

v1-v2:
1. allow board parameter for new board

v2-v3:
1. add the usage descriptions for tools
2. add description of kernel cmd line for README
3. output informations to a xml type
4. coding as PEP8 guildline

Tracked-On: #3480
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Reviewed-by: Shuang Zheng shuang.zheng@intel.com
Acked-by: Terry Zou <terry.zou@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-07-30 16:38:23 +08:00

21 lines
552 B
Python

# Copyright (C) 2019 Intel Corporation. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
import parser_lib
CMDS = {
'BIOS_INFO':"dmidecode -t 0",
'BASE_BOARD_INFO':"dmidecode -t 2",
}
def generate_info(board_info):
"""Get bios and base board information"""
with open(board_info, 'a+') as config:
parser_lib.dump_excute(CMDS['BIOS_INFO'], 'BIOS_INFO', config)
print("", file=config)
parser_lib.dump_excute(CMDS['BASE_BOARD_INFO'], 'BASE_BOARD_INFO', config)
print("", file=config)