Эх сурвалжийг харах

Refactor kernel branding and configuration actions: disable module check bypass, update release notes for clarity, and streamline build workflow steps

TheWildJames 3 сар өмнө
parent
commit
a07bda471d

+ 28 - 23
.github/actions/apply-kernel-branding/action.yml

@@ -22,6 +22,7 @@ runs:
   steps:
     - name: Apply Kernel Name Branding
       shell: bash
+      if: false
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
         CONFIG_FRAGMENT="${{ github.workspace }}/wild_gki.fragment"
@@ -29,35 +30,39 @@ runs:
 
         DEFCONFIG="${{ github.workspace }}/kernel/common/arch/arm64/configs/gki_defconfig"
 
-        VERSION="${{ inputs.version }}"
-        ANDROID_PART=$(echo "$VERSION" | cut -d- -f1)
-        KERNEL_PART=$(echo "$VERSION" | cut -d- -f2)
+        #VERSION="${{ inputs.version }}"
+        #ANDROID_PART=$(echo "$VERSION" | cut -d- -f1)
+        #KERNEL_PART=$(echo "$VERSION" | cut -d- -f2)
 
-        if [ "${{ inputs.variant }}" == "Wild" ]; then
-          tac scripts/setlocalversion | awk '!seen && /^echo / {seen=1; next} 1' | tac > scripts/setlocalversion.tmp
-          mv scripts/setlocalversion.tmp scripts/setlocalversion
-          if [[ "$KERNEL_PART" == "6.6" || "$KERNEL_PART" == "6.12" ]]; then
-            KERNEL_STRING="$KERNEL_PART.${{ inputs.sublevel }}-$ANDROID_PART"
-            echo "echo \"$KERNEL_STRING-Wild\"" >> scripts/setlocalversion
-          else
-            echo 'echo "-Wild"' >> scripts/setlocalversion
-          fi
-          chmod +x scripts/setlocalversion
-        else
-          if grep -q '^CONFIG_LOCALVERSION=' "$DEFCONFIG"; then
-            LOCALVERSION_VALUE="$(grep -m1 '^CONFIG_LOCALVERSION=' "$DEFCONFIG" | sed -E 's/^CONFIG_LOCALVERSION="?([^"]*)"?$/\1/')"
-           echo "CONFIG_LOCALVERSION=\"${LOCALVERSION_VALUE}-Wild\"" >> "$CONFIG_FRAGMENT"
-          else
-            echo 'CONFIG_LOCALVERSION="-Wild"' >> "$CONFIG_FRAGMENT"
-          fi
-        fi
-
-        : > .scmversion
+        #if [ "${{ inputs.variant }}" == "Wild" ]; then
+        #  tac scripts/setlocalversion | awk '!seen && /^echo / {seen=1; next} 1' | tac > scripts/setlocalversion.tmp
+        #  mv scripts/setlocalversion.tmp scripts/setlocalversion
+        #  if [[ "$KERNEL_PART" == "6.6" || "$KERNEL_PART" == "6.12" ]]; then
+        #    KERNEL_STRING="$KERNEL_PART.${{ inputs.sublevel }}-$ANDROID_PART"
+        #    echo "echo \"$KERNEL_STRING-Wild\"" >> scripts/setlocalversion
+        #  else
+        #    echo 'echo "-Wild"' >> scripts/setlocalversion
+        #  fi
+        #  chmod +x scripts/setlocalversion
+        #else
+        #  if grep -q '^CONFIG_LOCALVERSION=' "$DEFCONFIG"; then
+        #   LOCALVERSION_VALUE="$(grep -m1 '^CONFIG_LOCALVERSION=' "$DEFCONFIG" | sed -E 's/^CONFIG_LOCALVERSION="?([^"]*)"?$/\1/')"
+        #   echo "CONFIG_LOCALVERSION=\"${LOCALVERSION_VALUE}-Wild\"" >> "$CONFIG_FRAGMENT"
+        #  else
+        #    echo 'CONFIG_LOCALVERSION="-Wild"' >> "$CONFIG_FRAGMENT"
+        #  fi
+        #fi
 
     - name: Apply Kernel Configuration
       if: ${{ inputs.variant == 'Wild' }}
       shell: bash
       run: |
+        if grep -q '^CONFIG_LOCALVERSION=' "$DEFCONFIG"; then
+          LOCALVERSION_VALUE="$(grep -m1 '^CONFIG_LOCALVERSION=' "$DEFCONFIG" | sed -E 's/^CONFIG_LOCALVERSION="?([^"]*)"?$/\1/')"
+          echo "CONFIG_LOCALVERSION=\"${LOCALVERSION_VALUE}-Wild\"" >> "$CONFIG_FRAGMENT"
+        else
+          echo 'CONFIG_LOCALVERSION="-Wild"' >> "$CONFIG_FRAGMENT"
+        fi
         cat >> "${{ github.workspace }}/wild_gki.fragment" << 'EOF'
         CONFIG_LOCALVERSION=""
         # CONFIG_LOCALVERSION_AUTO is not set

+ 0 - 12
.github/actions/misc/action.yml

@@ -36,15 +36,3 @@ runs:
         EOF
         # CONFIG_TRIM_UNUSED_KSYMS is not set
         # add this here for later
-
-
-    - name: Add RUST build configs
-      shell: bash
-      if: ${{ inputs.version == 'android16-6.12' && inputs.sublevel >= '38' && false }}
-      run: |
-        set -euo pipefail
-        echo "Add Build based configs"
-        cat >> "${{ github.workspace }}/wild_gki.fragment" << 'EOF'
-        # CONFIG_ANDROID_BINDER_IPC_RUST is not set
-        CONFIG_ANDROID_BINDER_IPC_RUST_DUMMY=m
-        EOF

+ 0 - 29
.github/actions/module-check-bypass/action.yml

@@ -1,29 +0,0 @@
-name: 'Module Check Bypass'
-description: 'Applies module version check bypass and verifies it'
-inputs:
-  kernel_version:
-    required: true
-    type: string
-
-runs:
-  using: composite
-  steps:
-    - shell: bash
-      run: |
-        set -euo pipefail
-
-        KERNEL_VERSION="${{ inputs.kernel_version }}"
-        if [[ "$KERNEL_VERSION" == "6.1" || "$KERNEL_VERSION" == "6.6" || "$KERNEL_VERSION" == "6.12" ]]; then
-          TARGET_FILE="${{ github.workspace }}/kernel/common/kernel/module/version.c"
-        else
-          TARGET_FILE="${{ github.workspace }}/kernel/common/kernel/module.c"
-        fi
-
-        sed -i '/bad_version:/{:a;n;/return 0;/{s/return 0;/return 1;/;b};ba}' "$TARGET_FILE"
-
-        if grep -A 5 "bad_version:" "$TARGET_FILE" | grep -q "return 1;"; then
-          exit 0
-        fi
-
-        grep -A 5 "bad_version:" "$TARGET_FILE" || true
-        exit 1

+ 1 - 2
.github/config/RELEASE_NOTES.md

@@ -92,9 +92,8 @@ Reboot the device if you performed any cleanup in step 2
 > Most users do not need to do this so please try without this first! This has nothing to do with root detections and will not help you with them, this is for users who cannot boot my normal kernels and require this hack! 
 
 **How to enable:** 
-- To instruct the installer to use the bypass kernel when flashing, include an empty file named `ENABLE_BYPASS` at the root of the AnyKernel3 package (the ZIP) before flashing it to the device. You do not need to modify anykernel settings — just ensure `ENABLE_BYPASS` is present in the zip when you install it.
+- To instruct the installer to use the bypass kernel when flashing, include an empty file named `ENABLE_BYPASS` at the root of the AnyKernel3 package (the ZIP) before flashing it to the device. You do not need to modify the anykernel.sh file — just ensure `ENABLE_BYPASS` is present in the zip when you install it.
 
 **What it does:**
 - The Problem: Sometimes when installing a custom kernel, the device tries to load a kernel module that fails due to version mismatches, missing dependencies, or signature verification issues. This can cause boot failures or device instability.
 - The Solution: These versions change one line from false to true to force load the kernel module, bypassing the failure check that would normally prevent loading.
-

+ 3 - 9
.github/workflows/build.yml

@@ -170,18 +170,12 @@ jobs:
         sublevel: ${{ steps.extract.outputs.sublevel }}
         variant: ${{ inputs.variant }}
 
-    - name: Apply Module Check Bypass
-      if: ${{ inputs.variant == 'Bypass' }}
-      uses: ./.github/actions/module-check-bypass
+    - name: Apply Device-Specific Patches
+      uses: ./.github/actions/apply-device-patches
       with:
+        version: ${{ inputs.version }}
         kernel_version: ${{ inputs.kernel_version }}
 
-    # - name: Apply Device-Specific Patches
-    #   uses: ./.github/actions/apply-device-patches
-    #   with:
-    #     version: ${{ inputs.version }}
-    #     kernel_version: ${{ inputs.kernel_version }}
-
     - name: Apply ABI Compare Bypass
       if: false
       working-directory: ${{ github.workspace }}/kernel