Browse Source

ci(build): fix kernel module version check for GKI devices

Update sed commands to correctly modify version checks in kernel modules for different kernel versions. The changes ensure proper handling of version mismatches while maintaining compatibility with GKI devices.
TheWildJames 1 year ago
parent
commit
791d33126f
1 changed files with 3 additions and 3 deletions
  1. 3 3
      .github/workflows/build.yml

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

@@ -207,11 +207,11 @@ jobs:
           if [[ "${{ inputs.kernel_version }}" == "6.1" || "${{ inputs.kernel_version }}" == "6.6" ]]; then
             cd "$CONFIG/common/kernel/module"
             sed -i 's/pr_warn("%s: disagrees about version of symbol %s\\n"/pr_warn("%s: disagrees about version of symbol %s, but ignore...\\n"/' version.c
-            sed -i '/bad_version:/,/return 0;/s/return 0;/return 1;/' version.c
+            sed -i '0,/bad_version:/{/bad_version:/,/return 0;/{s/return 0;/return 1;/}}' version.c
           else
-            cd "$CONFIG/common/kernel"
+            cd "$CONFIG/kernel"
             sed -i 's/pr_warn("%s: disagrees about version of symbol %s\\n"/pr_warn("%s: disagrees about version of symbol %s, but ignore...\\n"/' module.c
-            sed -i '/bad_version:/,/return 0;/s/return 0;/return 1;/' module.c
+            sed -i '0,/bad_version:/{/bad_version:/,/return 0;/{s/return 0;/return 1;/}}' module.c
           fi
 
       - name: Fix WiFi and Bluetooth on Samsung 6.6 GKI devices