Skip to content

Commit

Permalink
userspace: Add SUSFS lib
Browse files Browse the repository at this point in the history
  • Loading branch information
changhuapeng committed Dec 23, 2024
1 parent 3503db1 commit 2402e65
Show file tree
Hide file tree
Showing 6 changed files with 858 additions and 1 deletion.
33 changes: 32 additions & 1 deletion .github/workflows/build-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- 'manager/**'
- 'kernel/**'
- 'userspace/ksud/**'
- 'userspace/susfs/**'
pull_request:
branches: [ "rebase-magic-mount" ]
paths:
Expand Down Expand Up @@ -119,8 +120,19 @@ jobs:
os: ${{ matrix.os }}
pack_lkm: false

build-susfs:
needs: update-version
strategy:
matrix:
include:
- target: arm64-v8a
- target: x86_64
uses: ./.github/workflows/susfs.yml
with:
target: ${{ matrix.target }}

build-manager:
needs: build-ksud
needs: [build-ksud, build-susfs]
runs-on: ubuntu-latest
defaults:
run:
Expand Down Expand Up @@ -186,6 +198,25 @@ jobs:
cp -f ../aarch64-linux-android/release/ksud ../manager/app/src/main/jniLibs/arm64-v8a/libksud.so
cp -f ../x86_64-linux-android/release/ksud ../manager/app/src/main/jniLibs/x86_64/libksud.so
- name: Download arm64 susfs
uses: actions/download-artifact@v4
with:
name: susfs-arm64-v8a
path: ./arm64-v8a

- name: Download x86_64 susfs
uses: actions/download-artifact@v4
with:
name: susfs-x86_64
path: ./x86_64

- name: Copy susfs to app jniLibs
run: |
mkdir -p app/src/main/jniLibs/arm64-v8a
mkdir -p app/src/main/jniLibs/x86_64
cp -f ../arm64-v8a/susfs ../manager/app/src/main/jniLibs/arm64-v8a/libsusfs.so
cp -f ../x86_64/susfs ../manager/app/src/main/jniLibs/x86_64/libsusfs.so
- name: Build with Gradle
run: |
{
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/susfs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build susfs
on:
workflow_call:
inputs:
target:
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download artifacts
uses: actions/download-artifact@v4

- name: Build susfs
working-directory: ./userspace/susfs
run: $ANDROID_NDK/ndk-build

- name: Upload susfs artifact
uses: actions/upload-artifact@v4
with:
name: susfs-${{ inputs.target }}
path: ./userspace/susfs/libs/${{ inputs.target }}/susfs
2 changes: 2 additions & 0 deletions userspace/susfs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/obj
/libs
8 changes: 8 additions & 0 deletions userspace/susfs/jni/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := susfs
LOCAL_SRC_FILES := main.c

include $(BUILD_EXECUTABLE)
3 changes: 3 additions & 0 deletions userspace/susfs/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
APP_ABI := arm64-v8a x86_64
APP_PLATFORM := android-24
APP_STL := none
Loading

0 comments on commit 2402e65

Please sign in to comment.