action.yml 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. name: Setup Droidspaces-OSS
  2. description: Clone and apply Droidspaces-OSS patches with version-specific fixes
  3. inputs:
  4. version:
  5. description: 'Kernel config version (e.g., android15-6.6)'
  6. required: true
  7. android_version:
  8. description: 'Android version (e.g., android15)'
  9. required: true
  10. kernel_version:
  11. description: 'Kernel version (e.g., 6.6)'
  12. required: true
  13. os_patch_level:
  14. description: 'OS patch level (e.g., 2024-07)'
  15. required: true
  16. sublevel:
  17. description: 'Kernel sublevel'
  18. required: true
  19. runs:
  20. using: composite
  21. steps:
  22. - name: Download and Apply Droidspaces-OSS Patches
  23. shell: bash
  24. working-directory: ${{ github.workspace }}
  25. run: |
  26. git clone --depth=1 https://github.com/ravindu644/Droidspaces-OSS.git
  27. - name: Apply the SYSVIPC kABI fix
  28. shell: bash
  29. working-directory: ${{ github.workspace }}/kernel/common
  30. run: |
  31. if [ "${{ inputs.version }}" == "android16-6.12" ]; then
  32. cp ${{ github.workspace }}/Droidspaces-OSS/Documentation/resources/kernel-patches/GKI/kernel-6.12/001.GKI-6.12-or-above-fix_sysvipc_kabi.patch ./
  33. patch -p1 < 001.GKI-6.12-or-above-fix_sysvipc_kabi.patch
  34. elif [ "${{ inputs.version }}" == "android15-6.6" ]; then
  35. #curl -L https://raw.githubusercontent.com/ravindu644/Droidspaces-OSS/main/Documentation/resources/kernel-patches/GKI/below-kernel-6.12/001.GKI-below-6.12-fix_sysvipc_kabi_1_2_3.patch
  36. #curl -L https://raw.githubusercontent.com/ravindu644/Droidspaces-OSS/main/Documentation/resources/kernel-patches/GKI/below-kernel-6.12/001.GKI-below-6.12-fix_sysvipc_kabi_3_4_5.patch
  37. cp ${{ github.workspace }}/Droidspaces-OSS/Documentation/resources/kernel-patches/GKI/below-kernel-6.12/001.GKI-below-6.12-fix_sysvipc_kabi_6_7_8.patch ./
  38. patch -p1 < 001.GKI-below-6.12-fix_sysvipc_kabi_6_7_8.patch
  39. elif [ "${{ inputs.version }}" == "android14-6.1" ]; then
  40. #curl -L https://raw.githubusercontent.com/ravindu644/Droidspaces-OSS/main/Documentation/resources/kernel-patches/GKI/below-kernel-6.12/001.GKI-below-6.12-fix_sysvipc_kabi_1_2_3.patch
  41. #curl -L https://raw.githubusercontent.com/ravindu644/Droidspaces-OSS/main/Documentation/resources/kernel-patches/GKI/below-kernel-6.12/001.GKI-below-6.12-fix_sysvipc_kabi_3_4_5.patch
  42. cp ${{ github.workspace }}/Droidspaces-OSS/Documentation/resources/kernel-patches/GKI/below-kernel-6.12/001.GKI-below-6.12-fix_sysvipc_kabi_6_7_8.patch ./
  43. patch -p1 < 001.GKI-below-6.12-fix_sysvipc_kabi_6_7_8.patch
  44. elif [ "${{ inputs.version }}" == "android14-5.15" ]; then
  45. cp ${{ github.workspace }}/Droidspaces-OSS/Documentation/resources/kernel-patches/GKI/below-kernel-6.12/001.GKI-below-6.12-fix_sysvipc_kabi_6_7_8.patch ./
  46. patch -p1 < 001.GKI-below-6.12-fix_sysvipc_kabi_6_7_8.patch
  47. elif [ "${{ inputs.version }}" == "android13-5.15" ]; then
  48. cp ${{ github.workspace }}/Droidspaces-OSS/Documentation/resources/kernel-patches/GKI/below-kernel-6.12/001.GKI-below-6.12-fix_sysvipc_kabi_6_7_8.patch ./
  49. patch -p1 < 001.GKI-below-6.12-fix_sysvipc_kabi_6_7_8.patch
  50. elif [ "${{ inputs.version }}" == "android12-5.10" ] || [ "${{ inputs.version }}" == "android13-5.10" ]; then
  51. cp ${{ github.workspace }}/Droidspaces-OSS/Documentation/resources/kernel-patches/GKI/below-kernel-6.12/001.GKI-below-6.12-fix_sysvipc_kabi_6_7_8.patch ./
  52. patch -p1 < 001.GKI-below-6.12-fix_sysvipc_kabi_6_7_8.patch
  53. cp ${{ github.workspace }}/Droidspaces-OSS/Documentation/resources/kernel-patches/GKI/below-kernel-6.12/002.5.10_or_lower_use_android_abi_padding_for_posix_mqueue.patch ./
  54. patch -p1 < 002.5.10_or_lower_use_android_abi_padding_for_posix_mqueue.patch
  55. fi
  56. - name: Enable Configs
  57. shell: bash
  58. working-directory: ${{ github.workspace }}/kernel
  59. run: |
  60. cat >> "${{ github.workspace }}/wild_gki.fragment" << 'EOF'
  61. CONFIG_SYSVIPC=y
  62. CONFIG_POSIX_MQUEUE=y
  63. CONFIG_IPC_NS=y
  64. CONFIG_PID_NS=y
  65. CONFIG_DEVTMPFS=y
  66. EOF
  67. - name: Fix 5.10
  68. shell: bash
  69. if: inputs.version == 'android12-5.10' || inputs.version == 'android13-5.10'
  70. working-directory: ${{ github.workspace }}/kernel/common
  71. run: |
  72. grep -n "get_pid_ns" include/linux/pid_namespace.h | head -n 5
  73. while grep -q 'static.*inline.*get_pid_ns' include/linux/pid_namespace.h; do
  74. sed -i '1,/static.*inline.*get_pid_ns/ { /static.*inline.*get_pid_ns/ { s@.*@extern struct pid_namespace *get_pid_ns(struct pid_namespace *ns);@; :a; N; /\n[[:space:]]*}[[:space:]]*$/!ba; :b; s/\n.*\n/\n/; tb; s/\n$//; } }' include/linux/pid_namespace.h
  75. done
  76. grep -n "get_pid_ns" include/linux/pid_namespace.h | head -n 5