Add error checking to the kernel Makefile to ensure that the atomic_inc_not_zero or atomic_long_inc_not_zero functions are found in kernel/cred.c

This commit is contained in:
ShirkNeko
2025-04-11 03:57:23 +08:00
parent 549dc132a4
commit 3c0944530d

View File

@@ -132,6 +132,8 @@ ifeq ($(shell grep -q "atomic_inc_not_zero" $(srctree)/kernel/cred.c; echo $$?),
ATOMIC_INC_FUNC = atomic_inc_not_zero ATOMIC_INC_FUNC = atomic_inc_not_zero
else ifeq ($(shell grep -q "atomic_long_inc_not_zero" $(srctree)/kernel/cred.c; echo $$?),0) else ifeq ($(shell grep -q "atomic_long_inc_not_zero" $(srctree)/kernel/cred.c; echo $$?),0)
ATOMIC_INC_FUNC = atomic_long_inc_not_zero ATOMIC_INC_FUNC = atomic_long_inc_not_zero
else
$(error -- KSU_SUSFS: Neither atomic_inc_not_zero nor atomic_long_inc_not_zero found in kernel/cred.c)
endif endif
ifneq ($(shell grep -Eq "^static inline const struct cred \*get_cred_rcu" $(srctree)/include/linux/cred.h; echo $$?),0) ifneq ($(shell grep -Eq "^static inline const struct cred \*get_cred_rcu" $(srctree)/include/linux/cred.h; echo $$?),0)