5
5
#define pr_fmt (fmt ) "lkdtm: " fmt
6
6
7
7
#include <linux/kernel.h>
8
+ #include <generated/compile.h>
9
+ #include <generated/utsrelease.h>
10
+
11
+ #define LKDTM_KERNEL "kernel (" UTS_RELEASE " " UTS_MACHINE ")"
8
12
9
13
#define pr_expected_config (kconfig ) \
10
14
{ \
11
15
if (IS_ENABLED(kconfig)) \
12
- pr_err("Unexpected! This kernel was built with " #kconfig "=y\n"); \
16
+ pr_err("Unexpected! This " LKDTM_KERNEL " was built with " #kconfig "=y\n"); \
13
17
else \
14
- pr_warn("This is probably expected, since this kernel was built *without* " #kconfig "=y\n"); \
18
+ pr_warn("This is probably expected, since this " LKDTM_KERNEL " was built *without* " #kconfig "=y\n"); \
15
19
}
16
20
17
21
#ifndef MODULE
@@ -21,24 +25,24 @@ int lkdtm_check_bool_cmdline(const char *param);
21
25
if (IS_ENABLED(kconfig)) { \
22
26
switch (lkdtm_check_bool_cmdline(param)) { \
23
27
case 0: \
24
- pr_warn("This is probably expected, since this kernel was built with " #kconfig "=y but booted with '" param "=N'\n"); \
28
+ pr_warn("This is probably expected, since this " LKDTM_KERNEL " was built with " #kconfig "=y but booted with '" param "=N'\n"); \
25
29
break; \
26
30
case 1: \
27
- pr_err("Unexpected! This kernel was built with " #kconfig "=y and booted with '" param "=Y'\n"); \
31
+ pr_err("Unexpected! This " LKDTM_KERNEL " was built with " #kconfig "=y and booted with '" param "=Y'\n"); \
28
32
break; \
29
33
default: \
30
- pr_err("Unexpected! This kernel was built with " #kconfig "=y (and booted without '" param "' specified)\n"); \
34
+ pr_err("Unexpected! This " LKDTM_KERNEL " was built with " #kconfig "=y (and booted without '" param "' specified)\n"); \
31
35
} \
32
36
} else { \
33
37
switch (lkdtm_check_bool_cmdline(param)) { \
34
38
case 0: \
35
- pr_warn("This is probably expected, as kernel was built *without* " #kconfig "=y and booted with '" param "=N'\n"); \
39
+ pr_warn("This is probably expected, as this " LKDTM_KERNEL " was built *without* " #kconfig "=y and booted with '" param "=N'\n"); \
36
40
break; \
37
41
case 1: \
38
- pr_err("Unexpected! This kernel was built *without* " #kconfig "=y but booted with '" param "=Y'\n"); \
42
+ pr_err("Unexpected! This " LKDTM_KERNEL " was built *without* " #kconfig "=y but booted with '" param "=Y'\n"); \
39
43
break; \
40
44
default: \
41
- pr_err("This is probably expected, since this kernel was built *without* " #kconfig "=y (and booted without '" param "' specified)\n"); \
45
+ pr_err("This is probably expected, since this " LKDTM_KERNEL " was built *without* " #kconfig "=y (and booted without '" param "' specified)\n"); \
42
46
break; \
43
47
} \
44
48
} \
0 commit comments