No more ksu fetching/this script better.

This commit is contained in:
Phapoom Saksri 2025-01-25 18:47:18 +07:00
parent 48fd4412e8
commit d6f64450af
3 changed files with 1 additions and 30 deletions

View file

@ -461,7 +461,6 @@ endif
endef endef
# #
############################################################################### ###############################################################################
$(shell cd "$(srctree)" && ./scripts/fetch-latest-kernelsu.sh)
# delete partially updated (i.e. corrupted) files on error # delete partially updated (i.e. corrupted) files on error
.DELETE_ON_ERROR: .DELETE_ON_ERROR:

View file

@ -1,29 +0,0 @@
#!/bin/bash
set -e
exec 9>.kernelsu-fetch-lock
flock -n 9 || exit 0
[[ $(( $(date +%s) - $(stat -c %Y "drivers/kernelsu/.check" 2>/dev/null || echo 0) )) -gt 86400 ]] || exit 0
AUTHOR="galaxybuild-project"
REPO="KernelSU-Next"
VERSION=`curl -s -I -k "https://api.github.com/repos/$AUTHOR/$REPO/commits?sha=next&per_page=1" | sed -n '/^[Ll]ink:/ s/.*"next".*page=\([0-9]*\).*"last".*/\1/p'`
if [[ -f drivers/kernelsu/.version && *$(cat drivers/kernelsu/.version)* == *$VERSION* ]]; then
touch drivers/kernelsu/.check
exit 0
fi
# printf "$REPO updating to $((10000+$VERSION+200))\n"
rm -rf drivers/kernelsu
mkdir -p drivers/kernelsu
cd drivers/kernelsu
wget -q -O - https://github.com/$AUTHOR/$REPO/archive/refs/heads/next.tar.gz | tar -xz --strip=2 "$REPO-next/kernel"
echo $VERSION >> .version
touch .check
# You can patch for your kernel here
echo "" >> Makefile
sed -i '/warning /d' Makefile
sed -i '/DKSU_VERSION/d' Makefile
echo "ccflags-y += -DKSU_VERSION=$((10000 + $VERSION + 200))" >> Makefile
gawk -i inplace '/11,/{c++;if(c==2||c==3){sub("11,","9,");}}1' sucompat.c

View file

@ -90,6 +90,7 @@ patch_kernelsu() {
sed -i 's/# CONFIG_KSU_SUSFS_OPEN_REDIRECT is not set/CONFIG_KSU_SUSFS_OPEN_REDIRECT=y/g' "$CUR_DIR"/arch/arm64/configs/exynos9810_temp_defconfig sed -i 's/# CONFIG_KSU_SUSFS_OPEN_REDIRECT is not set/CONFIG_KSU_SUSFS_OPEN_REDIRECT=y/g' "$CUR_DIR"/arch/arm64/configs/exynos9810_temp_defconfig
KERNEL_NAME="$KERNEL_NAME-ksu" KERNEL_NAME="$KERNEL_NAME-ksu"
curl -sL https://raw.githubusercontent.com/galaxybuild-project/tools/refs/heads/main/Scripts/KernelSU-SuSFS.sh | bash
} }
patch_wifi() { patch_wifi() {