Skip to content

Commit 99a39e0

Browse files
committed
kernel: ksu: printout quirks / backports / etc on init
Signed-off-by: backslashxx <[email protected]>
1 parent 0d6548f commit 99a39e0

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

kernel/ksu.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#include <linux/fs.h>
33
#include <linux/kobject.h>
44
#include <linux/module.h>
5+
#include <generated/utsrelease.h>
6+
#include <generated/compile.h>
57
#include <linux/version.h> /* LINUX_VERSION_CODE, KERNEL_VERSION macros */
68

79
#include "allowlist.h"
@@ -20,8 +22,42 @@ extern void kp_ksud_init();
2022

2123
extern void ksu_supercalls_init();
2224

25+
// track backports and other quirks here
26+
// ref: kernel_compat.c, Makefile
27+
// yes looks nasty
28+
#if defined(CONFIG_KSU_KPROBES_KSUD)
29+
#define FEAT_1 " +kprobes_ksud"
30+
#else
31+
#define FEAT_1 ""
32+
#endif
33+
34+
#if defined(CONFIG_KSU_KRETPROBES_SUCOMPAT)
35+
#define FEAT_2 " +kretprobes_sucompat"
36+
#else
37+
#define FEAT_2 ""
38+
#endif
39+
#if defined(CONFIG_KSU_EXTRAS)
40+
#define FEAT_3 " +extras"
41+
#else
42+
#define FEAT_3 ""
43+
#endif
44+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) && !defined(CONFIG_KSU_LSM_SECURITY_HOOKS)
45+
#define FEAT_4 " -lsm_hooks"
46+
#else
47+
#define FEAT_4 ""
48+
#endif
49+
#if !(LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)) && defined(KSU_HAS_PATH_UMOUNT)
50+
#define FEAT_5 " +path_umount"
51+
#else
52+
#define FEAT_5 ""
53+
#endif
54+
55+
#define EXTRA_FEATURES FEAT_1 FEAT_2 FEAT_3 FEAT_4 FEAT_5
56+
2357
int __init kernelsu_init(void)
2458
{
59+
pr_info("Initialized on: %s (%s) with ksuver: %s%s\n", UTS_RELEASE, UTS_MACHINE, __stringify(KSU_VERSION), EXTRA_FEATURES);
60+
2561
#ifdef CONFIG_KSU_DEBUG
2662
pr_alert("*************************************************************");
2763
pr_alert("** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **");

0 commit comments

Comments
 (0)