action.yml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. name: 'Apply NTSync Patches'
  2. description: 'Apply ntsync compatibility patches and enable CONFIG_NTSYNC in defconfig'
  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. sublevel:
  11. description: 'Kernel sublevel'
  12. required: true
  13. runs:
  14. using: 'composite'
  15. steps:
  16. - name: Apply NTSync Patch
  17. shell: bash
  18. working-directory: ${{ github.workspace }}/kernel/common
  19. run: |
  20. set -euo pipefail
  21. if [[ ${{ inputs.version }} = "android16-6.12" ]]; then
  22. echo "Removing pre-existing ntsync files for android16-6.12"
  23. rm -f include/uapi/linux/ntsync.h
  24. rm -f drivers/misc/ntsync.c
  25. fi
  26. # Apply lockdep prerequisites for android12-5.10 (2022-01 baseline)
  27. if [[ ${{ inputs.version }} == "android12-5.10" && "${{ inputs.sublevel }}" -le "66" ]]; then
  28. patch -p1 -N < ${{ github.action_path }}/patches/0001-lockdep-detect-recursive-read.patch
  29. fi
  30. if [[ ( "${{ inputs.version }}" == "android12-5.10" && "${{ inputs.sublevel }}" -le "209" ) || ( "${{ inputs.version }}" == "android13-5.10" && "${{ inputs.sublevel }}" -le "210" ) ]]; then
  31. patch -p1 -N < ${{ github.action_path }}/patches/0002-lockdep-assert-none-held.patch
  32. fi
  33. if [[ ${{ inputs.version }} = "android13-5.10" ]]; then
  34. patch -p1 < ${{ github.workspace }}/kernel_patches/common/ntsync/ntsync_compat_android12-5.10.patch
  35. elif [[ ${{ inputs.version }} = "android14-5.15" ]]; then
  36. patch -p1 < ${{ github.workspace }}/kernel_patches/common/ntsync/ntsync_compat_android13-5.15.patch
  37. else
  38. patch -p1 < ${{ github.workspace }}/kernel_patches/common/ntsync/ntsync_compat_${{ inputs.version }}.patch
  39. fi
  40. patch -p1 < ${{ github.workspace }}/kernel_patches/common/ntsync/ntsync_base.patch
  41. - name: Enable NTSync
  42. uses: ./.github/actions/set-kernel-config
  43. with:
  44. config_list: |
  45. CONFIG_NTSYNC=y