Skip to content

Commit

Permalink
kernel/Makefile: hardcode KSU_VERSION
Browse files Browse the repository at this point in the history
so far only three things has to be cherry picked
kernel wise, feature parity yeah
  • Loading branch information
backslashxx committed Nov 27, 2024
1 parent 1bbfc5a commit 335bd2c
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,10 @@ ccflags-y += -I$(objtree)/security/selinux -include $(srctree)/include/uapi/asm-

obj-$(CONFIG_KSU) += kernelsu.o

# .git is a text file while the module is imported by 'git submodule add'.
ifeq ($(shell test -e $(srctree)/$(src)/../.git; echo $$?),0)
$(shell cd $(srctree)/$(src); /usr/bin/env PATH="$$PATH":/usr/bin:/usr/local/bin [ -f ../.git/shallow ] && git fetch --unshallow)
KSU_GIT_VERSION := $(shell cd $(srctree)/$(src); /usr/bin/env PATH="$$PATH":/usr/bin:/usr/local/bin git rev-list --count HEAD)
# ksu_version: major * 10000 + git version + 200 for historical reasons
$(eval KSU_VERSION=$(shell expr 10000 + $(KSU_GIT_VERSION) + 200))
# hardcode!
$(eval KSU_VERSION=11986)
$(info -- KernelSU version: $(KSU_VERSION))
ccflags-y += -DKSU_VERSION=$(KSU_VERSION)
else # If there is no .git file, the default version will be passed.
$(warning "KSU_GIT_VERSION not defined! It is better to make KernelSU a git submodule!")
ccflags-y += -DKSU_VERSION=16
endif

ifeq ($(shell grep -q " current_sid(void)" $(srctree)/security/selinux/include/objsec.h; echo $$?),0)
ccflags-y += -DKSU_COMPAT_HAS_CURRENT_SID
Expand Down

0 comments on commit 335bd2c

Please sign in to comment.