From 89394245b1613614f98047b9efa494a2e750524e Mon Sep 17 00:00:00 2001 From: f19 <58457605+F-19-F@users.noreply.github.com> Date: Fri, 10 Feb 2023 16:34:47 +0800 Subject: [PATCH] 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'. --- kernel/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/Makefile b/kernel/Makefile index a07033c3..bc3f672b 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -12,8 +12,8 @@ obj-y += embed_ksud.o obj-y += kernel_compat.o obj-y += selinux/ - -ifeq ($(shell test -d $(srctree)/$(src)/../.git; echo $$?),0) +# .git is a text file while the module is imported by 'git submodule add'. +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 KSU_GIT_VERSION := $(shell cd $(srctree)/$(src);/usr/bin/git rev-list --count HEAD) ccflags-y += -DKSU_GIT_VERSION=$(KSU_GIT_VERSION)