Explorar o código

Add branch-specific patching logic for optimizations

Added conditional checks to skip certain patches for the SM-S926 branch to optimize the patching process.
jimsterino98 hai 2 meses
pai
achega
3ad8c20b59
Modificáronse 1 ficheiros con 12 adicións e 0 borrados
  1. 12 0
      .github/actions/optimization/action.yml

+ 12 - 0
.github/actions/optimization/action.yml

@@ -19,8 +19,12 @@ runs:
      
      patch -p1 --forward < "$KERNEL_PATCHES/common/optimized_mem_operations.patch"
      patch -p1 --forward < "$KERNEL_PATCHES/common/file_struct_8bytes_align.patch"
+     if [[ ${{ inputs.branch }} != SM-S926* ]]; then
      patch -p1 --forward < "$KERNEL_PATCHES/common/reduce_cache_pressure.patch"
      patch -p1 --forward < "$KERNEL_PATCHES/common/mem_opt_prefetch.patch"
+     else
+     echo "skipping cache pressure and opt prefetch patch for S24 plus"
+     fi
 
      if [[ ${{ inputs.branch }} == SM-A546* || ${{ inputs.branch }} == SM-S926* || ${{ inputs.branch }} == SM-A556* || ${{ inputs.branch }} == SM-M146B* || ${{ inputs.branch }} == SM-S908B* ]]; then
       if [ "$(printf '%s\n' "${{ inputs.kernel_version }}" "$MIN_VERSION" | sort -V | tail -n1)" = "${{ inputs.kernel_version }}" ]; then
@@ -42,8 +46,12 @@ runs:
 
      sed -i 's/pm_wakeup_event(dev, 2 \* MSEC_PER_SEC);/pm_wakeup_event(dev, ktime_to_ms(min) + 1);/' kernel/time/alarmtimer.c
      patch -p1 --forward < "$KERNEL_PATCHES/common/int_sqrt.patch"
+     if [[ ${{ inputs.branch }} != SM-S926* ]]; then
      patch -p1 --forward < "$KERNEL_PATCHES/common/force_tcp_nodelay.patch"
      patch -p1 --forward < "$KERNEL_PATCHES/common/reduce_gc_thread_sleep_time.patch"
+     else
+     echo "skipping force tcp no delay and reduce gc thread sleep time patches for s24 plus"
+     fi
      patch -p1 --forward < "$KERNEL_PATCHES/common/add_timeout_wakelocks_globally.patch"
      patch -p1 --forward < "$KERNEL_PATCHES/common/f2fs_reduce_congestion.patch"
      patch -p1 --forward < "$KERNEL_PATCHES/common/reduce_freeze_timeout.patch"
@@ -66,8 +74,12 @@ runs:
      else
       patch -p1 -F3 --forward < "$KERNEL_PATCHES/common/avoid_extra_s2idle_wake_attempts.patch"
      fi
+     if [[ ${{ inputs.branch }} != SM-S926* ]]; then
      echo "Patching disable_cache_hot_buddy.patch"
      patch -p1 -F3 --forward < "$KERNEL_PATCHES/common/disable_cache_hot_buddy.patch"
+     else
+     echo "skipping disable_cache_hot_buddy for s24 plus"
+     fi
      echo "Patching f2fs_enlarge_min_fsync_blocks.patch"
      patch -p1 -F3 --forward < "$KERNEL_PATCHES/common/f2fs_enlarge_min_fsync_blocks.patch"
      echo "Patching increase_ext4_default_commit_age.patch"