added BUILDTAG to module version

This commit is contained in:
Thomas Schoebel-Theuer 2011-09-30 13:55:18 +02:00 committed by Thomas Schoebel-Theuer
parent f3068dec34
commit 507193ac69
2 changed files with 11 additions and 0 deletions

View File

@ -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')\""

View File

@ -25,6 +25,7 @@
#include <linux/blkdev.h>
#include "strategy.h"
#include "../buildtag.h"
#include <linux/kthread.h>
#include <linux/wait.h>
@ -3097,6 +3098,7 @@ const void *dummy2 = &server_brick_type;
MODULE_DESCRIPTION("MARS Light");
MODULE_AUTHOR("Thomas Schoebel-Theuer <tst@1und1.de>");
MODULE_VERSION(BUILDTAG " (" BUILDHOST BUILDDATE ")");
MODULE_LICENSE("GPL");
module_init(init_light);