Преглед изворни кода

Fix/upstream 6.12 swap (#279)

* fix: normalize getname_flags calls in fs/open.c for android16-6.12 to match kernel signature

* refactor: replace swap setup action with manual shell implementation to increase reliability
sorane пре 2 недеља
родитељ
комит
727e978f02
2 измењених фајлова са 26 додато и 4 уклоњено
  1. 9 0
      .github/actions/susfs-patches/action.yml
  2. 17 4
      .github/workflows/build.yml

+ 9 - 0
.github/actions/susfs-patches/action.yml

@@ -145,6 +145,15 @@ runs:
       run: |
         patch -p1 < 50_add_susfs_in_gki-${{ inputs.version }}.patch
 
+        # SUSFS v2.2.0's 6.12 patch still passes the removed third argument
+        # to getname_flags(). Android 16 / Linux 6.12 exposes the modern
+        # two-argument declaration, so normalize the generated open.c after
+        # applying the upstream SUSFS patch.
+        if [[ "${{ inputs.version }}" == "android16-6.12" ]]; then
+          sed -i 's/getname_flags(filename, lookup_flags, NULL)/getname_flags(filename, lookup_flags)/g' fs/open.c
+          echo "Fixed SUSFS getname_flags() call for Android 16 6.12"
+        fi
+
         # SUSFS's OPEN_REDIRECT code unconditionally calls VMA_PAD_START(), which
         # only exists on GKI branches that carry Google's page-size-migration
         # feature (added to each android version's kernel/common branch at a

+ 17 - 4
.github/workflows/build.yml

@@ -86,10 +86,23 @@ jobs:
         testing: false
 
     - name: Setup more Swap (for LTO)
-      uses: thejerrybao/setup-swap-space@v1   # or pierotofy/set-swap-space
-      with:
-        swap-size-gb: 16          # 10-24 GB is common for heavy LTO
-        # swap-space-path: /mnt/swapfile   # optional
+      shell: bash
+      run: |
+        set -euo pipefail
+        SWAP_FILE=/mnt/swapfile
+        SWAP_SIZE_GB=16
+
+        if sudo swapon --show=NAME --noheadings | grep -Fxq "$SWAP_FILE"; then
+          echo "Swap file already active: $SWAP_FILE"
+        else
+          echo "Creating ${SWAP_SIZE_GB}G swap file at $SWAP_FILE"
+          sudo fallocate -l "${SWAP_SIZE_GB}G" "$SWAP_FILE"
+          sudo chmod 600 "$SWAP_FILE"
+          sudo mkswap "$SWAP_FILE"
+          sudo swapon "$SWAP_FILE"
+        fi
+
+        free -h
 
     - name: Setup Build Environment
       uses: ./.github/actions/setup-build-environment