action.yml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. if [[ ( ${{ inputs.version }} == "android12-5.10" && "${{ inputs.sublevel }}" -le "208" ) || ( ${{ inputs.version }} = "android13-5.10" && "${{ inputs.sublevel }}" -le "210" ) ]]; then
  27. patch -p1 -N < ${{ github.action_path }}/patches/0001-lockdep-mark-local_lock_t.patch
  28. fi
  29. if [[ ( ${{ inputs.version }} == "android12-5.10" && "${{ inputs.sublevel }}" -le "208" ) || ( ${{ inputs.version }} = "android13-5.10" && "${{ inputs.sublevel }}" -le "210" ) ]]; then
  30. patch -p1 -N < ${{ github.action_path }}/patches/0002-lockdep-fix-init-map-confusion.patch
  31. fi
  32. if [[ ( ${{ inputs.version }} == "android12-5.10" && "${{ inputs.sublevel }}" -le "208" ) || ( ${{ inputs.version }} = "android13-5.10" && "${{ inputs.sublevel }}" -le "210" ) ]]; then
  33. patch -p1 -N < ${{ github.action_path }}/patches/0003-lockdep-assert-none-held.patch
  34. fi
  35. if [[ ${{ inputs.version }} = "android13-5.10" ]]; then
  36. patch -p1 < ${{ github.workspace }}/kernel_patches/common/ntsync/ntsync_compat_android12-5.10.patch
  37. elif [[ ${{ inputs.version }} = "android14-5.15" ]]; then
  38. patch -p1 < ${{ github.workspace }}/kernel_patches/common/ntsync/ntsync_compat_android13-5.15.patch
  39. else
  40. patch -p1 < ${{ github.workspace }}/kernel_patches/common/ntsync/ntsync_compat_${{ inputs.version }}.patch
  41. fi
  42. patch -p1 < ${{ github.workspace }}/kernel_patches/common/ntsync/ntsync_base.patch
  43. - name: Enable NTSync
  44. uses: ./.github/actions/set-kernel-config
  45. with:
  46. config_list: |
  47. CONFIG_NTSYNC=y