acrn-hypervisor/misc/acrn-config/target/pci_dev.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
513 B
Python

# Copyright (C) 2019 Intel Corporation. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
import parser_lib
CMDS = {
'PCI_DEVICE':"lspci -vv",
'PCI_VID_PID':"lspci -n",
}
def generate_info(board_info):
"""Get the pci info"""
with open(board_info, 'a+') as config:
parser_lib.dump_excute(CMDS['PCI_DEVICE'], 'PCI_DEVICE', config)
print("", file=config)
parser_lib.dump_excute(CMDS['PCI_VID_PID'], 'PCI_VID_PID', config)
print("", file=config)