Browse Source

Update action.yml to conditionally modify patch

Add conditional check to modify patch based on content.
jimsterino98 1 month ago
parent
commit
9bb3962849
1 changed files with 5 additions and 1 deletions
  1. 5 1
      .github/actions/susfs-patches/action.yml

+ 5 - 1
.github/actions/susfs-patches/action.yml

@@ -81,7 +81,11 @@ runs:
      run: |
       cd "$COMMON"
       # Apply SUSFS core patch
-      sed -i 's/end = VMA_PAD_START(vma);/end = vma->vm_end;/' 50_add_susfs_in_gki-$ANDROID_VERSION-$KERNEL_VERSION.patch 
+      
+      if grep -q 'VMA_PAD_START(vma)' 50_add_susfs_in_gki-$ANDROID_VERSION-$KERNEL_VERSION.patch; then
+      sed -i 's/VMA_PAD_START(vma)/vma->vm_end/' 50_add_susfs_in_gki-$ANDROID_VERSION-$KERNEL_VERSION.patch
+      fi
+      
       patch -p1 < 50_add_susfs_in_gki-$ANDROID_VERSION-$KERNEL_VERSION.patch || true
       rm -rf 50_add_susfs_in_gki-$ANDROID_VERSION-$KERNEL_VERSION.patch