diff --git a/kernel/setup-subm.sh b/kernel/setup-subm.sh index 75ee749e..456af4a3 100755 --- a/kernel/setup-subm.sh +++ b/kernel/setup-subm.sh @@ -39,13 +39,12 @@ perform_cleanup() { # Sets up or update KernelSU environment setup_kernelsu() { echo "[+] Setting up KernelSU..." - test -d "$KERNEL_DIR/KernelSU" - git submodule add https://github.com/mlm-games/KernelSU-Non-GKI KernelSU + test -d "$KERNEL_DIR/KernelSU" || git submodule add https://github.com/mlm-games/KernelSU-Non-GKI KernelSU git submodule update --init --recursive if [ -n "$1" ]; then (cd KernelSU && git checkout "$1") && echo "[-] Checked out $1." || echo "[-] Failed to checkout $1." - else + fi # Add entries in Makefile and Kconfig if not already existing grep -q "kernelsu" "$DRIVER_MAKEFILE" || printf "\nobj-\$(CONFIG_KSU) += kernelsu/\n" >> "$DRIVER_MAKEFILE" && echo "[+] Modified Makefile." @@ -65,4 +64,4 @@ elif [ "$1" = "--cleanup" ]; then else initialize_variables setup_kernelsu "$@" -fi +fi \ No newline at end of file