From a7564070dcdf75de4f848af936e3d76ed01833e1 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Wed, 22 Sep 2021 11:25:08 -0400 Subject: Include git hash as version number and print startup message --- Makefile | 1 + nvdebug_entry.c | 1 + 2 files changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 5d61177..18c07e8 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ obj-m += nvdebug.o nvdebug-objs = runlist_procfs.o runlist.o nvdebug_entry.o +KBUILD_CFLAGS += -DGIT_HASH=\"$(shell git --git-dir=$(PWD)/.git rev-parse --short HEAD)\" # TODO: Avoid needing to distribute NVIDIA's headers (at least they're MIT...) #ccflags-y += -I$(PWD)/include diff --git a/nvdebug_entry.c b/nvdebug_entry.c index 148bd3f..6346659 100644 --- a/nvdebug_entry.c +++ b/nvdebug_entry.c @@ -28,6 +28,7 @@ int __init nvdebug_init(void) { printk(KERN_ERR "[nvdebug] Unable to initialize procfs entries!\n"); return -ENOMEM; } + printk(KERN_INFO "[nvdebug] Module version "GIT_HASH" initialized\n"); return 0; } -- cgit v1.2.2