diff --git a/Makefile b/Makefile index 4af87e26..ca01fcac 100644 --- a/Makefile +++ b/Makefile @@ -46,3 +46,12 @@ obj-$(CONFIG_MARS_LIGHT) += sy_old/mars_light.o \ ifdef CONFIG_DEBUG_KERNEL KBUILD_CFLAGS += -fno-inline-functions -fno-inline-small-functions -fno-inline-functions-called-once endif + +.PHONY FORCE: block/mars/buildtag.h +block/mars/buildtag.h: + set -e; exec > $@;\ + cd block/mars;\ + echo -e "/* Automatically generated -- DO NOT EDIT! */";\ + echo -e "#define BUILDTAG \"$$(git log -1 --pretty='format:%H')\"";\ + echo -e "#define BUILDHOST \"$$USER@$$HOSTNAME\"";\ + echo -e "#define BUILDDATE \"$$(date '+%F %T')\"" diff --git a/sy_old/mars_light.c b/sy_old/mars_light.c index 2f0eadca..96f292eb 100644 --- a/sy_old/mars_light.c +++ b/sy_old/mars_light.c @@ -25,6 +25,7 @@ #include #include "strategy.h" +#include "../buildtag.h" #include #include @@ -3097,6 +3098,7 @@ const void *dummy2 = &server_brick_type; MODULE_DESCRIPTION("MARS Light"); MODULE_AUTHOR("Thomas Schoebel-Theuer "); +MODULE_VERSION(BUILDTAG " (" BUILDHOST BUILDDATE ")"); MODULE_LICENSE("GPL"); module_init(init_light);