aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Android.mk2
-rwxr-xr-xpatch-kernel.sh12
2 files changed, 5 insertions, 9 deletions
diff --git a/Android.mk b/Android.mk
index 6001ce0..4667903 100644
--- a/Android.mk
+++ b/Android.mk
@@ -6,7 +6,7 @@ WIREGUARD_PATH := $(call my-dir)
TARGET_KERNEL_BINARIES: patch-wireguard
patch-wireguard:
- @WG_PATCHER_GIT_IGNORE=1 $(WIREGUARD_PATH)/patch-kernel.sh "$(TARGET_KERNEL_SOURCE)"; \
+ @$(WIREGUARD_PATH)/patch-kernel.sh "$(TARGET_KERNEL_SOURCE)"; \
ret=$$?; [ $$ret -eq 0 ] && exit 0; [ $$ret -ne 77 ] && exit $$ret; \
echo -e "" \
"\e[1;37;41m=================================================\e[0m\n" \
diff --git a/patch-kernel.sh b/patch-kernel.sh
index fc57de8..793e92c 100755
--- a/patch-kernel.sh
+++ b/patch-kernel.sh
@@ -29,12 +29,8 @@ chmod +x scripts/fetch-latest-wireguard.sh
[[ $(< scripts/Kbuild.include) == *fetch-latest-wireguard.sh* ]] || echo '$(shell cd "$(srctree)" && ./scripts/fetch-latest-wireguard.sh)' >> scripts/Kbuild.include
-if [[ -d .git ]]; then
- if [[ $WG_PATCHER_GIT_IGNORE -eq 1 ]]; then
- echo -e 'scripts/fetch-latest-wireguard.sh\nnet/.gitignore' >> .gitignore
- git update-index --assume-unchanged .gitignore scripts/Kbuild.include net/Kconfig net/Makefile
- else
- git add scripts/Kbuild.include scripts/fetch-latest-wireguard.sh net/.gitignore net/Kconfig net/Makefile
- git commit -s -m "net/wireguard: add wireguard importer" scripts/Kbuild.include scripts/fetch-latest-wireguard.sh net/.gitignore net/Kconfig net/Makefile
- fi
+MODIFIED_FILES=( scripts/Kbuild.include scripts/fetch-latest-wireguard.sh net/.gitignore net/Kconfig net/Makefile )
+if [[ -d .git && -n $(git status --porcelain "${MODIFIED_FILES[@]}") ]]; then
+ git add "${MODIFIED_FILES[@]}"
+ git commit -s -m "net/wireguard: add wireguard importer" "${MODIFIED_FILES[@]}"
fi