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#include  <linux/workqueue.h> 
79
@@ -26,8 +28,88 @@ bool ksu_queue_work(struct work_struct *work)
2628	return  queue_work (ksu_workqueue , work );
2729}
2830
31+ // track backports and other quirks here 
32+ // ref: kernel_compat.c, Makefile 
33+ // yes looks nasty 
34+ #if  defined(CONFIG_KSU_KPROBES_KSUD )
35+ 	#define  FEAT_1  " +kprobes_ksud"
36+ #else 
37+ 	#define  FEAT_1  ""
38+ #endif 
39+ 
40+ #if  defined(CONFIG_KSU_KRETPROBES_SUCOMPAT )
41+ 	#define  FEAT_2  " +kretprobes_sucompat"
42+ #else 
43+ 	#define  FEAT_2  ""
44+ #endif 
45+ 
46+ #if  defined(CONFIG_KSU_THRONE_TRACKER_ALWAYS_THREADED )
47+ 	#define  FEAT_3  " +throne_always_threaded"
48+ #else 
49+ 	#define  FEAT_3  ""
50+ #endif 
51+ #if  LINUX_VERSION_CODE  >= KERNEL_VERSION (4 , 2 , 0 ) &&  !defined(CONFIG_KSU_LSM_SECURITY_HOOKS )
52+ 	#define  FEAT_4  " -lsm_hooks"
53+ #else 
54+ 	#define  FEAT_4  ""
55+ #endif 
56+ #if  !(LINUX_VERSION_CODE  >= KERNEL_VERSION (4 , 9 , 0 )) &&  defined(CONFIG_KSU_ALLOWLIST_WORKAROUND )
57+ 	#define  FEAT_5  " +allowlist_workaround"
58+ #else 
59+ 	#define  FEAT_5  ""
60+ #endif 
61+ #if  !(LINUX_VERSION_CODE  >= KERNEL_VERSION (4 , 4 , 0 )) &&  defined(KSU_HAS_MODERN_EXT4 )
62+ 	#define  FEAT_6  " +ext4_unregister_sysfs"
63+ #else 
64+ 	#define  FEAT_6  ""
65+ #endif 
66+ #if  !(LINUX_VERSION_CODE  >= KERNEL_VERSION (5 , 9 , 0 )) &&  defined(KSU_HAS_PATH_UMOUNT )
67+ 	#define  FEAT_7  " +path_umount"
68+ #else 
69+ 	#define  FEAT_7  ""
70+ #endif 
71+ #if  !(LINUX_VERSION_CODE  >= KERNEL_VERSION (5 , 8 , 0 )) &&  defined(KSU_COPY_FROM_USER_NOFAULT )
72+ 	#define  FEAT_8  " +copy_from_user_nofault"
73+ #else 
74+ 	#define  FEAT_8  ""
75+ #endif 
76+ #if  !(LINUX_VERSION_CODE  >= KERNEL_VERSION (5 , 3 , 0 )) &&  defined(KSU_PROBE_USER_READ )
77+ 	#define  FEAT_9  " +probe_user_read"
78+ #else 
79+ 	#define  FEAT_9  ""
80+ #endif 
81+ #if  !(LINUX_VERSION_CODE  >= KERNEL_VERSION (4 , 14 , 0 )) &&  defined(KSU_NEW_KERNEL_READ )
82+ 	#define  FEAT_10  " +new_kernel_read"
83+ #else 
84+ 	#define  FEAT_10  ""
85+ #endif 
86+ #if  !(LINUX_VERSION_CODE  >= KERNEL_VERSION (4 , 14 , 0 )) &&  defined(KSU_NEW_KERNEL_WRITE )
87+ 	#define  FEAT_11  " +new_kernel_write"
88+ #else 
89+ 	#define  FEAT_11  ""
90+ #endif 
91+ #if  !(LINUX_VERSION_CODE  >= KERNEL_VERSION (5 , 1 , 0 )) &&  defined(KSU_HAS_SELINUX_INODE )
92+ 	#define  FEAT_12  " +selinux_inode"
93+ #else 
94+ 	#define  FEAT_12  ""
95+ #endif 
96+ #if  !(LINUX_VERSION_CODE  >= KERNEL_VERSION (3 , 16 , 0 )) &&  defined(KSU_HAS_FOP_READ_ITER )
97+ 	#define  FEAT_13  " +read_iter"
98+ #else 
99+ 	#define  FEAT_13  ""
100+ #endif 
101+ #if  LINUX_VERSION_CODE  <  KERNEL_VERSION (3 , 11 , 0 ) &&  defined(KSU_HAS_ITERATE_DIR )
102+ 	#define  FEAT_14  " +iterate_dir"
103+ #else 
104+ 	#define  FEAT_14  ""
105+ #endif 
106+ 
107+ #define  EXTRA_FEATURES  FEAT_1 FEAT_2 FEAT_3 FEAT_4 FEAT_5 FEAT_6 FEAT_7 FEAT_8 FEAT_9 FEAT_10 FEAT_11 FEAT_12 FEAT_13 FEAT_14
108+ 
29109int  __init  kernelsu_init (void )
30110{
111+ 	pr_info ("Initialized on: %s (%s) with ksuver: %s%s\n" , UTS_RELEASE , UTS_MACHINE , __stringify (KSU_VERSION ), EXTRA_FEATURES );
112+ 
31113#ifdef  CONFIG_KSU_DEBUG 
32114	pr_alert ("*************************************************************" );
33115	pr_alert ("**     NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE    **" );
0 commit comments