feat: detect proc_ops support via header parsing instead of version check. (#411)
Some kernels (e.g. 5.4 with backports) include proc_ops despite being older than 5.6.0. Replace hardcoded version check with runtime header detection to handle these cases. - Check for "struct proc_ops" in include/linux/proc_fs.h - Use KSU_COMPAT_HAS_PROC_OPS macro for conditional compilation - Fixes build failures on kernels with backported proc_ops Signed-off-by: JackAltman
This commit is contained in:
@@ -126,6 +126,11 @@ $(info -- KernelSU/compat: new vfs_getattr() found)
|
||||
ccflags-y += -DKSU_HAS_NEW_VFS_GETATTR
|
||||
endif
|
||||
|
||||
# Function proc_ops check
|
||||
ifeq ($(shell grep -q "struct proc_ops " $(srctree)/include/linux/proc_fs.h; echo $$?),0)
|
||||
ccflags-y += -DKSU_COMPAT_HAS_PROC_OPS
|
||||
endif
|
||||
|
||||
# Custom Signs
|
||||
ifdef KSU_EXPECTED_SIZE
|
||||
ccflags-y += -DEXPECTED_SIZE=$(KSU_EXPECTED_SIZE)
|
||||
|
||||
Reference in New Issue
Block a user