action.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. runs:
  11. using: 'composite'
  12. steps:
  13. - name: Apply NTSync Patch
  14. shell: bash
  15. working-directory: ${{ github.workspace }}/kernel/common
  16. run: |
  17. set -euo pipefail
  18. echo "Using patch: $(basename $NTSYNC_PATCH)"
  19. if [[ ${{ inputs.version }} = "android16-6.12" ]]; then
  20. echo "Removing pre-existing ntsync files for android16-6.12"
  21. rm -f include/uapi/linux/ntsync.h
  22. rm -f drivers/misc/ntsync.c
  23. fi
  24. if [[ ${{ inputs.version }} = "android13-5.10" ]]; then
  25. cp ${{ github.workspace }}/kernel_patches/common/ntsync/ntsync_compat_android12-5.10.patch ${{ github.workspace }}/kernel/common
  26. patch -p1 ntsync_compat_android12-5.10.patch
  27. elif [[ ${{ inputs.version }} = "android14-5.15" ]]; then
  28. cp ${{ github.workspace }}/kernel_patches/common/ntsync/ntsync_compat_android13-5.15.patch ${{ github.workspace }}/kernel/common
  29. patch -p1 ntsync_compat_android13-5.15.patch
  30. else
  31. cp ${{ github.workspace }}/kernel_patches/common/ntsync/ntsync_compat_${{ inputs.version }}.patch ${{ github.workspace }}/kernel/common
  32. patch -p1 ntsync_compat_${{ inputs.version }}.patch
  33. fi
  34. cp ${{ github.workspace }}/kernel_patches/common/ntsync/ntsync_base.patch ${{ github.workspace }}/kernel/common
  35. patch -p1 < ntsync_base.patch
  36. cat >> "${{ github.workspace }}/kernel/common/arch/arm64/configs/gki_defconfig" << 'EOF'
  37. CONFIG_NTSYNC=y
  38. EOF