action.yml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. name: 'Setup Misc Configs'
  2. description: 'Set up kernel configuration fragment with miscellaneous options'
  3. inputs:
  4. version:
  5. description: 'Kernel config version (e.g., android14-6.12)'
  6. required: true
  7. kernel_version:
  8. description: 'Kernel version (e.g., 6.1)'
  9. required: true
  10. android_version:
  11. description: 'Android version (e.g., android14)'
  12. required: true
  13. sublevel:
  14. description: 'Sublevel of kernel version (e.g., 1)'
  15. required: true
  16. variant:
  17. description: 'Build variant (Normal, Bypass, Wild, boot-time)'
  18. required: true
  19. runs:
  20. using: "composite"
  21. steps:
  22. - name: Enable Kernel Configs
  23. uses: ./.github/actions/set-kernel-config
  24. with:
  25. config_list: |
  26. CONFIG_OVERLAY_FS=y
  27. CONFIG_TMPFS_XATTR=y
  28. CONFIG_TMPFS_POSIX_ACL=y
  29. CONFIG_KALLSYMS=y
  30. CONFIG_KALLSYMS_ALL=y
  31. - name: Enable Kernel Configs
  32. uses: ./.github/actions/set-kernel-config
  33. with:
  34. config_list: |
  35. CONFIG_CIFS=y
  36. CONFIG_NETWORK_FILESYSTEMS=y
  37. CONFIG_KEYS=y
  38. CONFIG_CIFS_XATTR=y
  39. CONFIG_CIFS_POSIX=y
  40. - name: Apply Ptrace Patch
  41. shell: bash
  42. working-directory: ${{ github.workspace }}/kernel/common
  43. run: |
  44. set -euo pipefail
  45. KERNEL_VERSION="${{ inputs.kernel_version }}"
  46. MIN_VERSION="5.16"
  47. if [ "$(printf '%s\n' "$KERNEL_VERSION" "$MIN_VERSION" | sort -V | head -n1)" = "$KERNEL_VERSION" ]; then
  48. echo "Patching ptrace!"
  49. patch -p1 -F 3 < "${{ github.workspace }}/kernel_patches/gki_ptrace.patch"
  50. else
  51. echo "Kernel >= $MIN_VERSION, skipping ptrace patch"
  52. fi
  53. - name: Apply Unicode Fix Patch
  54. shell: bash
  55. working-directory: ${{ github.workspace }}/kernel/common
  56. run: |
  57. set -euo pipefail
  58. KERNEL_VERSION="${{ env.KERNEL_VER }}"
  59. MIN_VERSION="5.16"
  60. echo "Patching unicode!"
  61. if [ "$(printf '%s\n' "$KERNEL_VERSION" "$MIN_VERSION" | sort -V | head -n1)" = "$KERNEL_VERSION" ]; then
  62. patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/unicode_bypass_fix_6.1-.patch"
  63. else
  64. patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/unicode_bypass_fix_6.1+.patch"
  65. fi
  66. - name: Apply Other Patches
  67. shell: bash
  68. if: true
  69. working-directory: ${{ github.workspace }}/kernel/common
  70. run: |
  71. set -euo pipefail
  72. KERNEL_VERSION="${{ inputs.kernel_version }}"
  73. MIN_VERSION="5.16"
  74. patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/optimized_mem_operations.patch"
  75. patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/file_struct_8bytes_align.patch"
  76. patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/reduce_cache_pressure.patch"
  77. patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/mem_opt_prefetch.patch"
  78. if [ "$(printf '%s\n' "$KERNEL_VERSION" "$MIN_VERSION" | sort -V | tail -n1)" = "$KERNEL_VERSION" ]; then
  79. patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/optimise_memcmp.patch"
  80. elif [ "$(printf '%s\n' "$KERNEL_VERSION" "5.11" | sort -V | tail -n1)" = "$KERNEL_VERSION" ]; then
  81. 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
  82. else
  83. echo "Optimised memcmp patch not found!"
  84. fi
  85. patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/minimise_wakeup_time.patch"
  86. patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/int_sqrt.patch"
  87. patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/force_tcp_nodelay.patch"
  88. patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/reduce_gc_thread_sleep_time.patch"
  89. patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/add_timeout_wakelocks_globally.patch"
  90. patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/f2fs_reduce_congestion.patch"
  91. patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/reduce_freeze_timeout.patch"
  92. if [ "$(printf '%s\n' "$KERNEL_VERSION" "$MIN_VERSION" | sort -V | head -n1)" = "$KERNEL_VERSION" ]; then
  93. patch -p1 --forward < "${{ github.workspace }}/kernel_patches/common/clear_page_16bytes_align.patch"
  94. else
  95. 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
  96. fi
  97. echo "Patching add_limitation_scaling_min_freq.patch"
  98. patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/add_limitation_scaling_min_freq.patch"
  99. echo "Patching re_write_limitation_scaling_min_freq.patch"
  100. patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/re_write_limitation_scaling_min_freq.patch"
  101. echo "Patching adjust_cpu_scan_order.patch"
  102. patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/adjust_cpu_scan_order.patch"
  103. echo "Patching avoid_extra_s2idle_wake_attempts.patch"
  104. patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/avoid_extra_s2idle_wake_attempts.patch"
  105. echo "Patching disable_cache_hot_buddy.patch"
  106. patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/disable_cache_hot_buddy.patch"
  107. echo "Patching f2fs_enlarge_min_fsync_blocks.patch"
  108. patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/f2fs_enlarge_min_fsync_blocks.patch"
  109. echo "Patching increase_ext4_default_commit_age.patch"
  110. patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/increase_ext4_default_commit_age.patch"
  111. echo "Patching increase_sk_mem_packets.patch"
  112. patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/increase_sk_mem_packets.patch"
  113. echo "Patching reduce_pci_pme_wakeups.patch"
  114. patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/reduce_pci_pme_wakeups.patch"
  115. echo "Patching silence_irq_cpu_logspam.patch"
  116. patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/silence_irq_cpu_logspam.patch"
  117. echo "Patching silence_system_logspam.patch"
  118. patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/silence_system_logspam.patch"
  119. echo "Patching use_unlikely_wrap_cpufreq.patch"
  120. patch -p1 -F3 --forward < "${{ github.workspace }}/kernel_patches/common/use_unlikely_wrap_cpufreq.patch"
  121. echo "✅ Other patches applied"