فهرست منبع

ci: unify logging format across all workflows

Signed-off-by: Ahmed Al-Nassif <mr.ahmed.nassif@gmail.com>
Ahmed Al-Nassif 2 هفته پیش
والد
کامیت
46f92c8ad7
2فایلهای تغییر یافته به همراه21 افزوده شده و 21 حذف شده
  1. 12 12
      .github/actions/kernel-fixes/action.yml
  2. 9 9
      .github/workflows/build.yml

+ 12 - 12
.github/actions/kernel-fixes/action.yml

@@ -26,26 +26,26 @@ runs:
       run: |
         set -euo pipefail
         GLIBC_VERSION="$(ldd --version 2>/dev/null | head -n 1 | awk '{print $NF}')"
-        echo "[INFO] Detected GLIBC version: $GLIBC_VERSION"
+        echo "[*] Detected GLIBC version: $GLIBC_VERSION"
         if [ "$(printf '%s\n' "2.38" "$GLIBC_VERSION" | sort -V | head -n 1)" = "2.38" ]; then
-          echo "[INFO] GLIBC >= 2.38, attempting Makefile fix."
+          echo "[*] GLIBC >= 2.38, attempting Makefile fix."
           # Check if the pattern that needs fixing actually exists
           if grep -q '\$(Q)\$(MAKE) -C \$(SUBCMD_SRC) OUTPUT=\$(abspath \$(dir \$@))\/ \$(abspath \$@)' tools/bpf/resolve_btfids/Makefile; then
-            echo "[INFO] Found pattern to fix, applying sed."
+            echo "[*] Found pattern to fix, applying sed."
             sed -i '/\$(Q)\$(MAKE) -C \$(SUBCMD_SRC) OUTPUT=\$(abspath \$(dir \$@))\/ \$(abspath \$@)/s//$(Q)$(MAKE) -C $(SUBCMD_SRC) EXTRA_CFLAGS="$(CFLAGS)" OUTPUT=$(abspath $(dir $@))\/ $(abspath $@)/' tools/bpf/resolve_btfids/Makefile
             MAKEFILE_FIXED="true"
           elif grep -q 'EXTRA_CFLAGS' tools/bpf/resolve_btfids/Makefile; then
-            echo "[INFO] EXTRA_CFLAGS already present, no fix needed."
+            echo "[*] EXTRA_CFLAGS already present, no fix needed."
             MAKEFILE_FIXED="already_fixed"
           else
-            echo "[WARN] Neither pattern found in Makefile."
+            echo "[!] Neither pattern found in Makefile."
             MAKEFILE_FIXED="false"
           fi
           echo "MAKEFILE_FIXED=$MAKEFILE_FIXED" >> $GITHUB_ENV
            if [[ "${{ inputs.version }}" == "android13-5.10" && "${{ inputs.sublevel }}" -le 186 ]] || \
              [[ "${{ inputs.version }}" == "android13-5.15" && "${{ inputs.sublevel }}" -le 119 ]] || \
              [[ "${{ inputs.version }}" == "android14-5.15" && "${{ inputs.sublevel }}" -le 110 ]]; then
-            echo "[INFO] Applying parse-options.c fixes."
+            echo "[*] Applying parse-options.c fixes."
             sed -i '/char \*buf = NULL;/a int i;' tools/lib/subcmd/parse-options.c 2>/dev/null || true
             sed -i 's/for (int i = 0; subcommands\[i\]; i++) {/for (i = 0; subcommands[i]; i++) {/' tools/lib/subcmd/parse-options.c 2>/dev/null || true
             sed -i '/if (subcommands) {/a int i;' tools/lib/subcmd/parse-options.c 2>/dev/null || true
@@ -55,7 +55,7 @@ runs:
             echo "PARSE_OPTIONS_FIXED=false" >> $GITHUB_ENV
           fi
         else
-          echo "[SKIP] GLIBC version < 2.38, skipping Makefile fix."
+          echo "[-] GLIBC version < 2.38, skipping Makefile fix."
         fi
 
     - name: 'Apply mmap.c fix for specific versions'
@@ -63,16 +63,16 @@ runs:
       if: ${{ inputs.version == 'android15-6.6' && inputs.sublevel <= '58' }}
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
-        echo "[INFO] Checking for android15 + kernel 6.6 include fix..."
+        echo "[*] Checking for android15 + kernel 6.6 include fix..."
         if [[ "${{ inputs.android_version }}" == "android15" && "${{ inputs.kernel_version }}" == "6.6" ]]; then
-          echo "[MATCH] android15 + 6.6, checking for fs.h include."
+          echo "[+] android15 + 6.6, checking for fs.h include."
           cd "${{ github.workspace }}/kernel/common"
           if ! grep -qxF '#include <trace/hooks/fs.h>' ./fs/namespace.c; then
-            echo "[INFO] Adding missing #include <trace/hooks/fs.h> to fs/namespace.c."
+            echo "[*] Adding missing #include <trace/hooks/fs.h> to fs/namespace.c."
             sed -i '/#include <trace\/hooks\/blk.h>/a #include <trace\/hooks\/fs.h>' ./fs/namespace.c
             echo "MMAP_NAMESPACE_FIX=true" >> "$GITHUB_ENV"
           else
-            echo "[INFO] #include <trace/hooks/fs.h> already present."
+            echo "[*] #include <trace/hooks/fs.h> already present."
             echo "MMAP_NAMESPACE_FIX=already_present" >> "$GITHUB_ENV"
           fi
         fi
@@ -82,7 +82,7 @@ runs:
       if: ${{ (inputs.version == 'android12-5.10' && inputs.sublevel == 226) || (inputs.version == 'android13-5.10' && inputs.sublevel == 223) || (inputs.version == 'android13-5.15' && inputs.sublevel == 167) || (inputs.version == 'android14-5.15' && inputs.sublevel == 167) }}
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
-        echo "[INFO] Applying mmap.c fix for specific version combo."
+        echo "[*] Applying mmap.c fix for specific version combo."
         sed -i 's/\s*vm_flags_clear(new_vma, VM_PAD_MASK);/                new_vma->vm_flags \&= ~VM_PAD_MASK;/' mm/mmap.c
         echo "MMAP_VM_FLAGS_FIX=true" >> "$GITHUB_ENV"
 

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

@@ -218,7 +218,7 @@ jobs:
         set -euo pipefail
         KVER="${{ inputs.kernel_version }}"
         if [ "$(printf '%s\n' "6.6" "$KVER" | sort -V | head -n1)" = "6.6" ]; then
-          echo "[INFO] KVER $KVER >= 6.6, patching selinux_hide.c (all flavors/branches)"
+          echo "[*] KVER $KVER >= 6.6, patching selinux_hide.c (all flavors/branches)"
           for f in $(find "${{ github.workspace }}" -name selinux_hide.c 2>/dev/null); do
             # After SUSFS 10_enable (kernelsu only) the declaration becomes
             #   extern void security_dump_masked_av_fn(...)   (a function)
@@ -227,35 +227,35 @@ jobs:
             # For the function form,  &func != NULL  silences both (clang note).
             # For the pointer form (resukisu/next, no 10_enable) we want ptr != NULL.
             if grep -q "extern void security_dump_masked_av_fn" "$f"; then
-              echo "[INFO] $f is extern-function form (10_enable applied), patching with &"
+              echo "[*] $f is extern-function form (10_enable applied), patching with &"
               sed -i 's/if (security_dump_masked_av_fn)/if (\&security_dump_masked_av_fn)/g' "$f"
               sed -i 's/if (security_dump_masked_av_fn != NULL)/if (\&security_dump_masked_av_fn != NULL)/g' "$f"
               sed -i 's/if (context_struct_compute_av_fn)/if (\&context_struct_compute_av_fn)/g' "$f"
               sed -i 's/if (context_struct_compute_av_fn != NULL)/if (\&context_struct_compute_av_fn != NULL)/g' "$f"
-              echo "[OK] Patched $f (function form)"
+              echo "[+] Patched $f (function form)"
             elif grep -q "if (security_dump_masked_av_fn" "$f"; then
-              echo "[INFO] $f is pointer form, patching with != NULL"
+              echo "[*] $f is pointer form, patching with != NULL"
               sed -i 's/if (security_dump_masked_av_fn)/if (security_dump_masked_av_fn != NULL)/g' "$f"
               sed -i 's/if (context_struct_compute_av_fn)/if (context_struct_compute_av_fn != NULL)/g' "$f"
-              echo "[OK] Patched $f (pointer form)"
+              echo "[+] Patched $f (pointer form)"
             else
-              echo "[INFO] $f already patched"
+              echo "[*] $f already patched"
             fi
             # Next (and tiann without 10_enable fallback) declares the 3 helpers as
             # static on 6.6, but kernel hooks.c/selinuxfs.c reference them as extern
             # after SUSFS (ReSukiSU uses __maybe_static -> global). Strip static so
             # the linker can resolve security_context_to_sid_with_policy etc.
             if grep -q "^static int security_context_to_sid_with_policy" "$f"; then
-              echo "[INFO] Stripping static from $f helpers (Next 6.6)"
+              echo "[*] Stripping static from $f helpers (Next 6.6)"
               sed -i 's/^static int security_context_to_sid_with_policy/int security_context_to_sid_with_policy/g' "$f"
               sed -i 's/^static int security_sid_to_context_with_policy/int security_sid_to_context_with_policy/g' "$f"
               sed -i 's/^static void security_compute_av_user_with_policy/void security_compute_av_user_with_policy/g' "$f"
               # also forward decls (same prefix, same sed covers them)
-              echo "[OK] Stripped static from $f"
+              echo "[+] Stripped static from $f"
             fi
           done
         else
-          echo "[SKIP] KVER $KVER < 6.6"
+          echo "[-] KVER $KVER < 6.6"
         fi
 
     - name: Baseband Guard