Parcourir la source

decouple: extract inline patches into modular composite actions

Split monolithic misc action into dedicated actions for each patch domain:
- ntsync: NTSync compatibility patches (android16-6.12 cleanup + patches)
- ptrace: ptrace compat patches for kernels < 5.16
- unicode-fix: unicode bypass fix with version-specific patch selection
- performance: experimental/performance patches with version guards
- bbrv3: BBRv3 TCP congestion control patches (7 version branches)

Update misc action to only handle kernel configs (drop all patch steps).
Update build.yml to call each action explicitly in correct order:
  bbrv3 → networking → ntsync → ptrace → unicode → performance → misc

Benefits:
- Each action is independently testable
- Patch logic is isolated from config logic
- Workflow order is explicit and enforceable
- Easier to add/remove patches without touching misc
TheWildJames il y a 2 mois
Parent
commit
b1824b0726

+ 55 - 0
.github/actions/bbrv3/action.yml

@@ -0,0 +1,55 @@
+name: 'Apply BBRv3 Patches'
+description: 'Apply BBRv3 TCP congestion control patches with version-specific patch selection'
+inputs:
+  version:
+    description: 'Kernel config version (e.g., android15-6.6)'
+    required: true
+  sublevel:
+    description: 'Kernel sublevel'
+    required: true
+
+runs:
+  using: 'composite'
+  steps:
+    - name: Apply BBRv3 Patch
+      shell: bash
+      working-directory: ${{ github.workspace }}/kernel/common
+      run: |
+        set -euo pipefail
+        if [[ ${{ inputs.version }} == "android16-6.12" ]]; then
+          cp "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-android15-6.6.patch" temp.patch
+          #patch -p1 -F 3 < temp.patch
+          rm temp.patch
+        elif [[ ${{ inputs.version }} == "android15-6.6" ]]; then
+          cp "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-android15-6.6.patch" temp.patch
+          patch -p1 -F 3 < temp.patch
+          rm temp.patch
+        elif [[ ${{ inputs.version }} == "android14-6.1" ]]; then
+          cp "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-android14-6.1.patch" temp.patch
+          patch -p1 -F 3 < temp.patch
+          rm temp.patch
+        elif [[ ${{ inputs.version }} == "android14-5.15" ]]; then
+          cp "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-android13-5.15.patch" temp.patch
+          patch -p1 -F 3 < temp.patch
+          rm temp.patch
+        elif [[ ${{ inputs.version }} == "android13-5.15" && ${{ inputs.sublevel }} -ge "74" ]]; then
+          cp "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-android13-5.15.patch" temp.patch
+          patch -p1 -F 3 < temp.patch
+          rm temp.patch
+        elif [[ ${{ inputs.version }} == "android13-5.10" && ${{ inputs.sublevel }} -ge "186" ]]; then
+          cp "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-android12-5.10.patch" temp.patch
+          patch -p1 -F 3 < temp.patch
+          rm temp.patch
+        elif [[ ${{ inputs.version }} == "android12-5.10" && ${{ inputs.sublevel }} -ge "185" ]]; then
+          cp "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-android12-5.10.patch" temp.patch
+          patch -p1 -F 3 < temp.patch
+          rm temp.patch
+        fi
+
+        echo "✅ BBRv3 patches applied"
+
+    - name: Enable BBRv3 Kernel Config
+      uses: ./.github/actions/set-kernel-config
+      with:
+        config_list: |
+          CONFIG_TCP_CONG_BBR3=y

+ 1 - 126
.github/actions/misc/action.yml

@@ -38,129 +38,4 @@ runs:
           CONFIG_NETWORK_FILESYSTEMS=y
           CONFIG_KEYS=y
           CONFIG_CIFS_XATTR=y
-          CONFIG_CIFS_POSIX=y
-
-    - name: Apply NTSync Patch
-      shell: bash
-      working-directory: ${{ github.workspace }}/kernel/common
-      run: |
-        set -euo pipefail
-
-        echo "Using patch: $(basename $NTSYNC_PATCH)"
-        if [[ ${{ inputs.version }} = "android16-6.12" ]]; then
-          echo "Removing pre-existing ntsync files for android16-6.12"
-          rm -f include/uapi/linux/ntsync.h
-          rm -f drivers/misc/ntsync.c
-        fi
-
-        cp ${{ github.workspace }}/kernel_patches/common/ntsync/ntsync_compat_${{ inputs.version }}.patch ${{ github.workspace }}/kernel/common
-        patch -p1 ntsync_compat_${{ inputs.version }}.patch
-        
-        cp ${{ github.workspace }}/kernel_patches/common/ntsync/ntsync_base.patch ${{ github.workspace }}/kernel/common
-        patch -p1 < ntsync_base.patch
-        cat >> "${{ github.workspace }}/kernel/common/arch/arm64/configs/gki_defconfig" << 'EOF'
-        CONFIG_NTSYNC=y
-        EOF
-
-    - name: Apply Ptrace Patch
-      shell: bash
-      working-directory: ${{ github.workspace }}/kernel/common
-      run: |
-        set -euo pipefail
-        KERNEL_VERSION="${{ inputs.kernel_version }}"
-        MIN_VERSION="5.16"
-        if [ "$(printf '%s\n' "$KERNEL_VERSION" "$MIN_VERSION" | sort -V | head -n1)" = "$KERNEL_VERSION" ]; then
-          echo "Patching ptrace!"
-          patch -p1 -F 3 < "${{ github.workspace }}/kernel_patches/gki_ptrace.patch"
-        else
-          echo "Kernel >= $MIN_VERSION, skipping ptrace patch"
-        fi
-
-    - name: Apply Unicode Fix Patch
-      shell: bash
-      working-directory: ${{ github.workspace }}/kernel/common
-      run: |
-        set -euo pipefail
-        KERNEL_VERSION="${{ inputs.kernel_version }}"
-        MIN_VERSION="5.16"
-        
-        echo "Patching unicode!"
-        if [ "$(printf '%s\n' "$KERNEL_VERSION" "$MIN_VERSION" | sort -V | head -n1)" = "$KERNEL_VERSION" ]; then
-            patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/unicode_bypass_fix_6.1-.patch"
-        else
-            patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/unicode_bypass_fix_6.1+.patch"
-        fi
-
-    - name: Apply Other Patches
-      shell: bash
-      if: true
-      working-directory: ${{ github.workspace }}/kernel/common
-      run: |
-        set -euo pipefail
-        KERNEL_VERSION="${{ inputs.kernel_version }}"
-        MIN_VERSION="5.16"
-        
-        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/optimized_mem_operations.patch"
-        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/file_struct_8bytes_align.patch"
-        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/reduce_cache_pressure.patch"
-        
-        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/mem_opt_prefetch.patch"
-        
-        if [ "$(printf '%s\n' "$KERNEL_VERSION" "$MIN_VERSION" | sort -V | tail -n1)" = "$KERNEL_VERSION" ]; then
-          patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/optimise_memcmp.patch"
-        elif [ "$(printf '%s\n' "$KERNEL_VERSION" "5.11" | sort -V | tail -n1)" = "$KERNEL_VERSION" ]; then
-          sed -e 's/SYM_FUNC_START(__pi_memcmp)/SYM_FUNC_START_WEAK_PI(memcmp)/' -e 's/SYM_FUNC_END(__pi_memcmp)/SYM_FUNC_END_PI(memcmp)/' -e 's/SYM_FUNC_ALIAS_WEAK(memcmp, __pi_memcmp)/EXPORT_SYMBOL_NOKASAN(memcmp)/' "${{ github.workspace }}/kernel_patches/common/optimise_memcmp.patch" | patch -p1 --forward
-        else
-          echo "Optimised memcmp patch not found!"
-        fi
-        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/minimise_wakeup_time.patch"
-        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/int_sqrt.patch"
-        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/force_tcp_nodelay.patch"
-        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/reduce_gc_thread_sleep_time.patch"
-        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/add_timeout_wakelocks_globally.patch"
-        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/f2fs_reduce_congestion.patch"
-        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/reduce_freeze_timeout.patch"
-        
-        if [ "$(printf '%s\n' "$KERNEL_VERSION" "$MIN_VERSION" | sort -V | head -n1)" = "$KERNEL_VERSION" ]; then
-          patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/clear_page_16bytes_align.patch"
-        else
-          cat "${{ github.workspace }}/kernel_patches/common/clear_page_16bytes_align.patch" | sed -e 's/SYM_FUNC_START_PI(clear_page)/SYM_FUNC_START_PI(__pi_clear_page)/' | patch -p1 -F3 --forward
-        fi
-        
-        echo "Patching add_limitation_scaling_min_freq.patch"
-        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/add_limitation_scaling_min_freq.patch"
-        echo "Patching re_write_limitation_scaling_min_freq.patch"
-        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/re_write_limitation_scaling_min_freq.patch"
-        echo "Patching adjust_cpu_scan_order.patch"
-        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/adjust_cpu_scan_order.patch"
-        echo "Patching avoid_extra_s2idle_wake_attempts.patch"
-        FILE="drivers/base/power/wakeup.c"
-        # Check if the function exists
-        if grep -q "^void pm_system_wakeup(void)" "$FILE"; then
-            # Check if the line exists inside the function
-            if sed -n '/^void pm_system_wakeup(void)/,/^}/p' "$FILE" | grep -q 'suspend_abort_fs_sync();'; then
-                # Remove the line
-                sed -i '/^void pm_system_wakeup(void)/,/^}/{
-                    /suspend_abort_fs_sync();/d
-                }' "$FILE"
-            fi
-        fi
-        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/avoid_extra_s2idle_wake_attempts.patch"
-        echo "Patching disable_cache_hot_buddy.patch"
-        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/disable_cache_hot_buddy.patch"
-        echo "Patching f2fs_enlarge_min_fsync_blocks.patch"
-        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/f2fs_enlarge_min_fsync_blocks.patch"
-        echo "Patching increase_ext4_default_commit_age.patch"
-        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/increase_ext4_default_commit_age.patch"
-        echo "Patching increase_sk_mem_packets.patch"
-        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/increase_sk_mem_packets.patch"
-        echo "Patching reduce_pci_pme_wakeups.patch"
-        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/reduce_pci_pme_wakeups.patch"
-        echo "Patching silence_irq_cpu_logspam.patch"
-        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/silence_irq_cpu_logspam.patch"
-        echo "Patching silence_system_logspam.patch"
-        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/silence_system_logspam.patch"
-        echo "Patching use_unlikely_wrap_cpufreq.patch"
-        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/use_unlikely_wrap_cpufreq.patch"
-        
-        echo "✅ Other patches applied"
+          CONFIG_CIFS_POSIX=y

+ 0 - 45
.github/actions/networking/action.yml

@@ -17,51 +17,6 @@ inputs:
 runs:
   using: "composite"
   steps:
-    - name: 'Apply BBRv3'
-      shell: bash
-      if: true
-      working-directory: ${{ github.workspace }}/kernel/common
-      run: |
-        set -euo pipefail
-        if [[ ${{ inputs.version }} == "android16-6.12" ]]; then
-          cp "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-android15-6.6.patch" temp.patch
-          #patch -p1 -F 3 < temp.patch
-          rm temp.patch
-        elif [[ ${{ inputs.version }} == "android15-6.6" ]]; then
-          cp "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-android15-6.6.patch" temp.patch
-          patch -p1 -F 3 < temp.patch
-          rm temp.patch
-        elif [[ ${{ inputs.version }} == "android14-6.1" ]]; then
-          cp "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-android14-6.1.patch" temp.patch
-          patch -p1 -F 3 < temp.patch
-          rm temp.patch
-        elif [[ ${{ inputs.version }} == "android14-5.15" ]]; then
-          cp "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-android13-5.15.patch" temp.patch
-          patch -p1 -F 3 < temp.patch
-          rm temp.patch
-        elif [[ ${{ inputs.version }} == "android13-5.15" && ${{ inputs.sublevel }} -ge "74" ]]; then
-          cp "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-android13-5.15.patch" temp.patch
-          patch -p1 -F 3 < temp.patch
-          rm temp.patch
-        elif [[ ${{ inputs.version }} == "android13-5.10" && ${{ inputs.sublevel }} -ge "186" ]]; then
-          cp "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-android12-5.10.patch" temp.patch
-          patch -p1 -F 3 < temp.patch
-          rm temp.patch
-        elif [[ ${{ inputs.version }} == "android12-5.10" && ${{ inputs.sublevel }} -ge "185" ]]; then
-          cp "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-android12-5.10.patch" temp.patch
-          patch -p1 -F 3 < temp.patch
-          rm temp.patch
-        fi
-        
-        echo "✅ BBRv3 patches applied"
-
-    - name: Enable Kernel Configs
-      if: true
-      uses: ./.github/actions/set-kernel-config
-      with:
-        config_list: |
-          CONFIG_TCP_CONG_BBR3=y
-
     - name: Enable Kernel Configs
       uses: ./.github/actions/set-kernel-config
       with:

+ 34 - 0
.github/actions/ntsync/action.yml

@@ -0,0 +1,34 @@
+name: 'Apply NTSync Patches'
+description: 'Apply ntsync compatibility patches and enable CONFIG_NTSYNC in defconfig'
+inputs:
+  version:
+    description: 'Kernel config version (e.g., android14-6.12)'
+    required: true
+  kernel_version:
+    description: 'Kernel version (e.g., 6.1)'
+    required: true
+
+runs:
+  using: 'composite'
+  steps:
+    - name: Apply NTSync Patch
+      shell: bash
+      working-directory: ${{ github.workspace }}/kernel/common
+      run: |
+        set -euo pipefail
+
+        echo "Using patch: $(basename $NTSYNC_PATCH)"
+        if [[ ${{ inputs.version }} = "android16-6.12" ]]; then
+          echo "Removing pre-existing ntsync files for android16-6.12"
+          rm -f include/uapi/linux/ntsync.h
+          rm -f drivers/misc/ntsync.c
+        fi
+
+        cp ${{ github.workspace }}/kernel_patches/common/ntsync/ntsync_compat_${{ inputs.version }}.patch ${{ github.workspace }}/kernel/common
+        patch -p1 ntsync_compat_${{ inputs.version }}.patch
+        
+        cp ${{ github.workspace }}/kernel_patches/common/ntsync/ntsync_base.patch ${{ github.workspace }}/kernel/common
+        patch -p1 < ntsync_base.patch
+        cat >> "${{ github.workspace }}/kernel/common/arch/arm64/configs/gki_defconfig" << 'EOF'
+        CONFIG_NTSYNC=y
+        EOF

+ 82 - 0
.github/actions/performance/action.yml

@@ -0,0 +1,82 @@
+name: 'Apply Performance Patches'
+description: 'Apply experimental kernel patches with version-specific logic'
+inputs:
+  kernel_version:
+    description: 'Kernel version (e.g., 6.1)'
+    required: true
+
+runs:
+  using: 'composite'
+  steps:
+    - name: Apply Experimental Patches
+      shell: bash
+      working-directory: ${{ github.workspace }}/kernel/common
+      run: |
+        set -euo pipefail
+        KERNEL_VERSION="${{ inputs.kernel_version }}"
+        MIN_VERSION="5.16"
+
+        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/optimized_mem_operations.patch"
+        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/file_struct_8bytes_align.patch"
+        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/reduce_cache_pressure.patch"
+
+        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/mem_opt_prefetch.patch"
+
+        if [ "$(printf '%s\n' "$KERNEL_VERSION" "$MIN_VERSION" | sort -V | tail -n1)" = "$KERNEL_VERSION" ]; then
+          patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/optimise_memcmp.patch"
+        elif [ "$(printf '%s\n' "$KERNEL_VERSION" "5.11" | sort -V | tail -n1)" = "$KERNEL_VERSION" ]; then
+          sed -e 's/SYM_FUNC_START(__pi_memcmp)/SYM_FUNC_START_WEAK_PI(memcmp)/' -e 's/SYM_FUNC_END(__pi_memcmp)/SYM_FUNC_END_PI(memcmp)/' -e 's/SYM_FUNC_ALIAS_WEAK(memcmp, __pi_memcmp)/EXPORT_SYMBOL_NOKASAN(memcmp)/' "${{ github.workspace }}/kernel_patches/common/optimise_memcmp.patch" | patch -p1 --forward
+        else
+          echo "Optimised memcmp patch not found!"
+        fi
+        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/minimise_wakeup_time.patch"
+        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/int_sqrt.patch"
+        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/force_tcp_nodelay.patch"
+        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/reduce_gc_thread_sleep_time.patch"
+        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/add_timeout_wakelocks_globally.patch"
+        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/f2fs_reduce_congestion.patch"
+        patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/reduce_freeze_timeout.patch"
+
+        if [ "$(printf '%s\n' "$KERNEL_VERSION" "$MIN_VERSION" | sort -V | head -n1)" = "$KERNEL_VERSION" ]; then
+          patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/clear_page_16bytes_align.patch"
+        else
+          cat "${{ github.workspace }}/kernel_patches/common/clear_page_16bytes_align.patch" | sed -e 's/SYM_FUNC_START_PI(clear_page)/SYM_FUNC_START_PI(__pi_clear_page)/' | patch -p1 -F3 --forward
+        fi
+
+        echo "Patching add_limitation_scaling_min_freq.patch"
+        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/add_limitation_scaling_min_freq.patch"
+        echo "Patching re_write_limitation_scaling_min_freq.patch"
+        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/re_write_limitation_scaling_min_freq.patch"
+        echo "Patching adjust_cpu_scan_order.patch"
+        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/adjust_cpu_scan_order.patch"
+        echo "Patching avoid_extra_s2idle_wake_attempts.patch"
+        FILE="drivers/base/power/wakeup.c"
+        # Check if the function exists
+        if grep -q "^void pm_system_wakeup(void)" "$FILE"; then
+            # Check if the line exists inside the function
+            if sed -n '/^void pm_system_wakeup(void)/,/^}/p' "$FILE" | grep -q 'suspend_abort_fs_sync();'; then
+                # Remove the line
+                sed -i '/^void pm_system_wakeup(void)/,/^}/{
+                    /suspend_abort_fs_sync();/d
+                }' "$FILE"
+            fi
+        fi
+        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/avoid_extra_s2idle_wake_attempts.patch"
+        echo "Patching disable_cache_hot_buddy.patch"
+        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/disable_cache_hot_buddy.patch"
+        echo "Patching f2fs_enlarge_min_fsync_blocks.patch"
+        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/f2fs_enlarge_min_fsync_blocks.patch"
+        echo "Patching increase_ext4_default_commit_age.patch"
+        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/increase_ext4_default_commit_age.patch"
+        echo "Patching increase_sk_mem_packets.patch"
+        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/increase_sk_mem_packets.patch"
+        echo "Patching reduce_pci_pme_wakeups.patch"
+        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/reduce_pci_pme_wakeups.patch"
+        echo "Patching silence_irq_cpu_logspam.patch"
+        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/silence_irq_cpu_logspam.patch"
+        echo "Patching silence_system_logspam.patch"
+        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/silence_system_logspam.patch"
+        echo "Patching use_unlikely_wrap_cpufreq.patch"
+        patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/use_unlikely_wrap_cpufreq.patch"
+
+        echo "✅ Other patches applied"

+ 23 - 0
.github/actions/ptrace/action.yml

@@ -0,0 +1,23 @@
+name: 'Apply Ptrace Patch'
+description: 'Apply GKI ptrace compatibility patch for kernels < 5.16'
+inputs:
+  kernel_version:
+    description: 'Kernel version (e.g., 6.1)'
+    required: true
+
+runs:
+  using: 'composite'
+  steps:
+    - name: Apply Ptrace Patch
+      shell: bash
+      working-directory: ${{ github.workspace }}/kernel/common
+      run: |
+        set -euo pipefail
+        KERNEL_VERSION="${{ inputs.kernel_version }}"
+        MIN_VERSION="5.16"
+        if [ "$(printf '%s\n' "$KERNEL_VERSION" "$MIN_VERSION" | sort -V | head -n1)" = "$KERNEL_VERSION" ]; then
+          echo "Patching ptrace!"
+          patch -p1 -F 3 < "${{ github.workspace }}/kernel_patches/gki_ptrace.patch"
+        else
+          echo "Kernel >= $MIN_VERSION, skipping ptrace patch"
+        fi

+ 24 - 0
.github/actions/unicode-fix/action.yml

@@ -0,0 +1,24 @@
+name: 'Apply Unicode Fix Patch'
+description: 'Apply unicode bypass fix patch with version-specific patch selection'
+inputs:
+  kernel_version:
+    description: 'Kernel version (e.g., 6.1)'
+    required: true
+
+runs:
+  using: 'composite'
+  steps:
+    - name: Apply Unicode Fix Patch
+      shell: bash
+      working-directory: ${{ github.workspace }}/kernel/common
+      run: |
+        set -euo pipefail
+        KERNEL_VERSION="${{ inputs.kernel_version }}"
+        MIN_VERSION="5.16"
+
+        echo "Patching unicode!"
+        if [ "$(printf '%s\n' "$KERNEL_VERSION" "$MIN_VERSION" | sort -V | head -n1)" = "$KERNEL_VERSION" ]; then
+            patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/unicode_bypass_fix_6.1-.patch"
+        else
+            patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/unicode_bypass_fix_6.1+.patch"
+        fi

+ 26 - 5
.github/workflows/build.yml

@@ -151,6 +151,12 @@ jobs:
       if: (contains(inputs.feature_set, 'BBG') || inputs.feature_set == 'FULL')
       uses: ./.github/actions/bbg
 
+    - name: Apply BBRv3 Patches
+      uses: ./.github/actions/bbrv3
+      with:
+        version: ${{ inputs.version }}
+        sublevel: ${{ steps.extract.outputs.sublevel }}
+
     - name: Setup Networking
       if: contains(inputs.feature_set, 'NET') || inputs.feature_set == 'FULL'
       uses: ./.github/actions/networking
@@ -167,14 +173,29 @@ jobs:
         version: ${{ inputs.version }}
         kernel_version: ${{ inputs.kernel_version }}
 
-    - name: Setup Misc Configs
-      uses: ./.github/actions/misc
+    - name: Apply NTSync Patches
+      uses: ./.github/actions/ntsync
       with:
         version: ${{ inputs.version }}
         kernel_version: ${{ inputs.kernel_version }}
-        android_version: ${{ inputs.android_version }}
-        sublevel: ${{ steps.extract.outputs.sublevel }}
-        variant: ${{ inputs.variant }}
+
+    - name: Apply Ptrace Patch
+      uses: ./.github/actions/ptrace
+      with:
+        kernel_version: ${{ inputs.kernel_version }}
+
+    - name: Apply Unicode Fix Patch
+      uses: ./.github/actions/unicode-fix
+      with:
+        kernel_version: ${{ inputs.kernel_version }}
+
+    - name: Apply Performance Patches
+      uses: ./.github/actions/performance
+      with:
+        kernel_version: ${{ inputs.kernel_version }}
+
+    - name: Setup Misc Configs
+      uses: ./.github/actions/misc
 
     - name: Apply Device-Specific Patches
       uses: ./.github/actions/apply-device-patches