Skip to content

Commit

Permalink
cleanup submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
= mlm-games committed Sep 10, 2024
1 parent 1bb6f53 commit 1a4b31f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kernel/setup-subm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ initialize_variables() {
DRIVER_KCONFIG=$DRIVER_DIR/Kconfig
}

# Reverts modifications made by this script
# Reverts modifications made by this script, remove the submodule.
perform_cleanup() {
echo "[+] Cleaning up..."
[ -L "$DRIVER_DIR/kernelsu" ] && rm "$DRIVER_DIR/kernelsu" && echo "[-] Symlink removed."
grep -q "kernelsu" "$DRIVER_MAKEFILE" && sed -i '/kernelsu/d' "$DRIVER_MAKEFILE" && echo "[-] Makefile reverted."
grep -q "drivers/kernelsu/Kconfig" "$DRIVER_KCONFIG" && sed -i '/drivers\/kernelsu\/Kconfig/d' "$DRIVER_KCONFIG" && echo "[-] Kconfig reverted."

if [ -d "$KERNEL_DIR/KernelSU" ]; then
git submodule deinit -f -- "$KERNEL_DIR/KernelSU"
rm -rf "$KERNEL_DIR/.git/modules/KernelSU"
rm -rf "$KERNEL_DIR/KernelSU" && echo "[-] KernelSU directory deleted."
fi
}
Expand Down

0 comments on commit 1a4b31f

Please sign in to comment.