action.yml 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. name: Setup SUSFS
  2. description: Clone and apply SUSFS patches with version-specific fixes
  3. inputs:
  4. android_version:
  5. description: 'Android version (e.g., android15)'
  6. required: true
  7. kernel_version:
  8. description: 'Kernel version (e.g., 6.6)'
  9. required: true
  10. os_patch_level:
  11. description: 'OS patch level (e.g., 2024-07)'
  12. required: true
  13. sublevel:
  14. description: 'Kernel sublevel'
  15. required: true
  16. susfs_commit:
  17. description: 'Commit map (branch:commit,branch:commit...)'
  18. required: false
  19. runs:
  20. using: composite
  21. steps:
  22. - name: Setup SUSFS Branch
  23. shell: bash
  24. run: |
  25. SUSFS_BRANCH="gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}"
  26. SUSFS_REPO="https://gitlab.com/simonpunk/susfs4ksu.git"
  27. echo "Preparing SUSFS for branch: $SUSFS_BRANCH"
  28. # Parse commit map to find the commit for this branch
  29. COMMIT_MAP="${{ inputs.susfs_commit }}"
  30. TARGET_COMMIT=""
  31. if [ -n "$COMMIT_MAP" ]; then
  32. # Split by comma
  33. IFS=',' read -ra ENTRIES <<< "$COMMIT_MAP"
  34. for entry in "${ENTRIES[@]}"; do
  35. # Split by colon
  36. IFS=':' read -r branch commit <<< "$entry"
  37. if [ "$branch" == "$SUSFS_BRANCH" ]; then
  38. TARGET_COMMIT="$commit"
  39. break
  40. fi
  41. done
  42. fi
  43. if [ -n "$TARGET_COMMIT" ]; then
  44. echo "Found specific commit for $SUSFS_BRANCH: $TARGET_COMMIT"
  45. git clone "$SUSFS_REPO" -b "$SUSFS_BRANCH" susfs4ksu
  46. cd susfs4ksu
  47. git checkout "$TARGET_COMMIT"
  48. cd ..
  49. else
  50. echo "No specific commit found for $SUSFS_BRANCH, cloning latest..."
  51. git clone "$SUSFS_REPO" -b "$SUSFS_BRANCH" --depth=1 susfs4ksu
  52. fi
  53. SUSFS_VERSION="v2.1.0"
  54. echo "SUSFS_VERSION=$SUSFS_VERSION" >> $GITHUB_ENV
  55. - name: Enable KernelSU SUSFS Config
  56. shell: bash
  57. working-directory: ${{ github.workspace }}/kernel
  58. run: |
  59. cat >> "${{ github.workspace }}/wild_gki.fragment" << 'EOF'
  60. # KernelSU SUSFS Configuration
  61. CONFIG_KSU_SUSFS=y
  62. CONFIG_KSU_SUSFS_SUS_PATH=y
  63. CONFIG_KSU_SUSFS_SUS_MOUNT=y
  64. CONFIG_KSU_SUSFS_SUS_KSTAT=y
  65. CONFIG_KSU_SUSFS_SPOOF_UNAME=y
  66. CONFIG_KSU_SUSFS_ENABLE_LOG=y
  67. CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y
  68. CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG=y
  69. CONFIG_KSU_SUSFS_OPEN_REDIRECT=y
  70. CONFIG_KSU_SUSFS_SUS_MAP=y
  71. EOF
  72. - name: Apply Kernel SUSFS Patches
  73. shell: bash
  74. working-directory: ${{ github.workspace }}/kernel/common
  75. run: |
  76. # Apply base SUSFS patches
  77. cp "${{ github.workspace }}/susfs4ksu/kernel_patches/fs/"* "${{ github.workspace }}/kernel/common/fs/"
  78. cp "${{ github.workspace }}/susfs4ksu/kernel_patches/include/linux/"* "${{ github.workspace }}/kernel/common/include/linux/"
  79. cp ${{ github.workspace }}/susfs4ksu/kernel_patches/50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch ./
  80. patch -p1 < 50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch || true
  81. - name: Apply KSU SUSFS Patches
  82. shell: bash
  83. working-directory: ${{ github.workspace }}/kernel/KernelSU-Next
  84. run: |
  85. cp ${{ github.workspace }}/kernel_patches/wild/ksun-0daf55582-susfs-v2.1.0-e259e7d6.patch ./
  86. patch -p1 < ksun-0daf55582-susfs-v2.1.0-e259e7d6.patch