Skip to content

Commit d924482

Browse files
committed
hv: update versioning scheme
* introduce EXTRA_VERSION to replace RC_VERSION * add daily tag into the version information * unify the hypervisor and device model version Signed-off-by: Jack Ren <jack.ren@intel.com>
1 parent dc135bd commit d924482

File tree

5 files changed

+21
-24
lines changed

5 files changed

+21
-24
lines changed

VERSION

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
MAJOR_VERSION=0
2+
MINOR_VERSION=1
3+
EXTRA_VERSION=-rc5

devicemodel/Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#
22
# ACRN-DM
33
#
4-
MAJOR_VERSION=0
5-
MINOR_VERSION=1
6-
RC_VERSION=5
4+
include ../VERSION
5+
FULL_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION)$(EXTRA_VERSION)
76
BASEDIR := $(shell pwd)
87
DM_OBJDIR ?= $(CURDIR)/build
98

@@ -157,6 +156,7 @@ include/version.h:
157156
@COMMIT=`git rev-parse --verify --short HEAD 2>/dev/null`;\
158157
DIRTY=`git diff-index --name-only HEAD`;\
159158
if [ -n "$$DIRTY" ];then PATCH="$$COMMIT-dirty";else PATCH="$$COMMIT";fi;\
159+
DAILY_TAG=`git tag --merged HEAD|grep "acrn"|tail -n 1`;\
160160
TIME=`date "+%Y-%m-%d %H:%M:%S"`;\
161161
USER=`id -u -n`; \
162162
echo "/*" > include/version.h; \
@@ -165,7 +165,9 @@ include/version.h:
165165
echo "" >> include/version.h; \
166166
echo "#define DM_MAJOR_VERSION $(MAJOR_VERSION)" >> include/version.h;\
167167
echo "#define DM_MINOR_VERSION $(MINOR_VERSION)" >> include/version.h;\
168-
echo "#define DM_RC_VERSION $(RC_VERSION)" >> include/version.h;\
168+
echo "#define DM_EXTRA_VERSION "\"$(EXTRA_VERSION)\""" >> include/version.h;\
169+
echo "#define DM_FULL_VERSION "\"$(FULL_VERSION)\""" >> include/version.h;\
170+
echo "#define DM_DAILY_TAG "\""$$DAILY_TAG"\""" >> include/version.h;\
169171
echo "#define DM_BUILD_VERSION "\""$$PATCH"\""" >> include/version.h;\
170172
echo "#define DM_BUILD_TIME "\""$$TIME"\""" >> include/version.h;\
171173
echo "#define DM_BUILD_USER "\""$$USER"\""" >> include/version.h

devicemodel/core/main.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,9 @@ usage(int code)
164164
static void
165165
print_version(void)
166166
{
167-
if (DM_RC_VERSION)
168-
fprintf(stderr, "DM version is: %d.%d-%d-%s, build by %s@%s\n",
169-
DM_MAJOR_VERSION, DM_MINOR_VERSION, DM_RC_VERSION,
170-
DM_BUILD_VERSION, DM_BUILD_USER, DM_BUILD_TIME);
171-
else
172-
fprintf(stderr, "DM version is: %d.%d-%s, build by %s@%s\n",
173-
DM_MAJOR_VERSION, DM_MINOR_VERSION, DM_BUILD_VERSION,
174-
DM_BUILD_USER, DM_BUILD_TIME);
167+
fprintf(stderr, "DM version is: %s-%s (daily tag:%s), build by %s@%s\n",
168+
DM_FULL_VERSION,
169+
DM_BUILD_VERSION, DM_DAILY_TAG, DM_BUILD_USER, DM_BUILD_TIME);
175170

176171
exit(0);
177172
}

hypervisor/Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
# ACRN Hypervisor
33
#
44

5-
MAJOR_VERSION=0
6-
MINOR_VERSION=1
7-
RC_VERSION=5
5+
include ../VERSION
6+
FULL_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION)$(EXTRA_VERSION)
87

98
API_MAJOR_VERSION=1
109
API_MINOR_VERSION=0
@@ -241,6 +240,7 @@ $(VERSION):
241240
@COMMIT=`git rev-parse --verify --short HEAD 2>/dev/null`;\
242241
DIRTY=`git diff-index --name-only HEAD`;\
243242
if [ -n "$$DIRTY" ];then PATCH="$$COMMIT-dirty";else PATCH="$$COMMIT";fi;\
243+
DAILY_TAG=`git tag --merged HEAD|grep "acrn"|tail -n 1`;\
244244
TIME=`date "+%F %T"`;\
245245
USER=`id -u -n`; \
246246
if [ $(CONFIG_RELEASE) = "n" ];then BUILD_TYPE="DBG";else BUILD_TYPE="REL";fi;\
@@ -250,9 +250,11 @@ $(VERSION):
250250
echo "" >> $(VERSION); \
251251
echo "#define HV_MAJOR_VERSION $(MAJOR_VERSION)" >> $(VERSION);\
252252
echo "#define HV_MINOR_VERSION $(MINOR_VERSION)" >> $(VERSION);\
253-
echo "#define HV_RC_VERSION $(RC_VERSION)" >> $(VERSION);\
253+
echo "#define HV_EXTRA_VERSION "\"$(EXTRA_VERSION)\""" >> $(VERSION);\
254+
echo "#define HV_FULL_VERSION "\"$(FULL_VERSION)\""" >> $(VERSION);\
254255
echo "#define HV_API_MAJOR_VERSION $(API_MAJOR_VERSION)" >> $(VERSION);\
255256
echo "#define HV_API_MINOR_VERSION $(API_MINOR_VERSION)" >> $(VERSION);\
257+
echo "#define HV_DAILY_TAG "\""$$DAILY_TAG"\""" >> $(VERSION);\
256258
echo "#define HV_BUILD_VERSION "\""$$PATCH"\""" >> $(VERSION);\
257259
echo "#define HV_BUILD_TYPE "\""$$BUILD_TYPE"\""" >> $(VERSION);\
258260
echo "#define HV_BUILD_TIME "\""$$TIME"\""" >> $(VERSION);\

hypervisor/arch/x86/cpu.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -491,15 +491,10 @@ static void bsp_boot_post(void)
491491
init_logmsg(CONFIG_LOG_BUF_SIZE,
492492
CONFIG_LOG_DESTINATION);
493493

494-
if (HV_RC_VERSION != 0)
495-
pr_acrnlog("HV version %d.%d-rc%d-%s-%s %s build by %s, start time %lluus",
496-
HV_MAJOR_VERSION, HV_MINOR_VERSION, HV_RC_VERSION,
497-
HV_BUILD_TIME, HV_BUILD_VERSION, HV_BUILD_TYPE,
498-
HV_BUILD_USER, ticks_to_us(start_tsc));
499-
else
500-
pr_acrnlog("HV version %d.%d-%s-%s %s build by %s, start time %lluus",
501-
HV_MAJOR_VERSION, HV_MINOR_VERSION,
494+
pr_acrnlog("HV version %s-%s-%s %s (daily tag:%s) build by %s, start time %lluus",
495+
HV_FULL_VERSION,
502496
HV_BUILD_TIME, HV_BUILD_VERSION, HV_BUILD_TYPE,
497+
HV_DAILY_TAG,
503498
HV_BUILD_USER, ticks_to_us(start_tsc));
504499

505500
pr_acrnlog("API version %d.%d",

0 commit comments

Comments
 (0)