Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit fb8322e

Browse files
committed
Print version and git commit in hyperstart
When start container, print git commit in hyperstart to show accurate version number. Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
1 parent b25cc06 commit fb8322e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
AM_CFLAGS = -Wall -Werror
1+
COMMIT=`git describe --dirty --always --tags 2> /dev/null || true`
2+
AM_CFLAGS = -Wall -Werror -DVERSIONCOMMIT=\""$(VERSION), commit: $(COMMIT)"\"
23
bin_PROGRAMS=hyperstart
34
hyperstart_SOURCES=init.c jsmn.c net.c util.c parse.c parson.c container.c exec.c event.c portmapping.c
45
if HAVE_VSOCK

src/init.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,6 +1460,9 @@ static int hyper_loop(void)
14601460
static int hyper_setup_init_process(void)
14611461
{
14621462
/* mount the base file systems */
1463+
printf("\n<**********************************************************************\n");
1464+
printf("< Hyperstart Version: %s\n", VERSIONCOMMIT);
1465+
printf("<**********************************************************************\n");
14631466
if (mount("proc", "/proc", "proc", MS_NOSUID| MS_NODEV| MS_NOEXEC, NULL) == -1) {
14641467
perror("mount proc failed");
14651468
return -1;

0 commit comments

Comments
 (0)