2019-07-30 09:00:54 +08:00
|
|
|
# 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):
|
2019-08-02 19:17:58 +08:00
|
|
|
"""Get bios and base board information
|
|
|
|
:param board_info: this is the file which stores the hardware board information
|
|
|
|
"""
|
2019-07-30 09:00:54 +08:00
|
|
|
with open(board_info, 'a+') as config:
|
2019-08-02 19:17:58 +08:00
|
|
|
parser_lib.dump_execute(CMDS['BIOS_INFO'], 'BIOS_INFO', config)
|
2019-07-30 09:00:54 +08:00
|
|
|
print("", file=config)
|
2019-08-02 19:17:58 +08:00
|
|
|
parser_lib.dump_execute(CMDS['BASE_BOARD_INFO'], 'BASE_BOARD_INFO', config)
|
2019-07-30 09:00:54 +08:00
|
|
|
print("", file=config)
|