action.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # .github/actions/set-kernel-config/action.yml
  2. name: Set Kernel Config
  3. description: Applies kernel config values directly using scripts/config (NO fragments)
  4. runs:
  5. using: composite
  6. steps:
  7. - name: Apply configs
  8. shell: bash
  9. working-directory: ${{ github.workspace }}/kernel/common
  10. run: |
  11. set -euo pipefail
  12. make O=/home/runner/out gki_defconfig AARCH=arm64
  13. CONFIG_FILE="/home/runner/out/.config"
  14. CONFIG_LIST="${{ github.workspace }}/wild_gki.fragment"
  15. if [ ! -f scripts/config ]; then
  16. echo "ERROR: common/scripts/config not found"
  17. exit 1
  18. fi
  19. if [ ! -f "$CONFIG_FILE" ]; then
  20. echo "ERROR: config file not found: $CONFIG_FILE"
  21. exit 1
  22. fi
  23. if [ ! -f "$CONFIG_LIST" ]; then
  24. echo "ERROR: config list file not found: $CONFIG_LIST"
  25. exit 1
  26. fi
  27. apply_config() {
  28. local input="$1"
  29. # trim whitespace
  30. input="$(echo "$input" | xargs)"
  31. # skip empty lines and comments
  32. [[ -z "$input" || "$input" == \#* ]] && return
  33. if [[ "$input" == *"="* ]]; then
  34. local config="${input%%=*}"
  35. local value="${input#*=}"
  36. else
  37. local config="$input"
  38. local value="y"
  39. fi
  40. echo "Setting: $config=$value"
  41. case "$value" in
  42. y|Y|yes|YES|1|true|TRUE)
  43. scripts/config --file "$CONFIG_FILE" -e "$config"
  44. ;;
  45. n|N|no|NO|0|false|FALSE)
  46. scripts/config --file "$CONFIG_FILE" -d "$config"
  47. ;;
  48. *)
  49. scripts/config --file "$CONFIG_FILE" --set-val "$config" "$value"
  50. ;;
  51. esac
  52. }
  53. while IFS= read -r line || [ -n "$line" ]; do
  54. apply_config "$line"
  55. done < "$CONFIG_LIST"