action.yml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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/pershoot/KernelSU-Next/dev-susfs/kernel/setup.sh" | bash -s dev
  16. #cd KernelSU-Next
  17. #git checkout c2013a15ae1eaca69032fa6016ffefb70adf6146
  18. #cd KernelSU-Next/kernel
  19. #COMMITS_COUNT=$(/usr/bin/git rev-list --count HEAD)
  20. #BASE_VERSION=30000
  21. #KSU_VERSION=$(expr $COMMITS_COUNT "+" $BASE_VERSION)
  22. #sed -i "s/^KSU_VERSION_FALLBACK := 1$/KSU_VERSION_FALLBACK := ${KSU_VERSION}/" Kbuild
  23. #KSU_GIT_TAG="$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.1")"
  24. #sed -i "s/^KSU_VERSION_TAG_FALLBACK := v0.0.1$/KSU_VERSION_TAG_FALLBACK := ${KSU_GIT_TAG}/" Kbuild
  25. cd "$GITHUB_WORKSPACE"
  26. cat >> "$GKI_DEFCONFIG" << 'EOF'
  27. # KernelSU Configuration
  28. CONFIG_KSU=y
  29. EOF
  30. - name: Setup pershoot KSUN with susfs
  31. if: inputs.susfs == 'true'
  32. shell: bash
  33. run: |
  34. cd "$COMMON"
  35. curl -LSs "https://raw.githubusercontent.com/pershoot/KernelSU-Next/dev-susfs/kernel/setup.sh" | bash -s dev-susfs
  36. #cd KernelSU-Next
  37. #git checkout c2013a15ae1eaca69032fa6016ffefb70adf6146
  38. #cd KernelSU-Next/kernel
  39. #COMMITS_COUNT=$(/usr/bin/git rev-list --count HEAD)
  40. #BASE_VERSION=30000
  41. #KSU_VERSION=$(expr $COMMITS_COUNT "+" $BASE_VERSION)
  42. #sed -i "s/^KSU_VERSION_FALLBACK := 1$/KSU_VERSION_FALLBACK := ${KSU_VERSION}/" Kbuild
  43. #KSU_GIT_TAG="$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.1")"
  44. #sed -i "s/^KSU_VERSION_TAG_FALLBACK := v0.0.1$/KSU_VERSION_TAG_FALLBACK := ${KSU_GIT_TAG}/" Kbuild
  45. cd "$GITHUB_WORKSPACE"
  46. cat >> "$GKI_DEFCONFIG" << 'EOF'
  47. # KernelSU Configuration
  48. CONFIG_KSU=y
  49. EOF
  50. - name: Extract KSU Version Info
  51. id: ksu-version
  52. shell: bash
  53. run: |
  54. cd "$COMMON/KernelSU-Next"
  55. # Fetch dev branch for version info (tags, commits, etc.)
  56. git fetch origin dev 2>/dev/null || true
  57. # Extract and export KSU version info from dev branch
  58. KSU_GIT_VERSION=$(git rev-list --count refs/remotes/origin/dev 2>/dev/null)
  59. KSU_GIT_TAG=$(git describe --tags --abbrev=0 refs/remotes/origin/dev 2>/dev/null || echo "")
  60. KSU_COMMIT=$(git rev-parse --short refs/remotes/origin/dev 2>/dev/null)
  61. KSU_VERSION=$((30000 + KSU_GIT_VERSION))
  62. echo "KSU_GIT_TAG=$KSU_GIT_TAG" >> $GITHUB_ENV
  63. echo "KSU_VERSION=$KSU_VERSION" >> $GITHUB_ENV
  64. echo "KSU_COMMIT=$KSU_COMMIT" >> $GITHUB_ENV
  65. - name: 'Fix KernelSU-Next'
  66. shell: bash
  67. run: |
  68. set -euo pipefail
  69. cd "$COMMON/KernelSU-Next"
  70. cp ${{ github.action_path }}/patches/static.patch ./
  71. patch -p1 < static.patch