Explorar el Código

Add action to set up KernelSU-Next in workflow

This action sets up KernelSU-Next by downloading the necessary scripts and configuring the kernel.
jimsterino98 hace 4 meses
padre
commit
310fd95dd7
Se han modificado 1 ficheros con 30 adiciones y 0 borrados
  1. 30 0
      .github/actions/ksun/action.yml

+ 30 - 0
.github/actions/ksun/action.yml

@@ -0,0 +1,30 @@
+name: Set up KernelSU-Next
+description: download and set up KSUN into the kernel source
+
+
+runs:
+  using: composite
+  steps:
+    - name: Setup KSUN
+      shell: bash
+      working-directory: $COMMON
+      run: |
+        curl -LSs "https://raw.githubusercontent.com/KernelSU-Next/KernelSU-Next/next/kernel/setup.sh" | bash -s dev
+
+        cd KernelSU-Next
+        git checkout 551ad80473f60e052917aec08abf5323b6ab2f7c
+
+        cd kernel
+        COMMITS_COUNT=$(/usr/bin/git rev-list --count HEAD)
+        BASE_VERSION=30000
+        KSU_VERSION=$(expr $COMMITS_COUNT "+" $BASE_VERSION)
+        sed -i "s/^KSU_VERSION_FALLBACK := 1$/KSU_VERSION_FALLBACK := ${KSU_VERSION}/" Kbuild
+
+        KSU_GIT_TAG="$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.1")"
+        sed -i "s/^KSU_VERSION_TAG_FALLBACK := v0.0.1$/KSU_VERSION_TAG_FALLBACK := ${KSU_GIT_TAG}/" Kbuild
+
+        cd "$GITHUB_WORKSPACE"
+        cat >> "$GKI_DEFCONFIG" << 'EOF'
+        # KernelSU Configuration
+        CONFIG_KSU=y
+        EOF