ソースを参照

fix bbrv3 and add custom patches

TheWildJames 2 ヶ月 前
コミット
3daf87b7c5

+ 69 - 0
.github/actions/misc/action.yml

@@ -29,3 +29,72 @@ runs:
           CONFIG_TMPFS_POSIX_ACL=y
           CONFIG_KALLSYMS=y
           CONFIG_KALLSYMS_ALL=y
+
+    - 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"
+        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
+
+        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"
+        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"

+ 22 - 3
.github/actions/networking/action.yml

@@ -10,6 +10,9 @@ inputs:
   android_version:
     description: 'Android version (e.g., android14)'
     required: true
+  sublevel:
+    description: 'Kernel sublevel'
+    required: true
 
 runs:
   using: "composite"
@@ -22,14 +25,30 @@ runs:
         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 }} == "android13-5.10" ]]; then
+        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 }} >= "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 }} >= "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
-        else
-          cp "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-${{ inputs.version }}.patch" temp.patch
+        elif [[ ${{ inputs.version }} == "android12-5.10" && ${{ inputs.sublevel }} >= "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

+ 1 - 0
.github/workflows/build.yml

@@ -158,6 +158,7 @@ jobs:
         version: ${{ inputs.version }}
         kernel_version: ${{ inputs.kernel_version }}
         android_version: ${{ inputs.android_version }}
+        sublevel: ${{ steps.extract.outputs.sublevel }}
 
     - name: DroidSpaces-OSS Patches
       if: contains(inputs.feature_set, 'DS') || inputs.feature_set == 'FULL'