action.yml 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. name: 'Apply BBRv3 Patches'
  2. description: 'Apply BBRv3 TCP congestion control patches with version-specific logic'
  3. inputs:
  4. version:
  5. description: 'Kernel config version (e.g., android15-6.6)'
  6. required: true
  7. kernel_version:
  8. description: 'Kernel version (e.g., 6.1)'
  9. required: true
  10. sublevel:
  11. description: 'Kernel sublevel'
  12. required: true
  13. runs:
  14. using: "composite"
  15. steps:
  16. - name: Apply Kernel Config for 5.10
  17. shell: bash
  18. working-directory: ${{ github.workspace }}/kernel/common
  19. if: inputs.kernel_version == '5.10'
  20. run: |
  21. sed -i 's/CONFIG_IP_SET_MAX/65534/g' net/netfilter/ipset/ip_set_core.c
  22. - name: Apply BBRv3 Patch
  23. shell: bash
  24. working-directory: ${{ github.workspace }}/kernel/common
  25. run: |
  26. set -euo pipefail
  27. if [[ ${{ inputs.version }} == "android16-6.12" ]]; then
  28. #patch -p1 < "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-android15-6.6.patch"
  29. #patch -p1 < ${{ github.action_path }}/patches/0001-net-tcp-backport-BBRv3-to-android16-6.12.patch
  30. echo "skipped"
  31. elif [[ ${{ inputs.version }} == "android15-6.6" ]]; then
  32. patch -p1 < "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-android15-6.6.patch"
  33. elif [[ ${{ inputs.version }} == "android14-6.1" ]]; then
  34. patch -p1 < "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-android14-6.1.patch"
  35. elif [[ ${{ inputs.version }} == "android14-5.15" ]]; then
  36. #patch -p1 < "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-android13-5.15.patch"
  37. patch -p1 < ${{ github.action_path }}/patches/0001-net-tcp-backport-BBRv3-to-android14-5.15.patch
  38. elif [[ ${{ inputs.version }} == "android13-5.15" ]]; then
  39. patch -p1 < "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-android13-5.15.patch"
  40. if [[ ${{ inputs.sublevel }} -le "43" ]]; then
  41. patch -p1 < ${{ github.action_path }}/patches/0002-net-tcp-add-tcp_snd_cwnd-and-tcp_snd_cwnd_set-helper-functions.patch
  42. fi
  43. elif [[ ${{ inputs.version }} == "android13-5.10" ]]; then
  44. patch -p1 < "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-android12-5.10.patch"
  45. elif [[ ${{ inputs.version }} == "android12-5.10" ]]; then
  46. patch -p1 < "${{ github.workspace }}/kernel_patches/common/bbrv3/0001-net-tcp-backport-BBRv3-to-android12-5.10.patch"
  47. fi
  48. if [[ ${{ inputs.version }} == "android12-5.10" || ${{ inputs.version }} == "android13-5.10" ]]; then
  49. if ! grep -qF 'int proc_dou8vec_minmax(' ./include/linux/sysctl.h; then
  50. patch -p1 < "${{ github.workspace }}/kernel_patches/common/bbrv3/sysctl_add_proc_dou8vec_minmax.patch"
  51. patch -p1 < "${{ github.workspace }}/kernel_patches/common/bbrv3/sysctl_fix_data-races_in_proc_dou8vec_minmax.patch"
  52. fi
  53. fi
  54. echo "✅ BBRv3 patches applied"
  55. - name: Enable BBRv3 Kernel Config
  56. uses: ./.github/actions/set-kernel-config
  57. with:
  58. config_list: |
  59. CONFIG_TCP_CONG_BBR3=y