Просмотр исходного кода

ci(susfs): conditionally modify namespace.c includes for Android14 6.1

The patch application for Android14 with kernel 6.1 fails due to a missing
trace/hooks/blk.h include. To apply the patch, we temporarily remove the
include line before patching and then re-add it after the patch is applied.
This ensures compatibility across different Android and kernel versions.
TheWildJames 4 месяцев назад
Родитель
Сommit
25deba2154
1 измененных файлов с 10 добавлено и 1 удалено
  1. 10 1
      .github/actions/susfs/action.yml

+ 10 - 1
.github/actions/susfs/action.yml

@@ -85,7 +85,16 @@ runs:
         cp "${{ github.workspace }}/susfs4ksu/kernel_patches/fs/"* "${{ github.workspace }}/kernel/common/fs/"
         cp "${{ github.workspace }}/susfs4ksu/kernel_patches/include/linux/"* "${{ github.workspace }}/kernel/common/include/linux/"
         cp ${{ github.workspace }}/susfs4ksu/kernel_patches/50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch ./
-        git apply -C1 < 50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch || true
+
+        if [[ "${{ inputs.android_version }}" == "android14" && "${{ inputs.kernel_version }}" == "6.1" ]]; then
+          sed -i '/#include <trace\/hooks\/blk.h>/d' fs/namespace.c
+        fi
+
+        patch -p1 -F3 < 50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch || true
+
+        if [[ "${{ inputs.android_version }}" == "android14" && "${{ inputs.kernel_version }}" == "6.1" ]]; then
+          sed -i '/^#include "internal.h"$/a #include <trace/hooks/blk.h>' fs/namespace.c
+        fi
 
     - name: Apply KSU SUSFS Patches
       shell: bash