name: Set up KernelSU-Next description: download and set up KSUN into the kernel source inputs: susfs: description: 'susfs' required: true runs: using: composite steps: - name: Setup KSUN with no susfs if: inputs.susfs == 'false' shell: bash run: | cd "$COMMON" curl -LSs "https://raw.githubusercontent.com/KernelSU-Next/KernelSU-Next/next/kernel/setup.sh" | bash -s dev - name: Setup pershoot KSUN with susfs if: inputs.susfs == 'true' shell: bash run: | cd "$COMMON" curl -LSs "https://raw.githubusercontent.com/pershoot/KernelSU-Next/dev-susfs/kernel/setup.sh" | bash -s dev-susfs - name: enable in defconfig if: inputs.susfs == 'false' shell: bash run: | "$COMMON/scripts/config" --file "$GKI_DEFCONFIG" --enable CONFIG_KSU - name: Extract KSU Version Info and inject into Kbuild shell: bash run: | cd "$COMMON/KernelSU-Next" # Fetch dev branch for version info (tags, commits, etc.) git fetch origin dev 2>/dev/null || true # Extract and export KSU version info from dev branch KSU_GIT_VERSION=$(git rev-list --count refs/remotes/origin/dev 2>/dev/null) KSU_GIT_TAG=$(git describe --tags --abbrev=0 refs/remotes/origin/dev 2>/dev/null || echo "") KSU_COMMIT=$(git rev-parse --short refs/remotes/origin/dev 2>/dev/null) KSU_VERSION=$((30000 + KSU_GIT_VERSION)) cd kernel sed -i "s/^KSU_VERSION_FALLBACK := 1$/KSU_VERSION_FALLBACK := ${KSU_VERSION}/" Kbuild sed -i "s/^KSU_VERSION_TAG_FALLBACK := v0.0.1$/KSU_VERSION_TAG_FALLBACK := ${KSU_GIT_TAG}/" Kbuild echo "KSU_GIT_TAG=$KSU_GIT_TAG" >> $GITHUB_ENV echo "KSU_VERSION=$KSU_VERSION" >> $GITHUB_ENV echo "KSU_COMMIT=$KSU_COMMIT" >> $GITHUB_ENV - name: 'Fix KernelSU-Next' if: inputs.susfs == 'true' shell: bash run: | set -euo pipefail cd "$COMMON/KernelSU-Next" cp ${{ github.action_path }}/patches/static.patch ./ patch -p1 < static.patch