action.yml 778 B

1234567891011121314151617181920212223
  1. name: 'Apply Ptrace Patch'
  2. description: 'Apply GKI ptrace compatibility patch for kernels < 5.16'
  3. inputs:
  4. kernel_version:
  5. description: 'Kernel version (e.g., 6.1)'
  6. required: true
  7. runs:
  8. using: 'composite'
  9. steps:
  10. - name: Apply Ptrace Patch
  11. shell: bash
  12. working-directory: ${{ github.workspace }}/kernel/common
  13. run: |
  14. set -euo pipefail
  15. KERNEL_VERSION="${{ inputs.kernel_version }}"
  16. MIN_VERSION="5.16"
  17. if [ "$(printf '%s\n' "$KERNEL_VERSION" "$MIN_VERSION" | sort -V | head -n1)" = "$KERNEL_VERSION" ]; then
  18. echo "Patching ptrace!"
  19. patch -p1 -F 3 < "${{ github.workspace }}/kernel_patches/gki_ptrace.patch"
  20. else
  21. echo "Kernel >= $MIN_VERSION, skipping ptrace patch"
  22. fi