Include git short sha in version string instead of -dev
This commit is contained in:
parent
5fb5e07b8e
commit
1c65d3d663
3
Makefile
3
Makefile
@ -11,6 +11,9 @@ CFLAGS += -Wall -Wextra -Wno-unused-function -Wno-unused-parameter
|
||||
CFLAGS += -Wstrict-prototypes -pedantic -fno-omit-frame-pointer
|
||||
CFLAGS += -D_KERNEL_
|
||||
|
||||
# Kernel autoversioning with git sha
|
||||
CFLAGS += -DKERNEL_GIT_TAG=`util/make-version`
|
||||
|
||||
# We have some pieces of assembly sitting around as well...
|
||||
YASM = yasm
|
||||
|
||||
|
@ -21,7 +21,14 @@ int __kernel_version_lower = 1;
|
||||
* mean anything, but can be used to distinguish
|
||||
* between different features included while
|
||||
* building multiple kernels. */
|
||||
char * __kernel_version_suffix = "dev";
|
||||
#ifdef KERNEL_GIT_TAG
|
||||
# define STR(x) #x
|
||||
# define STRSTR(x) STR(x)
|
||||
# define KERNEL_VERSION_SUFFIX STRSTR(KERNEL_GIT_TAG)
|
||||
#else
|
||||
# define KERNEL_VERSION_SUFFIX "r"
|
||||
#endif
|
||||
char * __kernel_version_suffix = KERNEL_VERSION_SUFFIX;
|
||||
|
||||
/* The release codename.
|
||||
*
|
||||
|
10
util/make-version
Executable file
10
util/make-version
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
VERSION=`git rev-parse --short HEAD`
|
||||
|
||||
X=$(git status -s | grep -q '^.M')
|
||||
if [ $? -eq 0 ]; then
|
||||
VERSION="$VERSION-dirty"
|
||||
fi
|
||||
|
||||
echo -n $VERSION
|
Loading…
Reference in New Issue
Block a user