Browse Source

sorry if you see this

trae 3 months ago
parent
commit
7a8c6b0bfc
2 changed files with 68 additions and 57 deletions
  1. 9 5
      .github/actions/build-kernel/action.yml
  2. 59 52
      .github/actions/set-kernel-config/action.yml

+ 9 - 5
.github/actions/build-kernel/action.yml

@@ -11,7 +11,7 @@ inputs:
 runs:
   using: composite
   steps:
-  - name: 'Build Kernel'
+  - name: 'Activate Bypass'
     shell: bash
     working-directory: ${{ github.workspace }}/kernel
     run: |
@@ -34,14 +34,19 @@ runs:
         echo "Bypass hack not applied as per input parameter."
       fi
 
+  - name: Setup Kernel Configs
+    uses: ./.github/actions/set-kernel-config
+  
+  - name: 'Build Kernel'
+    shell: bash
+    working-directory: ${{ github.workspace }}/kernel
+    run: |
       # Strip trailing empty lines from gki_defconfig to match savedefconfig output
       # (savedefconfig strips trailing newlines, causing check_defconfig to fail on 5.10.233+)
-      perl -pi -e 's/\n*\z/\n/' common/arch/arm64/configs/gki_defconfig
+      #perl -pi -e 's/\n*\z/\n/' common/arch/arm64/configs/gki_defconfig
 
       cp "${{ github.workspace }}/wild_gki.fragment" common/arch/arm64/configs/wild_gki.fragment
 
-      #cd ${{ github.workspace }}/kernel/common
-      #make O=/home/runner/out gki_defconfig AARCH=arm64
       if [ -f "build/build.sh" ]; then
         BUILD_GKI_ARTIFACTS= \
         BUILD_GKI_CERTIFICATION_TOOLS=0 \
@@ -52,7 +57,6 @@ runs:
         OUT_DIR="/home/runner/out" \
         LTO=thin \
         BUILD_CONFIG=common/build.config.gki.aarch64 \
-        PRE_DEFCONFIG_CMDS="KCONFIG_CONFIG=\${ROOT_DIR}/common/arch/arm64/configs/gki_defconfig \${ROOT_DIR}/common/scripts/kconfig/merge_config.sh -m -r \${ROOT_DIR}/common/arch/arm64/configs/gki_defconfig \${ROOT_DIR}/common/arch/arm64/configs/wild_gki.fragment" \
         build/build.sh -j"$(nproc)" \
         CC="/usr/bin/ccache clang" \
         CXX="/usr/bin/ccache clang+" \

+ 59 - 52
.github/actions/set-kernel-config/action.yml

@@ -2,60 +2,67 @@
 name: Set Kernel Config
 description: Applies kernel config values directly using scripts/config (NO fragments)
 
-inputs:
-  configs:
-    required: true
-
 runs:
   using: composite
   steps:
-    - name: Apply configs
-      shell: bash
-      working-directory: ${{ github.workspace }}/kernel
-      run: |
-        set -euo pipefail
-
-        CONFIG_FILE="/home/runner/out/.config"
-
-        # ensure config tool exists
-        if [ ! -f common/scripts/config ]; then
-          echo "ERROR: common/scripts/config not found"
-          exit 1
+  - name: Apply configs
+    shell: bash
+    working-directory: ${{ github.workspace }}/kernel/common
+    run: |
+      set -euo pipefail
+
+      make O=/home/runner/out gki_defconfig AARCH=arm64
+
+      CONFIG_FILE="/home/runner/out/.config"
+      CONFIG_LIST="${{ github.workspace }}/wild_gki.fragment"
+
+      if [ ! -f scripts/config ]; then
+        echo "ERROR: common/scripts/config not found"
+        exit 1
+      fi
+
+      if [ ! -f "$CONFIG_FILE" ]; then
+        echo "ERROR: config file not found: $CONFIG_FILE"
+        exit 1
+      fi
+
+      if [ ! -f "$CONFIG_LIST" ]; then
+        echo "ERROR: config list file not found: $CONFIG_LIST"
+        exit 1
+      fi
+
+      apply_config() {
+        local input="$1"
+
+        # trim whitespace
+        input="$(echo "$input" | xargs)"
+
+        # skip empty lines and comments
+        [[ -z "$input" || "$input" == \#* ]] && return
+
+        if [[ "$input" == *"="* ]]; then
+          local config="${input%%=*}"
+          local value="${input#*=}"
+        else
+          local config="$input"
+          local value="y"
         fi
 
-        apply_config() {
-          local input="$1"
-
-          # trim whitespace
-          input="$(echo "$input" | xargs)"
-
-          # skip empty or comments
-          [[ -z "$input" || "$input" == \#* ]] && return
-
-          if [[ "$input" == *"="* ]]; then
-            local config="${input%%=*}"
-            local value="${input#*=}"
-          else
-            local config="$input"
-            local value="y"
-          fi
-
-          echo "Setting: $config=$value"
-
-          case "$value" in
-            y|Y|yes|YES|1|true|TRUE)
-              common/scripts/config --file "$CONFIG_FILE" -e "$config"
-              ;;
-            n|N|no|NO|0|false|FALSE)
-              common/scripts/config --file "$CONFIG_FILE" -d "$config"
-              ;;
-            *)
-              # assume explicit value (string/int)
-              common/scripts/config --file "$CONFIG_FILE" --set-val "$config" "$value"
-              ;;
-          esac
-        }
-
-        while IFS= read -r line; do
-          apply_config "$line"
-        done <<< "${{ inputs.configs }}"
+        echo "Setting: $config=$value"
+
+        case "$value" in
+          y|Y|yes|YES|1|true|TRUE)
+            scripts/config --file "$CONFIG_FILE" -e "$config"
+            ;;
+          n|N|no|NO|0|false|FALSE)
+            scripts/config --file "$CONFIG_FILE" -d "$config"
+            ;;
+          *)
+            scripts/config --file "$CONFIG_FILE" --set-val "$config" "$value"
+            ;;
+        esac
+      }
+
+      while IFS= read -r line || [ -n "$line" ]; do
+        apply_config "$line"
+      done < "$CONFIG_LIST"