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
8
11
- #define LKDTM_KERNEL "kernel (" UTS_RELEASE " " UTS_MACHINE ")"
9
+ extern char * lkdtm_kernel_info ;
12
10
13
11
#define pr_expected_config (kconfig ) \
14
12
{ \
15
13
if (IS_ENABLED(kconfig)) \
16
- pr_err("Unexpected! This " LKDTM_KERNEL " was built with " #kconfig "=y\n"); \
14
+ pr_err("Unexpected! This %s was built with " #kconfig "=y\n", \
15
+ lkdtm_kernel_info); \
17
16
else \
18
- pr_warn("This is probably expected, since this " LKDTM_KERNEL " was built *without* " #kconfig "=y\n"); \
17
+ pr_warn("This is probably expected, since this %s was built *without* " #kconfig "=y\n", \
18
+ lkdtm_kernel_info); \
19
19
}
20
20
21
21
#ifndef MODULE
@@ -25,24 +25,30 @@ int lkdtm_check_bool_cmdline(const char *param);
25
25
if (IS_ENABLED(kconfig)) { \
26
26
switch (lkdtm_check_bool_cmdline(param)) { \
27
27
case 0: \
28
- pr_warn("This is probably expected, since this " LKDTM_KERNEL " was built with " #kconfig "=y but booted with '" param "=N'\n"); \
28
+ pr_warn("This is probably expected, since this %s was built with " #kconfig "=y but booted with '" param "=N'\n", \
29
+ lkdtm_kernel_info); \
29
30
break; \
30
31
case 1: \
31
- pr_err("Unexpected! This " LKDTM_KERNEL " was built with " #kconfig "=y and booted with '" param "=Y'\n"); \
32
+ pr_err("Unexpected! This %s was built with " #kconfig "=y and booted with '" param "=Y'\n", \
33
+ lkdtm_kernel_info); \
32
34
break; \
33
35
default: \
34
- pr_err("Unexpected! This " LKDTM_KERNEL " was built with " #kconfig "=y (and booted without '" param "' specified)\n"); \
36
+ pr_err("Unexpected! This %s was built with " #kconfig "=y (and booted without '" param "' specified)\n", \
37
+ lkdtm_kernel_info); \
35
38
} \
36
39
} else { \
37
40
switch (lkdtm_check_bool_cmdline(param)) { \
38
41
case 0: \
39
- pr_warn("This is probably expected, as this " LKDTM_KERNEL " was built *without* " #kconfig "=y and booted with '" param "=N'\n"); \
42
+ pr_warn("This is probably expected, as this %s was built *without* " #kconfig "=y and booted with '" param "=N'\n", \
43
+ lkdtm_kernel_info); \
40
44
break; \
41
45
case 1: \
42
- pr_err("Unexpected! This " LKDTM_KERNEL " was built *without* " #kconfig "=y but booted with '" param "=Y'\n"); \
46
+ pr_err("Unexpected! This %s was built *without* " #kconfig "=y but booted with '" param "=Y'\n", \
47
+ lkdtm_kernel_info); \
43
48
break; \
44
49
default: \
45
- pr_err("This is probably expected, since this " LKDTM_KERNEL " was built *without* " #kconfig "=y (and booted without '" param "' specified)\n"); \
50
+ pr_err("This is probably expected, since this %s was built *without* " #kconfig "=y (and booted without '" param "' specified)\n", \
51
+ lkdtm_kernel_info); \
46
52
break; \
47
53
} \
48
54
} \
0 commit comments