From ecd5af76ab87ef322553c86afb205620399e6934 Mon Sep 17 00:00:00 2001 From: Shatyuka <958182453@qq.com> Date: Thu, 23 Mar 2023 15:01:24 +0800 Subject: [PATCH] kernel: use git from PATH (#316) One should have git in PATH in order to build Android kernel. Also it's weird that git is used in `setup.sh` without absolute path. --- kernel/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/Makefile b/kernel/Makefile index bc3f672b..ede1e023 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -14,8 +14,7 @@ obj-y += kernel_compat.o obj-y += selinux/ # .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) +KSU_GIT_VERSION := $(shell cd $(srctree)/$(src); /usr/bin/env PATH=$$PATH:/usr/bin:/usr/local/bin git rev-list --count HEAD) ccflags-y += -DKSU_GIT_VERSION=$(KSU_GIT_VERSION) endif