kernel: Fix compilation for non-gki kernels (#547)

* kernel: Fix compilation for non-gki kernels

* kernel: Check if selinux_state exists rather than depends on version code
This commit is contained in:
TwinbornPlate75
2025-11-08 18:07:09 +08:00
committed by GitHub
parent 8ff469d00e
commit 4f7042ca44
4 changed files with 24 additions and 3 deletions

View File

@@ -153,6 +153,11 @@ ifeq ($(shell grep -q "struct proc_ops " $(srctree)/include/linux/proc_fs.h; ech
ccflags-y += -DKSU_COMPAT_HAS_PROC_OPS
endif
# Struct selinux_state check
ifeq ($(shell grep -q "struct selinux_state " $(srctree)/security/selinux/include/security.h; echo $$?),0)
ccflags-y += -DKSU_COMPAT_HAS_SELINUX_STATE
endif
# Custom Signs
ifdef KSU_EXPECTED_SIZE
ccflags-y += -DEXPECTED_SIZE=$(KSU_EXPECTED_SIZE)