action.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. name: add configs
  2. description: add configs and disabling securities
  3. inputs:
  4. branch:
  5. description: 'which device kernel'
  6. required: true
  7. runs:
  8. using: composite
  9. steps:
  10. - name: add mountify support
  11. shell: bash
  12. run: |
  13. cat >> "$GKI_DEFCONFIG" << 'EOF'
  14. # Mountify Support
  15. CONFIG_OVERLAY_FS=y
  16. CONFIG_TMPFS_XATTR=y
  17. CONFIG_TMPFS_POSIX_ACL=y
  18. EOF
  19. - name: increase log buffer size for showing bbg on ksu manager homepage
  20. shell: bash
  21. run: |
  22. cat >> "$GKI_DEFCONFIG" << 'EOF'
  23. # increase log buffer size to show bbg version in wksu homepage
  24. CONFIG_LOG_BUF_SHIFT=20
  25. EOF
  26. - name: nuke securities for root access
  27. shell: bash
  28. run: |
  29. # 1. Determine which defconfig file needs to be patched based on the branch
  30. target_config=""
  31. if [[ ${{ inputs.branch }} == SM-S938B* || "${{ inputs.branch }}" == "SM-S931B-Oneui8" ]]; then
  32. echo "Nothing to see here, moving on..."
  33. elif [[ "${{ inputs.branch }}" == SM-S926B* ]]; then
  34. target_config="$COMMON/arch/arm64/configs/s5e9945-bazel_defconfig"
  35. elif [[ "${{ inputs.branch }}" == SM-A556* ]]; then
  36. target_config="$COMMON/arch/arm64/configs/s5e8845-bazel_defconfig"
  37. else
  38. target_config="$GKI_DEFCONFIG"
  39. fi
  40. # 2. Apply the nuke modifications exactly once if a target file was assigned
  41. if [ -n "$target_config" ]; then
  42. echo "Nuking Samsung Knox/Root protection in: $target_config"
  43. configs=(
  44. "CONFIG_UH=n"
  45. "CONFIG_UH_RKP=n"
  46. "CONFIG_UH_LKMAUTH=n"
  47. "CONFIG_UH_LKM_BLOCK=n"
  48. "CONFIG_RKP_CFP_JOPP=n"
  49. "CONFIG_RKP_CFP=n"
  50. "CONFIG_SECURITY_DEFEX=n"
  51. "CONFIG_PROCA=n"
  52. "CONFIG_FIVE=n"
  53. "CONFIG_RKP=n"
  54. "CONFIG_KDP_NS=n"
  55. "CONFIG_KDP=n"
  56. )
  57. for config in "${configs[@]}"; do
  58. key="${config%%=*}"
  59. if grep -qE "^(${key}=|# ${key} is not set$)" "$target_config"; then
  60. sed -i -E \
  61. -e "s/^${key}=.*/${config}/" \
  62. -e "s/^# ${key} is not set\$/${config}/" \
  63. "$target_config"
  64. else
  65. echo "$config" >> "$target_config"
  66. fi
  67. done
  68. fi
  69. - name: remove check_defconfig
  70. shell: bash
  71. run: |
  72. cd "$COMMON"
  73. # Remove check_defconfig
  74. sed -i 's/check_defconfig//' ./build.config.gki