action.yml 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. name: build kernel
  2. description: each samsung kernel has its own way of building the kernel, they are sorted here.
  3. inputs:
  4. ccache:
  5. description: 'build with ccache'
  6. required: true
  7. build_type:
  8. description: 'make or bazel'
  9. required: true
  10. runs:
  11. using: composite
  12. steps:
  13. - name: start bazel build
  14. if: inputs.build_type == 'Bazel'
  15. shell: bash
  16. run: |
  17. set -e
  18. set -x
  19. cd "$CONFIG"
  20. echo "Building the kernel..."
  21. # 1. Initialize variables as empty (clears them out for "default")
  22. BAZEL_LTO=""
  23. SCRIPT_LTO=""
  24. # 2. Only populate if explicit modifications are requested
  25. if [[ "$LTO" == "thin" || "$LTO" == "full" ]]; then
  26. BAZEL_LTO="--lto=$LTO"
  27. SCRIPT_LTO="LTO=$LTO"
  28. fi
  29. if [[ $BRANCH == SM-A055* || $BRANCH == SM-X926B* ]]; then
  30. chmod +x build_kernel.sh
  31. env $SCRIPT_LTO ./build_kernel.sh || true
  32. elif [[ $BRANCH == SM-S926* ]]; then
  33. #tools/bazel run --nocheck_bzl_visibility --config=stamp --sandbox_debug --verbose_failures --debug_make_verbosity=I //projects/s5e9945:s5e9945_user_dist
  34. tools/bazel build --nocheck_bzl_visibility --config=stamp --sandbox_debug --verbose_failures --debug_make_verbosity=I $BAZEL_LTO //projects/s5e9945:s5e9945_user
  35. elif [[ $BRANCH == SM-A556* ]]; then
  36. #tools/bazel run --nocheck_bzl_visibility --config=stamp --sandbox_debug --verbose_failures --debug_make_verbosity=I //projects/s5e8845:s5e8845_user_dist
  37. tools/bazel build --nocheck_bzl_visibility --config=stamp --sandbox_debug --verbose_failures --debug_make_verbosity=I $BAZEL_LTO //projects/s5e8845:s5e8845_user
  38. elif [[ $BRANCH == SM-S938B* ]]; then
  39. sed -i '/drivers\/net\/usb\/smsc75xx\.ko/d;/drivers\/net\/usb\/smsc95xx\.ko/d' kernel_platform/common/modules.bzl
  40. chmod +x build_kernel_GKI.sh
  41. env $SCRIPT_LTO ./build_kernel_GKI.sh || true
  42. elif [[ $KERNEL_VER == 6.* ]]; then
  43. chmod +x build_kernel_GKI.sh
  44. env $SCRIPT_LTO ./build_kernel_GKI.sh || true
  45. elif [[ -d kernel_platform ]]; then
  46. cd kernel_platform
  47. tools/bazel build $BAZEL_LTO //common:kernel_aarch64
  48. fi
  49. - name: start make build
  50. if: inputs.build_type == 'make'
  51. shell: bash
  52. run: |
  53. set -e
  54. set -x
  55. cd "$CONFIG"
  56. if [[ -f build_kernel_GKI.sh ]]; then
  57. chmod +x build_kernel_GKI.sh
  58. env $SCRIPT_LTO ./build_kernel_GKI.sh || true
  59. elif [[ -f build_kernel.sh ]]; then
  60. sudo apt update
  61. sudo apt-get install -y libyaml-dev
  62. chmod +x build_kernel.sh
  63. env $SCRIPT_LTO ./build_kernel.sh || true
  64. fi
  65. #if [[ $BRANCH == SM-S928B* || "$BRANCH" == "SM-S938B-Oneui7" || "$BRANCH" == "SM-S931B-Oneui8" || "$BRANCH" == "SM-F741B-Oneui8" || "$BRANCH" == "SM-X710-Oneui6.1.1" ]]; then
  66. #cd kernel_platform
  67. #tools/bazel build //common:kernel_aarch64
  68. #chmod +x build_kernel_GKI.sh
  69. #./build_kernel_GKI.sh || true
  70. #elif [[ "$BRANCH" == "SM-X916B" || "$BRANCH" == "SM-F946N-Oneui7" || "$BRANCH" == "SM-S916B-Oneui8" || "$BRANCH" == "SM-S918B-Oneui8" || "$BRANCH" == "SM-F946B-Oneui8" || "$BRANCH" == "SM-S901E-Oneui8" || "$BRANCH" == "SM-X800-Oneui8" || $BRANCH == SM-S911B* || "$BRANCH" == "SM-M556B-Oneui8" ]]; then
  71. #cd kernel_platform
  72. #tools/bazel build //common:kernel_aarch64
  73. #chmod +x build_kernel_GKI.sh
  74. #./build_kernel_GKI.sh || true
  75. #elif [[ $BRANCH == SM-A546* || "$BRANCH" == "SM-M146B-Oneui7-ADYJ2" || "$BRANCH" == "SM-S908B-Oneui8-bitK" || $BRANCH == SM-A055* || "$BRANCH" == "SM-X610-Oneui6.1.1-bit7" || "$BRANCH" == "SM-A166B-Oneui7" ]]; then
  76. #sudo apt update
  77. #sudo apt-get install -y libyaml-dev
  78. #chmod +x build_kernel.sh
  79. #./build_kernel.sh || true
  80. #elif [[ "$BRANCH" == "SM-A566B" ]]; then
  81. #chmod +x build_script.sh
  82. #touch ./kernel-6.6/abi_symbollist.raw
  83. #touch ./kernel-6.6/abi_symbollist
  84. #./build_script.sh || true
  85. #elif [[ "$BRANCH" == "SM-A075M-Oneui7" ]]; then
  86. #chmod +x build_kernel.sh
  87. #./build_kernel.sh
  88. #fi