action.yml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 [[ "$BUILD_LTO" == "thin" || "$BUILD_LTO" == "full" ]]; then
  26. BAZEL_LTO="--lto=$BUILD_LTO"
  27. SCRIPT_LTO="LTO=$BUILD_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
  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
  42. elif [[ $KERNEL_VER == 6.* ]]; then
  43. chmod +x build_kernel_GKI.sh
  44. env $SCRIPT_LTO ./build_kernel_GKI.sh
  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. # 1. Initialize variables as empty (clears them out for "default")
  56. SCRIPT_LTO=""
  57. # 2. Only populate if explicit modifications are requested
  58. if [[ "$BUILD_LTO" == "thin" || "$BUILD_LTO" == "full" ]]; then
  59. SCRIPT_LTO="LTO=$BUILD_LTO"
  60. fi
  61. cd "$CONFIG"
  62. if [[ -f build_kernel_GKI.sh ]]; then
  63. chmod +x build_kernel_GKI.sh
  64. env $SCRIPT_LTO ./build_kernel_GKI.sh
  65. elif [[ -f build_kernel.sh ]]; then
  66. sudo apt update
  67. sudo apt-get install -y libyaml-dev
  68. chmod +x build_kernel.sh
  69. env $SCRIPT_LTO ./build_kernel.sh
  70. fi
  71. #if [[ $BRANCH == SM-S928B* || "$BRANCH" == "SM-S938B-Oneui7" || "$BRANCH" == "SM-S931B-Oneui8" || "$BRANCH" == "SM-F741B-Oneui8" || "$BRANCH" == "SM-X710-Oneui6.1.1" ]]; then
  72. #cd kernel_platform
  73. #tools/bazel build //common:kernel_aarch64
  74. #chmod +x build_kernel_GKI.sh
  75. #./build_kernel_GKI.sh || true
  76. #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
  77. #cd kernel_platform
  78. #tools/bazel build //common:kernel_aarch64
  79. #chmod +x build_kernel_GKI.sh
  80. #./build_kernel_GKI.sh || true
  81. #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
  82. #sudo apt update
  83. #sudo apt-get install -y libyaml-dev
  84. #chmod +x build_kernel.sh
  85. #./build_kernel.sh || true
  86. #elif [[ "$BRANCH" == "SM-A566B" ]]; then
  87. #chmod +x build_script.sh
  88. #touch ./kernel-6.6/abi_symbollist.raw
  89. #touch ./kernel-6.6/abi_symbollist
  90. #./build_script.sh || true
  91. #elif [[ "$BRANCH" == "SM-A075M-Oneui7" ]]; then
  92. #chmod +x build_kernel.sh
  93. #./build_kernel.sh
  94. #fi