| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- name: apply susfs patches
- description: apply susfs patches
- inputs:
- android_version:
- description: 'Android version (android14)'
- required: true
- kernel_version:
- description: 'Kernel version (6.1)'
- required: true
- branch:
- description: 'device kernel'
- required: true
- nomount:
- description: 'nomount'
- required: true
- runs:
- using: composite
- steps:
- - name: Apply to KSUN
- shell: bash
- run: |
- #cd "$COMMON/KernelSU-Next"
- #SUSFS_VERSION="v2.1.0"
-
- # Apply SUSFS to KernelSU-Next
- #cp "$SUSFS4KSU/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch" .
- #patch -p1 < 10_enable_susfs_for_ksu.patch || true
- #rm -rf 10_enable_susfs_for_ksu.patch
- #Fix rejects from adding susfs to KSUN
- #cp "$KERNEL_PATCHES/next/susfs_fix_patches/$SUSFS_VERSION/"*.patch .
- #rm -rf multi_manager.patch
- #for p in *.patch; do
- # patch -p1 < "$p"
- # rm -f "$p"
- #done
-
- - name: Copy required files
- shell: bash
- run: |
- # Apply SUSFS to kernel
- cd "$COMMON"
- cp "$SUSFS4KSU/kernel_patches/fs/"* ./fs/
- cp "$SUSFS4KSU/kernel_patches/include/linux/"* ./include/linux/
- cp "$SUSFS4KSU/kernel_patches/50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch" ./
- - name: prepare namespace and open.c for susfs patch because scamsung
- shell: bash
- run: |
- cd "$COMMON"
- #Prepare open.c for susfs patching
- sed -i '/#ifdef CONFIG_SECURITY_DEFEX/,/^#endif/d' fs/open.c
- #Prepare namespace.c for susfs patching
- sed -i '/copy_flags = CL_COPY_UNBINDABLE | CL_EXPIRE;/,/#endif/ {
- /#ifdef CONFIG_KDP_NS/,/#endif/ {
- /#else/,/#endif/!d
- /#else/d
- /#endif/d
- }
- }' fs/namespace.c
-
- - name: apply susfs patch and fix if necessary
- shell: bash
- run: |
- cd "$COMMON"
- # Apply SUSFS core patch
- patch -p1 < 50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch || true
- rm -rf 50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch
- shopt -s nullglob
- patches=("$KERNEL_PATCHES/samsung/${{ inputs.branch }}"/*.patch)
-
- if [ ${#patches[@]} -gt 0 ]; then
- echo "Patches found, applying..."
- cp "${patches[@]}" ./
-
- # Fix SUSFS rejects
- for p in *.patch; do
- patch -p1 < "$p"
- rm -f "$p"
- done
- shopt -u nullglob
- else
- echo "No patch file found, skipping"
- fi
- - name: add ksu-susfs to config
- shell: bash
- run: |
- cat >> "$GKI_DEFCONFIG" << 'EOF'
- # SUSFS Configuration
- CONFIG_KSU_SUSFS=y
- EOF
- - name: if using nomount, disable sus_mount
- if: inputs.nomount == 'true'
- shell: bash
- run: |
- cat >> "$GKI_DEFCONFIG" << 'EOF'
- CONFIG_KSU_SUSFS_SUS_MOUNT=n
- EOF
|