From b2db527b9674174b704aaa297afa257215d8a290 Mon Sep 17 00:00:00 2001 From: Manuel Bentele Date: Mon, 12 Oct 2020 09:11:17 +0200 Subject: Print version string in kernel log --- CMakeLists.txt | 3 ++- kernel/CMakeLists.txt | 2 +- kernel/xloop_main.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3095d7e..fa32699 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,8 @@ endif() # get versions to define project version get_kernel_version(LINUX_KERNEL_VERSION) get_repository_version(REPOSITORY_VERSION) -set(VERSION ${LINUX_KERNEL_VERSION}-${REPOSITORY_VERSION}) +set(VERSION ${LINUX_KERNEL_VERSION}-${REPOSITORY_VERSION} + CACHE STRING "Version of xloop package") # define packaging if Release build is enabled if(${CMAKE_BUILD_TYPE} MATCHES Release) diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt index 0e867f6..0cf209c 100644 --- a/kernel/CMakeLists.txt +++ b/kernel/CMakeLists.txt @@ -19,7 +19,7 @@ message(STATUS "Path to Linux kernel modules to compile against is " ${KERNEL_DI message(STATUS "Minor number for the xloop-control device is " ${XLOOP_CTRL_MINOR}) # set C flags for a Linux kernel module -set(KERNEL_C_FLAGS "-DCONFIG_BLK_DEV_XLOOP_MIN_COUNT=${BLK_DEV_XLOOP_MIN_COUNT} -DXLOOP_MAJOR=${XLOOP_MAJOR} -DXLOOP_CTRL_MINOR=${XLOOP_CTRL_MINOR}" +set(KERNEL_C_FLAGS "-DCONFIG_BLK_DEV_XLOOP_MIN_COUNT=${BLK_DEV_XLOOP_MIN_COUNT} -DXLOOP_MAJOR=${XLOOP_MAJOR} -DXLOOP_CTRL_MINOR=${XLOOP_CTRL_MINOR} -DVERSION=${VERSION}" CACHE STRING "C flags to be used for building the kernel module") # set C flags for the debug mode of a Linux kernel module set(KERNEL_C_FLAGS_DEBUG "-g -DDEBUG" diff --git a/kernel/xloop_main.c b/kernel/xloop_main.c index 703044f..001b759 100644 --- a/kernel/xloop_main.c +++ b/kernel/xloop_main.c @@ -2187,7 +2187,7 @@ static int __init xloop_init(void) xloop_add(&xlo, i); mutex_unlock(&xloop_ctl_mutex); - pr_info("module loaded\n"); + pr_info("module in version %s loaded\n", __stringify(VERSION)); return 0; misc_out: -- cgit v1.2.3-55-g7522