build: add git describe info as modinfo

For traceability purposes, we include commit descriptions
as MODULE_VERSION information in drivers that are deployed
in CERN control system.

Ideally, the commit description should be added to all the
binary blobs installed, but the kernel module is critical
in this connection, as it is crucial to trace back quickly
the whereabouts of installed .ko sources.
parent 09ad885b
......@@ -7,6 +7,7 @@ KBUILD_EXTRA_SYMBOLS := \
$(ZIO)/Module.symvers \
$(FMC_BUS)/kernel/Module.symvers
GIT_VERSION = $(shell cd $(src); git describe --dirty --long --tags)
ccflags-y = \
-I$(ZIO)/include \
......@@ -14,6 +15,7 @@ ccflags-y = \
-I$(FMC_BUS)/kernel/include/linux \
-I$M
ccflags-y += -DGIT_VERSION=\"$(GIT_VERSION)\"
#ccflags-y += -DDEBUG
subdirs-ccflags-y = $(ccflags-y)
......
......@@ -325,4 +325,5 @@ static void fd_exit(void)
module_init(fd_init);
module_exit(fd_exit);
MODULE_VERSION(GIT_VERSION);
MODULE_LICENSE("GPL and additional rights"); /* LGPL */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment