action.yml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. - name: Setup pershoot KSUN with susfs
  17. if: inputs.susfs == 'true'
  18. shell: bash
  19. run: |
  20. cd "$COMMON"
  21. curl -LSs "https://raw.githubusercontent.com/pershoot/KernelSU-Next/dev-susfs/kernel/setup.sh" | bash -s dev-susfs
  22. - name: enable in defconfig
  23. if: inputs.susfs == 'false'
  24. shell: bash
  25. run: |
  26. "$COMMON/scripts/config" --file "$GKI_DEFCONFIG" --enable CONFIG_KSU
  27. - name: Extract KSU Version Info and inject into Kbuild
  28. shell: bash
  29. run: |
  30. cd "$COMMON/KernelSU-Next"
  31. # Fetch dev branch for version info (tags, commits, etc.)
  32. git fetch origin dev 2>/dev/null || true
  33. # Extract and export KSU version info from dev branch
  34. KSU_GIT_VERSION=$(git rev-list --count refs/remotes/origin/dev 2>/dev/null)
  35. KSU_GIT_TAG=$(git describe --tags --abbrev=0 refs/remotes/origin/dev 2>/dev/null || echo "")
  36. KSU_COMMIT=$(git rev-parse --short refs/remotes/origin/dev 2>/dev/null)
  37. KSU_VERSION=$((30000 + KSU_GIT_VERSION))
  38. cd kernel
  39. sed -i "s/^KSU_VERSION_FALLBACK := 1$/KSU_VERSION_FALLBACK := ${KSU_VERSION}/" Kbuild
  40. sed -i "s/^KSU_VERSION_TAG_FALLBACK := v0.0.1$/KSU_VERSION_TAG_FALLBACK := ${KSU_GIT_TAG}/" Kbuild
  41. echo "KSU_GIT_TAG=$KSU_GIT_TAG" >> $GITHUB_ENV
  42. echo "KSU_VERSION=$KSU_VERSION" >> $GITHUB_ENV
  43. echo "KSU_COMMIT=$KSU_COMMIT" >> $GITHUB_ENV
  44. - name: 'Fix KernelSU-Next'
  45. if: inputs.susfs == 'true'
  46. shell: bash
  47. run: |
  48. set -euo pipefail
  49. cd "$COMMON/KernelSU-Next"
  50. cp ${{ github.action_path }}/patches/static.patch ./
  51. patch -p1 < static.patch