| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- name: Setup SUSFS
- description: Clone and apply SUSFS patches with version-specific fixes
- inputs:
- android_version:
- description: 'Android version (e.g., android15)'
- required: true
- kernel_version:
- description: 'Kernel version (e.g., 6.6)'
- required: true
- os_patch_level:
- description: 'OS patch level (e.g., 2024-07)'
- required: true
- sublevel:
- description: 'Kernel sublevel'
- required: true
- kernel_root:
- description: 'Path to kernel root directory'
- required: true
- kernel_patches:
- description: 'Path to kernel_patches directory'
- required: true
- susfs4ksu:
- description: 'Path to susfs4ksu directory'
- required: true
- runs:
- using: composite
- steps:
- - name: Setup SUSFS Branch
- shell: bash
- run: |
- echo "========================================"
- echo " Setting up SUSFS "
- echo "========================================"
- SUSFS_BRANCH="gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}"
-
- # Use downloaded SUSFS artifact
- if [ -d "susfs_cache/$SUSFS_BRANCH" ]; then
- echo "Using downloaded SUSFS branch: $SUSFS_BRANCH"
- cp -r "susfs_cache/$SUSFS_BRANCH" susfs4ksu
- else
- echo "ERROR: SUSFS branch $SUSFS_BRANCH not found in downloaded artifacts"
- echo "Available branches:"
- ls -d susfs_cache/* 2>/dev/null || echo "No branches found"
- exit 1
- fi
-
- SUSFS_VERSION="2.0.0"
- echo "SUSFS_VERSION=$SUSFS_VERSION" >> $GITHUB_ENV
-
- - name: Apply Base SUSFS Patches
- shell: bash
- working-directory: ${{ inputs.kernel_root }}/common
- run: |
- echo "Applying SUSFS base patches..."
- cp "${{ inputs.susfs4ksu }}/kernel_patches/fs/"* "${{ inputs.kernel_root }}/common/fs/"
- cp "${{ inputs.susfs4ksu }}/kernel_patches/include/linux/"* "${{ inputs.kernel_root }}/common/include/linux/"
- cp ${{ inputs.susfs4ksu }}/kernel_patches/50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch ./
- patch -p1 < 50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch || true
- echo "✓ Base SUSFS patches applied"
-
- - name: Apply Android 12 5.10 Fixes
- if: inputs.android_version == 'android12' && inputs.kernel_version == '5.10'
- shell: bash
- working-directory: ${{ inputs.kernel_root }}/common
- run: |
- echo "Applying Android 12 5.10 specific fixes..."
- SUBLEVEL=${{ inputs.sublevel }}
- SUSFS_VERSION=${{ env.SUSFS_VERSION }}
-
- if [[ "$SUBLEVEL" -le 209 ]]; then
- sed -i -e 's/goto show_pad;/return 0;/' ./fs/proc/task_mmu.c
- fi
- if [[ "$SUBLEVEL" -le 117 ]]; then
- cp ${{ inputs.kernel_patches }}/wild/susfs_fix_patches/v${SUSFS_VERSION}/a12-5.10/fdinfo.c.patch ./
- patch -p1 < fdinfo.c.patch
- fi
- if [[ "$SUBLEVEL" -le 43 ]]; then
- cp ${{ inputs.kernel_patches }}/wild/susfs_fix_patches/v${SUSFS_VERSION}/a12-5.10/base.c.patch ./
- patch -p1 < base.c.patch
- fi
- echo "✓ Android 12 5.10 fixes applied"
-
- - name: Apply Android 13 5.10 Fixes
- if: inputs.android_version == 'android13' && inputs.kernel_version == '5.10'
- shell: bash
- working-directory: ${{ inputs.kernel_root }}/common
- run: |
- echo "Applying Android 13 5.10 specific fixes..."
- SUBLEVEL=${{ inputs.sublevel }}
- SUSFS_VERSION=${{ env.SUSFS_VERSION }}
-
- if [[ "$SUBLEVEL" -le 107 ]]; then
- cp ${{ inputs.kernel_patches }}/wild/susfs_fix_patches/v${SUSFS_VERSION}/a13-5.10/fdinfo.c.patch ./
- patch -p1 < fdinfo.c.patch
- fi
- if [[ "$SUBLEVEL" -le 209 && "${{ inputs.os_patch_level }}" != "2024-05" ]]; then
- sed -i -e 's/goto show_pad;/return 0;/' ./fs/proc/task_mmu.c
- fi
- echo "✓ Android 13 5.10 fixes applied"
-
- - name: Apply Android 13 5.15 Fixes
- if: inputs.android_version == 'android13' && inputs.kernel_version == '5.15'
- shell: bash
- working-directory: ${{ inputs.kernel_root }}/common
- run: |
- echo "Applying Android 13 5.15 specific fixes..."
- SUBLEVEL=${{ inputs.sublevel }}
- SUSFS_VERSION=${{ env.SUSFS_VERSION }}
-
- if [ "$SUBLEVEL" -le 41 ]; then
- cp ${{ inputs.kernel_patches }}/wild/susfs_fix_patches/v${SUSFS_VERSION}/a13-5.15/namespace.c.patch ./
- patch -p1 < namespace.c.patch
-
- cp ${{ inputs.kernel_patches }}/wild/susfs_fix_patches/v${SUSFS_VERSION}/a13-5.15/fdinfo.c.patch ./
- patch -p1 < fdinfo.c.patch
-
- cp ${{ inputs.kernel_patches }}/wild/susfs_fix_patches/v${SUSFS_VERSION}/a13-5.15/open.c.patch ./
- patch -p1 < open.c.patch
-
- sed -i 's|is_i_uid_not_allowed(i_uid_into_mnt(i_user_ns(inode), inode).val)))|is_i_uid_not_allowed(inode->i_uid.val)))|g' fs/susfs.c
- fi
- if [[ "$SUBLEVEL" -le 148 && "${{ inputs.os_patch_level }}" != "2024-05" ]]; then
- sed -i -e 's/goto show_pad;/return 0;/' ./fs/proc/task_mmu.c
- fi
- echo "✓ Android 13 5.15 fixes applied"
-
- - name: Apply Android 14 5.15 Fixes
- if: inputs.android_version == 'android14' && inputs.kernel_version == '5.15'
- shell: bash
- working-directory: ${{ inputs.kernel_root }}/common
- run: |
- echo "Applying Android 14 5.15 specific fixes..."
- SUBLEVEL=${{ inputs.sublevel }}
-
- if [[ "$SUBLEVEL" -le 148 && "${{ inputs.os_patch_level }}" != "2024-05" ]]; then
- sed -i -e 's/goto show_pad;/return 0;/' ./fs/proc/task_mmu.c
- fi
- echo "✓ Android 14 5.15 fixes applied"
-
- - name: Apply Android 14 6.1 Fixes
- if: inputs.android_version == 'android14' && inputs.kernel_version == '6.1'
- shell: bash
- working-directory: ${{ inputs.kernel_root }}/common
- run: |
- echo "Applying Android 14 6.1 specific fixes..."
- SUBLEVEL=${{ inputs.sublevel }}
-
- if [[ "$SUBLEVEL" -le 75 && "${{ inputs.os_patch_level }}" != "2024-05" ]]; then
- sed -i -e 's/goto show_pad;/return 0;/' ./fs/proc/task_mmu.c
- fi
- echo "✓ Android 14 6.1 fixes applied"
-
- - name: Apply Android 15 6.6 Fixes
- if: inputs.android_version == 'android15' && inputs.kernel_version == '6.6'
- shell: bash
- working-directory: ${{ inputs.kernel_root }}/common
- run: |
- echo "Applying Android 15 6.6 specific fixes..."
- SUBLEVEL=${{ inputs.sublevel }}
- SUSFS_VERSION=${{ env.SUSFS_VERSION }}
-
- if [[ "$SUBLEVEL" -ge 98 ]]; then
- cp ${{ inputs.kernel_patches }}/wild/susfs_fix_patches/v${SUSFS_VERSION}/a15-6.6/base.c.patch ./
- patch -p1 < base.c.patch
- fi
- if [[ "$SUBLEVEL" -le 58 ]]; then
- cp ${{ inputs.kernel_patches }}/wild/susfs_fix_patches/v${SUSFS_VERSION}/a15-6.6/task_mmu.c.patch ./
- patch -p1 < task_mmu.c.patch
- fi
- echo "✓ Android 15 6.6 fixes applied"
-
- - name: SUSFS Setup Complete
- shell: bash
- run: |
- echo "✓ SUSFS Setup Complete"
- echo " Version: 2.0.0"
- echo " Branch: gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}"
- echo "========================================"
|