fix KSU_GIT_VERSION is not defined while importing KSU by 'git submodule add' (#224)

.git is a text file while the module is imported by 'git submodule add'.
This commit is contained in:
f19
2023-02-10 16:34:47 +08:00
committed by GitHub
parent 91f1eb2d6a
commit 89394245b1

View File

@@ -12,8 +12,8 @@ obj-y += embed_ksud.o
obj-y += kernel_compat.o obj-y += kernel_compat.o
obj-y += selinux/ obj-y += selinux/
# .git is a text file while the module is imported by 'git submodule add'.
ifeq ($(shell test -d $(srctree)/$(src)/../.git; echo $$?),0) ifeq ($(shell test -e $(srctree)/$(src)/../.git; echo $$?),0)
# We must use the absolute path to git, otherwise the build will fail if git is not in the PATH # We must use the absolute path to git, otherwise the build will fail if git is not in the PATH
KSU_GIT_VERSION := $(shell cd $(srctree)/$(src);/usr/bin/git rev-list --count HEAD) KSU_GIT_VERSION := $(shell cd $(srctree)/$(src);/usr/bin/git rev-list --count HEAD)
ccflags-y += -DKSU_GIT_VERSION=$(KSU_GIT_VERSION) ccflags-y += -DKSU_GIT_VERSION=$(KSU_GIT_VERSION)