From 153a5992f5090abf03e05fd35d18a26e4c3c4354 Mon Sep 17 00:00:00 2001 From: Victor Sun Date: Fri, 20 Sep 2019 10:16:05 +0800 Subject: [PATCH] Makefile: add build tag for acrn-config tool in version.h Add " with acrn-config" tag in build info when user build hypervisor with acrn-config xmls would be helpful to identify the hypervisor configuration in current build is from acrn-config xml or from source code. Tracked-On: #3602 Signed-off-by: Victor Sun --- hypervisor/Makefile | 2 ++ hypervisor/arch/x86/cpu.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hypervisor/Makefile b/hypervisor/Makefile index dfd520346..329480485 100644 --- a/hypervisor/Makefile +++ b/hypervisor/Makefile @@ -394,6 +394,7 @@ ifneq ($(BOARD_FILE)$(SCENARIO_FILE),) @cat $(HV_OBJDIR)/.cfg_src_result @if [ "`sed -n /successfully/p $(HV_OBJDIR)/.cfg_src_result`" = "" ]; then exit 1; fi @echo "Import hypervisor configurations from Config-xmls, configurations in source code are ignored!" + @sed -i 's/#define HV_CONFIG_TOOL ""/#define HV_CONFIG_TOOL " with acrn-config"/g' $(VERSION) else @echo "Use hypervisor configurations from source code directly." endif @@ -505,6 +506,7 @@ $(VERSION): echo "#define HV_BUILD_TYPE "\""$$BUILD_TYPE"\""" >> $(VERSION);\ echo "#define HV_BUILD_TIME "\""$$TIME"\""" >> $(VERSION);\ echo "#define HV_BUILD_USER "\""$$USER"\""" >> $(VERSION);\ + echo "#define HV_CONFIG_TOOL \"\"" >> $(VERSION);\ echo "#endif" >> $(VERSION) -include $(C_OBJS:.o=.d) diff --git a/hypervisor/arch/x86/cpu.c b/hypervisor/arch/x86/cpu.c index c497e22a8..b2139d02d 100644 --- a/hypervisor/arch/x86/cpu.c +++ b/hypervisor/arch/x86/cpu.c @@ -192,11 +192,11 @@ void init_pcpu_post(uint16_t pcpu_id) /* Calibrate TSC Frequency */ calibrate_tsc(); - pr_acrnlog("HV version %s-%s-%s %s (daily tag:%s) build by %s, start time %lluus", + pr_acrnlog("HV version %s-%s-%s %s (daily tag:%s) build by %s%s, start time %lluus", HV_FULL_VERSION, HV_BUILD_TIME, HV_BUILD_VERSION, HV_BUILD_TYPE, HV_DAILY_TAG, - HV_BUILD_USER, ticks_to_us(start_tsc)); + HV_BUILD_USER, HV_CONFIG_TOOL, ticks_to_us(start_tsc)); pr_acrnlog("API version %u.%u", HV_API_MAJOR_VERSION, HV_API_MINOR_VERSION);