mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-12 05:22:33 +00:00
config_tools: verify "iasl" version against IASL_MIN_VER
To avoid hardcoding the minimum "iasl" version in multiple places, IASL_MIN_VER is defined in the top-level Makefile and is passed to config_tools. This patch verifies "iasl" version against IASL_MIN_VER directly in config_tools. Tracked-On: #7880 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com> Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
parent
3f0fae81b2
commit
3eb1237db3
2
Makefile
2
Makefile
@ -97,7 +97,7 @@ all: hypervisor devicemodel tools
|
|||||||
python3 misc/packaging/gen_acrn_deb.py acrn_all $(ROOT_OUT) --version=$(FULL_VERSION) --board_name="$$DEB_BOARD" --scenario="$$DEB_SCENARIO"; \
|
python3 misc/packaging/gen_acrn_deb.py acrn_all $(ROOT_OUT) --version=$(FULL_VERSION) --board_name="$$DEB_BOARD" --scenario="$$DEB_SCENARIO"; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
HV_MAKEOPTS := -C $(T)/hypervisor BOARD=$(BOARD) SCENARIO=$(SCENARIO) HV_OBJDIR=$(HV_OUT) RELEASE=$(RELEASE) ASL_COMPILER=$(ASL_COMPILER)
|
HV_MAKEOPTS := -C $(T)/hypervisor BOARD=$(BOARD) SCENARIO=$(SCENARIO) HV_OBJDIR=$(HV_OUT) RELEASE=$(RELEASE) ASL_COMPILER=$(ASL_COMPILER) IASL_MIN_VER=$(IASL_MIN_VER)
|
||||||
|
|
||||||
board_inspector:
|
board_inspector:
|
||||||
@if [ -x "$(DPKG_BIN)" ]; then \
|
@if [ -x "$(DPKG_BIN)" ]; then \
|
||||||
|
@ -12,6 +12,7 @@ GCC_MINOR=$(shell echo __GNUC_MINOR__ | $(CC) -E -x c - | tail -n 1)
|
|||||||
STACK_PROTECTOR := 1
|
STACK_PROTECTOR := 1
|
||||||
|
|
||||||
ASL_COMPILER ?= $(shell which iasl)
|
ASL_COMPILER ?= $(shell which iasl)
|
||||||
|
IASL_MIN_VER ?= "20190703"
|
||||||
BASEDIR := $(shell pwd)
|
BASEDIR := $(shell pwd)
|
||||||
HV_OBJDIR ?= $(CURDIR)/build
|
HV_OBJDIR ?= $(CURDIR)/build
|
||||||
HV_MODDIR ?= $(HV_OBJDIR)/modules
|
HV_MODDIR ?= $(HV_OBJDIR)/modules
|
||||||
@ -426,7 +427,7 @@ pre_build: $(HV_CONFIG_H) $(HV_CONFIG_TIMESTAMP)
|
|||||||
$(MAKE) -C $(PRE_BUILD_DIR) BOARD=$(BOARD) SCENARIO=$(SCENARIO) TARGET_DIR=$(HV_CONFIG_DIR)
|
$(MAKE) -C $(PRE_BUILD_DIR) BOARD=$(BOARD) SCENARIO=$(SCENARIO) TARGET_DIR=$(HV_CONFIG_DIR)
|
||||||
@$(HV_OBJDIR)/hv_prebuild_check.out
|
@$(HV_OBJDIR)/hv_prebuild_check.out
|
||||||
@echo "generate the binary of ACPI tables for pre-launched VMs ..."
|
@echo "generate the binary of ACPI tables for pre-launched VMs ..."
|
||||||
python3 ../misc/config_tools/acpi_gen/bin_gen.py --board $(HV_OBJDIR)/.board.xml --scenario $(HV_OBJDIR)/.scenario.xml --asl $(HV_CONFIG_DIR) --out $(HV_OBJDIR) --iasl_path $(ASL_COMPILER)
|
python3 ../misc/config_tools/acpi_gen/bin_gen.py --board $(HV_OBJDIR)/.board.xml --scenario $(HV_OBJDIR)/.scenario.xml --asl $(HV_CONFIG_DIR) --out $(HV_OBJDIR) --iasl_path $(ASL_COMPILER) --iasl_min_ver $(IASL_MIN_VER)
|
||||||
@echo "generate the serial configuration file for service VM ..."
|
@echo "generate the serial configuration file for service VM ..."
|
||||||
python3 ../misc/config_tools/service_vm_config/serial_config.py --allocation $(HV_OBJDIR)/configs/allocation.xml --scenario $(HV_OBJDIR)/.scenario.xml --out $(HV_OBJDIR)/serial.conf
|
python3 ../misc/config_tools/service_vm_config/serial_config.py --allocation $(HV_OBJDIR)/configs/allocation.xml --scenario $(HV_OBJDIR)/.scenario.xml --out $(HV_OBJDIR)/serial.conf
|
||||||
|
|
||||||
|
@ -218,20 +218,21 @@ def exec_command(cmd):
|
|||||||
return rc
|
return rc
|
||||||
|
|
||||||
|
|
||||||
def check_iasl(iasl_path):
|
def check_iasl(iasl_path, iasl_min_ver):
|
||||||
'''
|
'''
|
||||||
check iasl installed
|
check iasl installed
|
||||||
:return: True if iasl installed.
|
:return: True if iasl installed.
|
||||||
'''
|
'''
|
||||||
try:
|
try:
|
||||||
p_version = 'ASL+ Optimizing Compiler/Disassembler version'
|
p_version = 'ASL+ Optimizing Compiler/Disassembler version'
|
||||||
min_version = 20190703
|
min_version = int(iasl_min_ver)
|
||||||
output = subprocess.check_output([iasl_path, '-v']).decode('utf8')
|
output = subprocess.check_output([iasl_path, '-v']).decode('utf8')
|
||||||
if p_version in output:
|
if p_version in output:
|
||||||
try:
|
try:
|
||||||
for line in output.split('\n'):
|
for line in output.split('\n'):
|
||||||
if line.find(p_version) >= 0:
|
if line.find(p_version) >= 0:
|
||||||
version = int(line.split(p_version)[1].strip())
|
version = int(line.split(p_version)[1].strip())
|
||||||
|
print('iasl version is {}'.format(version))
|
||||||
if version >= min_version:
|
if version >= min_version:
|
||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
@ -269,8 +270,9 @@ def main(args):
|
|||||||
if os.path.isdir(DEST_ACPI_BIN_PATH):
|
if os.path.isdir(DEST_ACPI_BIN_PATH):
|
||||||
shutil.rmtree(DEST_ACPI_BIN_PATH)
|
shutil.rmtree(DEST_ACPI_BIN_PATH)
|
||||||
|
|
||||||
if not check_iasl(args.iasl_path):
|
if not check_iasl(args.iasl_path, args.iasl_min_ver):
|
||||||
print("Please install iasl tool with version >= 20190703 from https://www.acpica.org/downloads before ACPI generation.")
|
print('Please install iasl tool with version >= {} from https://www.acpica.org/downloads '
|
||||||
|
'before ACPI generation.'.format(args.iasl_min_ver))
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
for config in os.listdir(DEST_ACPI_PATH):
|
for config in os.listdir(DEST_ACPI_PATH):
|
||||||
@ -288,12 +290,14 @@ def main(args):
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(usage="python3 bin_gen.py --board [board] --scenario [scenario]"
|
parser = argparse.ArgumentParser(usage="python3 bin_gen.py --board [board] --scenario [scenario]"
|
||||||
" --iasl_path [the path to the iasl compiler]"
|
" --iasl_path [the path to the iasl compiler]"
|
||||||
|
" --iasl_min_ver [the minimum iasl version]"
|
||||||
"[ --out [output dir of acpi ASL code]]",
|
"[ --out [output dir of acpi ASL code]]",
|
||||||
description="the tool to generate ACPI binary for Pre-launched VMs")
|
description="the tool to generate ACPI binary for Pre-launched VMs")
|
||||||
parser.add_argument("--board", required=True, help="the XML file summarizing characteristics of the target board")
|
parser.add_argument("--board", required=True, help="the XML file summarizing characteristics of the target board")
|
||||||
parser.add_argument("--scenario", required=True, help="the XML file specifying the scenario to be set up")
|
parser.add_argument("--scenario", required=True, help="the XML file specifying the scenario to be set up")
|
||||||
parser.add_argument("--asl", default=None, help="the input folder to store the ACPI ASL code. ")
|
parser.add_argument("--asl", default=None, help="the input folder to store the ACPI ASL code. ")
|
||||||
parser.add_argument("--iasl_path", default=None, help="the path to the iasl compiler.")
|
parser.add_argument("--iasl_path", default=None, help="the path to the iasl compiler.")
|
||||||
|
parser.add_argument("--iasl_min_ver", default=None, help="the minimum iasl version.")
|
||||||
parser.add_argument("--out", default=None, help="the output folder to store the ACPI binary code. "
|
parser.add_argument("--out", default=None, help="the output folder to store the ACPI binary code. "
|
||||||
"If not specified, the path for the binary code is"
|
"If not specified, the path for the binary code is"
|
||||||
"build/hypervisor/acpi/")
|
"build/hypervisor/acpi/")
|
||||||
|
Loading…
Reference in New Issue
Block a user