From 0c2588862db31beeb6430fc5975c98c579b97019 Mon Sep 17 00:00:00 2001 From: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com> Date: Wed, 19 Mar 2025 21:21:09 +0800 Subject: [PATCH] Update Makefile --- kernel/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/Makefile b/kernel/Makefile index d6ae581d..fb0dc6cb 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -44,20 +44,20 @@ endif obj-$(CONFIG_KSU) += kernelsu.o +KSU_MANUAL_VERSION := 12510 ifeq ($(strip $(KSU_MANUAL_VERSION)),) ifeq ($(shell test -e $(srctree)/$(src)/../.git; echo $$?),0) - $(shell cd $(srctree)/$(src); /usr/bin/env PATH="$$PATH":/usr/bin:/usr/local/bin git checkout main) - $(shell cd $(srctree)/$(src); /usr/bin/env PATH="$$PATH":/usr/bin:/usr/local/bin git pull origin main) + $(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 + 600 for historical reasons + # ksu_version: major * 10000 + git version + 500 for historical reasons $(eval KSU_VERSION=$(shell expr 12000 + $(KSU_GIT_VERSION) + 500)) $(info -- KernelSU version (Git-based): $(KSU_VERSION)) ccflags-y += -DKSU_VERSION=$(KSU_VERSION) else # .git is a text file while the module is imported by 'git submodule add'. $(warning "KSU_GIT_VERSION not defined! Using default version.") - KSU_VERSION := $(KSU_MANUAL_VERSION) + KSU_VERSION := 12510 $(info -- KernelSU version (Default): $(KSU_VERSION)) ccflags-y += -DKSU_VERSION=$(KSU_VERSION) endif