action.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. name: Set up KernelSU-Next
  2. description: download and set up KSUN into the kernel source
  3. inputs:
  4. susfs:
  5. description: 'susfs'
  6. required: true
  7. runs:
  8. using: composite
  9. steps:
  10. - name: Setup KSUN with no susfs
  11. if: inputs.susfs == 'false'
  12. shell: bash
  13. run: |
  14. cd "$COMMON"
  15. curl -LSs "https://raw.githubusercontent.com/KernelSU-Next/KernelSU-Next/next/kernel/setup.sh" | bash -s dev
  16. cd "$GITHUB_WORKSPACE"
  17. cat >> "$GKI_DEFCONFIG" << 'EOF'
  18. # KernelSU Configuration
  19. CONFIG_KSU=y
  20. EOF
  21. - name: Setup pershoot KSUN with susfs
  22. if: inputs.susfs == 'true'
  23. shell: bash
  24. run: |
  25. cd "$COMMON"
  26. curl -LSs "https://raw.githubusercontent.com/pershoot/KernelSU-Next/dev-susfs/kernel/setup.sh" | bash -s dev-susfs
  27. cd "$GITHUB_WORKSPACE"
  28. cat >> "$GKI_DEFCONFIG" << 'EOF'
  29. # KernelSU Configuration
  30. CONFIG_KSU=y
  31. EOF
  32. - name: Extract KSU Version Info and inject into Kbuild
  33. shell: bash
  34. run: |
  35. cd "$COMMON/KernelSU-Next"
  36. # Fetch dev branch for version info (tags, commits, etc.)
  37. git fetch origin dev 2>/dev/null || true
  38. # Extract and export KSU version info from dev branch
  39. KSU_GIT_VERSION=$(git rev-list --count refs/remotes/origin/dev 2>/dev/null)
  40. KSU_GIT_TAG=$(git describe --tags --abbrev=0 refs/remotes/origin/dev 2>/dev/null || echo "")
  41. KSU_COMMIT=$(git rev-parse --short refs/remotes/origin/dev 2>/dev/null)
  42. KSU_VERSION=$((30000 + KSU_GIT_VERSION))
  43. cd kernel
  44. sed -i "s/^KSU_VERSION_FALLBACK := 1$/KSU_VERSION_FALLBACK := ${KSU_VERSION}/" Kbuild
  45. sed -i "s/^KSU_VERSION_TAG_FALLBACK := v0.0.1$/KSU_VERSION_TAG_FALLBACK := ${KSU_GIT_TAG}/" Kbuild
  46. echo "KSU_GIT_TAG=$KSU_GIT_TAG" >> $GITHUB_ENV
  47. echo "KSU_VERSION=$KSU_VERSION" >> $GITHUB_ENV
  48. echo "KSU_COMMIT=$KSU_COMMIT" >> $GITHUB_ENV
  49. - name: 'Fix KernelSU-Next'
  50. if: inputs.susfs == 'true'
  51. shell: bash
  52. run: |
  53. set -euo pipefail
  54. cd "$COMMON/KernelSU-Next"
  55. cp ${{ github.action_path }}/patches/static.patch ./
  56. patch -p1 < static.patch