12 Ревизии e3c749468a ... c20ab19ef0

Автор SHA1 Съобщение Дата
  TheWildJames c20ab19ef0 test: temporarily disable 6.6-fix (min_kdp / wifi+bt) преди 3 дни
  TheWildJames 7ced3cd860 chore: remove dead ksun action преди 3 дни
  TheWildJames 60ff11e2d8 fix(susfs): follow symlinks when hunting selinux_hide.c преди 3 дни
  TheWildJames c42981c8a1 fix(susfs): strip static from with_policy helpers on 6.6+, port from GKI преди 3 дни
  TheWildJames 37a69c78c5 fix(build): fail fast on kernel compile error, drop || true swallow преди 3 дни
  TheWildJames ba3c35160b feat(susfs): enable open-redirect to match GKI преди 4 дни
  TheWildJames f17c787fe9 feat(susfs): enable all SUSFS feature configs except open-redirect преди 4 дни
  TheWildJames b0f4a4dcc9 chore(susfs): drop nomount open-redirect toggle преди 4 дни
  TheWildJames 5dacfc885d fix(susfs): fail loud on SUSFS patch rejects преди 4 дни
  TheWildJames c83cd668ce feat(susfs): apply 10_enable patch for kernelsu flavor only преди 4 дни
  TheWildJames a87afc2271 fix(susfs): gate pershoot cherry-pick to next flavor only преди 4 дни
  TheWildJames 5c3c6a47ca fix(root-setup): version values from pinned commit, bake ReSukiSU sha/branch преди 4 дни

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

@@ -32,7 +32,7 @@ runs:
 
      if [[ $BRANCH == SM-A055* || $BRANCH == SM-X926B* ]]; then
       chmod +x build_kernel.sh
-      env $SCRIPT_LTO ./build_kernel.sh || true
+      env $SCRIPT_LTO ./build_kernel.sh
      elif [[ $BRANCH == SM-S926* ]]; then
        #tools/bazel run --nocheck_bzl_visibility --config=stamp --sandbox_debug --verbose_failures --debug_make_verbosity=I //projects/s5e9945:s5e9945_user_dist
        tools/bazel build --nocheck_bzl_visibility --config=stamp --sandbox_debug --verbose_failures --debug_make_verbosity=I $BAZEL_LTO //projects/s5e9945:s5e9945_user
@@ -42,10 +42,10 @@ runs:
      elif [[ $BRANCH == SM-S938B* ]]; then
       sed -i '/drivers\/net\/usb\/smsc75xx\.ko/d;/drivers\/net\/usb\/smsc95xx\.ko/d' kernel_platform/common/modules.bzl
       chmod +x build_kernel_GKI.sh
-      env $SCRIPT_LTO ./build_kernel_GKI.sh || true
+      env $SCRIPT_LTO ./build_kernel_GKI.sh
      elif [[ $KERNEL_VER == 6.* ]]; then
       chmod +x build_kernel_GKI.sh
-      env $SCRIPT_LTO ./build_kernel_GKI.sh || true
+      env $SCRIPT_LTO ./build_kernel_GKI.sh
      elif [[ -d kernel_platform ]]; then
       cd kernel_platform
       tools/bazel build $BAZEL_LTO //common:kernel_aarch64
@@ -68,12 +68,12 @@ runs:
      cd "$CONFIG"
      if [[ -f build_kernel_GKI.sh ]]; then
       chmod +x build_kernel_GKI.sh
-      env $SCRIPT_LTO ./build_kernel_GKI.sh || true
+      env $SCRIPT_LTO ./build_kernel_GKI.sh
      elif [[ -f build_kernel.sh ]]; then
       sudo apt update
       sudo apt-get install -y libyaml-dev
       chmod +x build_kernel.sh
-      env $SCRIPT_LTO ./build_kernel.sh || true
+      env $SCRIPT_LTO ./build_kernel.sh
      fi
      
      #if [[ $BRANCH == SM-S928B* || "$BRANCH" == "SM-S938B-Oneui7" || "$BRANCH" == "SM-S931B-Oneui8" || "$BRANCH" == "SM-F741B-Oneui8" || "$BRANCH" == "SM-X710-Oneui6.1.1" ]]; then

+ 0 - 4
.github/actions/file-name/action.yml

@@ -9,10 +9,6 @@ inputs:
   description: 'variant'
   required: false
   default: ""
- ksun:
-  description: 'ksun (deprecated)'
-  required: false
-  default: "true"
  susfs:
   description: 'susfs'
   required: true

+ 0 - 61
.github/actions/ksun/action.yml

@@ -1,61 +0,0 @@
-name: Set up KernelSU-Next
-description: download and set up KSUN into the kernel source
-inputs:
- susfs:
-  description: 'susfs'
-  required: true
-
-
-runs:
-  using: composite
-  steps:
-    - name: Setup KSUN with no susfs
-      if: inputs.susfs == 'false'
-      shell: bash
-      run: |
-        cd "$COMMON"
-        curl -LSs "https://raw.githubusercontent.com/KernelSU-Next/KernelSU-Next/next/kernel/setup.sh" | bash -s dev
-
-    - name: Setup pershoot KSUN with susfs
-      if: inputs.susfs == 'true'
-      shell: bash
-      run: |
-        cd "$COMMON"
-        curl -LSs "https://raw.githubusercontent.com/pershoot/KernelSU-Next/dev-susfs/kernel/setup.sh" | bash -s dev-susfs
-
-    - name: enable in defconfig
-      if: inputs.susfs == 'false'
-      shell: bash
-      run: |
-        "$COMMON/scripts/config" --file "$GKI_DEFCONFIG" --enable CONFIG_KSU
-      
-    - name: Extract KSU Version Info and inject into Kbuild
-      shell: bash
-      run: |
-        cd "$COMMON/KernelSU-Next"
-
-        # Fetch dev branch for version info (tags, commits, etc.)
-        git fetch origin dev 2>/dev/null || true
-        
-        # Extract and export KSU version info from dev branch
-        KSU_GIT_VERSION=$(git rev-list --count refs/remotes/origin/dev 2>/dev/null)
-        KSU_GIT_TAG=$(git describe --tags --abbrev=0 refs/remotes/origin/dev 2>/dev/null || echo "")
-        KSU_COMMIT=$(git rev-parse --short refs/remotes/origin/dev 2>/dev/null)
-        KSU_VERSION=$((30000 + KSU_GIT_VERSION))
-
-        cd kernel
-        sed -i "s/^KSU_VERSION_FALLBACK := 1$/KSU_VERSION_FALLBACK := ${KSU_VERSION}/" Kbuild
-        sed -i "s/^KSU_VERSION_TAG_FALLBACK := v0.0.1$/KSU_VERSION_TAG_FALLBACK := ${KSU_GIT_TAG}/" Kbuild
-        
-        echo "KSU_GIT_TAG=$KSU_GIT_TAG" >> $GITHUB_ENV
-        echo "KSU_VERSION=$KSU_VERSION" >> $GITHUB_ENV
-        echo "KSU_COMMIT=$KSU_COMMIT" >> $GITHUB_ENV
-
-    - name: 'Fix KernelSU-Next'
-      if: inputs.susfs == 'true'
-      shell: bash
-      run: |
-        set -euo pipefail
-        cd "$COMMON/KernelSU-Next"
-        cp ${{ github.action_path }}/patches/static.patch ./
-        patch -p1 < static.patch

+ 0 - 23
.github/actions/ksun/patches/static.patch

@@ -1,23 +0,0 @@
-diff --git a/kernel/feature/selinux_hide.c b/kernel/feature/selinux_hide.c
-index e1384d9..56e4cfe 100644
---- a/kernel/feature/selinux_hide.c
-+++ b/kernel/feature/selinux_hide.c
-@@ -35,12 +35,12 @@ bool ksu_selinux_hide_enabled __read_mostly = false;
- bool ksu_selinux_hide_running __read_mostly = false;
- 
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
--static int security_context_to_sid_with_policy(struct selinux_policy *policy, const char *scontext, u32 scontext_len,
--                                               u32 *sid, u32 def_sid, gfp_t gfp_flags);
--static int security_sid_to_context_with_policy(struct selinux_policy *policy, u32 sid, char **scontext,
--                                               u32 *scontext_len);
--static void security_compute_av_user_with_policy(struct selinux_policy *policy, u32 ssid, u32 tsid, u16 tclass,
--                                                 struct av_decision *avd);
-+int security_context_to_sid_with_policy(struct selinux_policy *policy, const char *scontext, u32 scontext_len,
-+                                        u32 *sid, u32 def_sid, gfp_t gfp_flags);
-+int security_sid_to_context_with_policy(struct selinux_policy *policy, u32 sid, char **scontext,
-+                                        u32 *scontext_len);
-+void security_compute_av_user_with_policy(struct selinux_policy *policy, u32 ssid, u32 tsid, u16 tclass,
-+                                          struct av_decision *avd);
- static void (*security_dump_masked_av_fn)(struct policydb *policydb, struct context *scontext, struct context *tcontext,
-                                           u16 tclass, u32 permissions, const char *reason) = NULL;
- static void (*context_struct_compute_av_fn)(struct policydb *policydb, struct context *scontext,

+ 10 - 3
.github/actions/root-setup/action.yml

@@ -128,9 +128,11 @@ runs:
         git fetch origin "$repobranch":refs/remotes/origin/"$repobranch" --tags --unshallow 2>/dev/null || \
         git fetch origin "$repobranch":refs/remotes/origin/"$repobranch" --tags 2>/dev/null || true
         
-        # Extract and export KSU version info from the fetched tracking branch
-        KSU_GIT_VERSION=$(git rev-list --count "refs/remotes/origin/$repobranch" 2>/dev/null || echo "0")
-        KSU_GIT_TAG=$(git describe --tags --abbrev=0 "refs/remotes/origin/$repobranch" 2>/dev/null || echo "v0.0.1")
+        # Extract and export KSU version info for the PINNED commit, not the
+        # branch tip: the pin is what we build, and the tip may have moved on.
+        KSU_GIT_VERSION=$(git rev-list --count "$expected_commit" 2>/dev/null || echo "0")
+        KSU_GIT_TAG=$(git describe --tags --abbrev=0 "$expected_commit" 2>/dev/null || echo "v0.0.1")
+        KSU_SHORT=$(git rev-parse --short=8 "$expected_commit")
         KSU_VERSION=$((30000 + KSU_GIT_VERSION))
 
         cd kernel
@@ -143,6 +145,11 @@ runs:
           # ReSukiSU targets KSU_VERSION and KSU_TAG_NAME explicitly
           sed -i "s|^KSU_VERSION :=.*|KSU_VERSION := ${KSU_VERSION}|" Kbuild
           sed -i "s|^KSU_TAG_NAME.*:=.*|KSU_TAG_NAME := ${KSU_GIT_TAG}|" Kbuild
+          # Bake the short SHA too (both the probe and the -dirty append
+          # match, so both become the literal and the suffix is gone), plus
+          # the branch the pin was taken from.
+          sed -i "s|^KSU_COMMIT_SHA  :=.*|KSU_COMMIT_SHA  := ${KSU_SHORT}|" Kbuild
+          sed -i "s|^KSU_BRANCH_NAME :=.*|KSU_BRANCH_NAME := ${repobranch}|" Kbuild
         elif [ "$flavor" = "next" ]; then
           #KernelSU-Next uses fallback pattern
           sed -i "s/^KSU_VERSION_FALLBACK := 1$/KSU_VERSION_FALLBACK := ${KSU_VERSION}/" Kbuild

+ 52 - 12
.github/actions/susfs-patches/action.yml

@@ -1,9 +1,10 @@
 name: apply susfs patches
 description: apply susfs patches
 inputs:
- nomount:
-  description: 'nomount'
-  required: true
+ flavor:
+  description: 'root flavor (kernelsu, next, resukisu) - pershoot commits only apply to next'
+  required: false
+  default: ""
  susfs_commit:
   description: 'pinned SUSFS commit (empty = latest tip)'
   required: false
@@ -27,8 +28,12 @@ runs:
       git config --global user.email "41898282+github-actions[bot]@://github.com"
       
       cd susfs4ksu
-      git fetch https://gitlab.com/pershoot/susfs4ksu.git gki-android14-6.1-dev || true
-      git log ..FETCH_HEAD --oneline -n 2 | awk '{print $1}' | tac | xargs git cherry-pick 2>/dev/null || true
+      # Pershoot's gki-android14-6.1-dev commits only apply to KernelSU-Next
+      # (dev-susfs fork). Other flavors use the simonpunk checkout as-is.
+      if [ "${{ inputs.flavor }}" = "next" ]; then
+        git fetch https://gitlab.com/pershoot/susfs4ksu.git gki-android14-6.1-dev || true
+        git log ..FETCH_HEAD --oneline -n 2 | awk '{print $1}' | tac | xargs git cherry-pick 2>/dev/null || true
+      fi
       
       SUSFS4KSU="$ROOT/susfs4ksu"
       echo "SUSFS4KSU=$SUSFS4KSU" >> $GITHUB_ENV
@@ -37,7 +42,20 @@ runs:
    - name: Apply to KSUN
      shell: bash
      run: |
-       echo "SUSFS prepared at $SUSFS4KSU"
+       # Tiann KernelSU does not ship SUSFS: apply the enable patch to the
+       # root checkout. Next and ReSukiSU already include SUSFS, skip them.
+       if [ "${{ inputs.flavor }}" = "kernelsu" ]; then
+         PATCH="$SUSFS4KSU/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch"
+         if [ ! -f "$PATCH" ]; then
+           echo "Missing 10_enable_susfs_for_ksu.patch at $PATCH" >&2
+           exit 1
+         fi
+         echo "Applying SUSFS enable patch to KernelSU checkout at $ROOT_DIR"
+         git -C "$ROOT_DIR" apply --check "$PATCH"
+         git -C "$ROOT_DIR" apply "$PATCH"
+       else
+         echo "SUSFS prepared at $SUSFS4KSU (flavor ${{ inputs.flavor }} ships its own SUSFS)"
+       fi
        
    - name: Copy required files
      shell: bash
@@ -64,7 +82,7 @@ runs:
      shell: bash
      run: |
       cd "$COMMON"
-      patch -p1 < 50_add_susfs_in_gki-$ANDROID_VER-$KERNEL_VER.patch || true
+      patch -p1 < 50_add_susfs_in_gki-$ANDROID_VER-$KERNEL_VER.patch
       rm -rf 50_add_susfs_in_gki-$ANDROID_VER-$KERNEL_VER.patch
       shopt -s nullglob
       patches=("$KERNEL_PATCHES/samsung/$BRANCH"/*.patch)
@@ -88,13 +106,35 @@ runs:
           echo "Added page_size_compat.h include"
         fi
        
-   - name: add ksu-susfs to config
+   - name: fix with_policy static on 6.6+ (port from GKI)
      shell: bash
      run: |
-      "$COMMON/scripts/config" --file "$GKI_DEFCONFIG" --enable CONFIG_KSU_SUSFS
+      if [ "$(printf '%s\n' "6.6" "$KERNEL_VER" | sort -V | head -n1)" = "6.6" ]; then
+        echo "[*] KVER $KERNEL_VER >= 6.6, stripping static from with_policy helpers"
+        for f in $(find -L "$COMMON" -name selinux_hide.c 2>/dev/null); do
+          if grep -q "^static int security_context_to_sid_with_policy" "$f"; then
+            echo "[*] Stripping static from $f helpers"
+            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"
+            echo "[+] Stripped static from $f"
+          fi
+        done
+      else
+        echo "[-] KVER $KERNEL_VER < 6.6, skipping"
+      fi
 
-   - name: remove open redirect if nomount is enabled
-     if: inputs.nomount == 'true'
+   - name: add ksu-susfs to config
      shell: bash
      run: |
-      "$COMMON/scripts/config" --file "$GKI_DEFCONFIG" --disable CONFIG_KSU_SUSFS_OPEN_REDIRECT
+      "$COMMON/scripts/config" --file "$GKI_DEFCONFIG" \
+        --enable CONFIG_KSU_SUSFS \
+        --enable CONFIG_KSU_SUSFS_SUS_PATH \
+        --enable CONFIG_KSU_SUSFS_SUS_MOUNT \
+        --enable CONFIG_KSU_SUSFS_SUS_KSTAT \
+        --enable CONFIG_KSU_SUSFS_SPOOF_UNAME \
+        --enable CONFIG_KSU_SUSFS_ENABLE_LOG \
+        --enable CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS \
+        --enable CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG \
+        --enable CONFIG_KSU_SUSFS_SUS_MAP \
+        --enable CONFIG_KSU_SUSFS_OPEN_REDIRECT

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

@@ -297,7 +297,7 @@ jobs:
         if: inputs.susfs == 'true'
         uses: ./.github/actions/susfs-patches
         with:
-          nomount: ${{ inputs.nomount }}
+          flavor: ${{ inputs.root_flavor }}
           susfs_commit: ${{ steps.susfs-cm.outputs.commit }}
 
       - name: Add Zeromount
@@ -343,7 +343,10 @@ jobs:
         uses: ./.github/actions/optimization
 
       - name: Fix WiFi and Bluetooth on Samsung 6.6 GKI devices
-        if: ${{ env.KERNEL_VER == '6.6' }}
+        # TEMP-DISABLED 2026-09-08: stock Samsung shouldn't need this; testing
+        # whether the kdp modpost failure goes away without it. Re-enable by
+        # restoring: if: ${{ env.KERNEL_VER == '6.6' }}
+        if: false
         uses: ./.github/actions/6.6-fix
 
       - name: temp fix for m55 bootloop maybe
@@ -366,7 +369,6 @@ jobs:
         with:
          root_flavor: ${{ inputs.root_flavor }}
          variant: ${{ inputs.variant }}
-         ksun: "true"
          susfs: ${{ inputs.susfs }}
          zeromount: ${{ inputs.zeromount }}
          nomount: ${{ inputs.nomount }}