manager: added mount system switchability

userspace: added ksud_overlayfs & ksud_magic
This commit is contained in:
Rifat Azad
2025-01-07 17:08:53 +06:00
parent decf45a69e
commit f3f4ba5897
68 changed files with 6998 additions and 52 deletions

View File

@@ -7,7 +7,8 @@ on:
- '.github/workflows/build-manager.yml'
- 'manager/**'
- 'kernel/**'
- 'userspace/ksud/**'
- 'userspace/ksud_magic/**'
- 'userspace/ksud_overlayfs**'
pull_request:
branches: [ "next" ]
paths:
@@ -20,20 +21,32 @@ jobs:
uses: ./.github/workflows/build-lkm.yml
secrets: inherit
build-ksud:
build-ksud_overlayfs:
needs: build-lkm
strategy:
matrix:
include:
- target: aarch64-linux-android
os: ubuntu-latest
uses: ./.github/workflows/ksud.yml
uses: ./.github/workflows/ksud_overlayfs.yml
with:
target: ${{ matrix.target }}
os: ${{ matrix.os }}
build-ksud_magic:
needs: build-ksud_overlayfs
strategy:
matrix:
include:
- target: aarch64-linux-android
os: ubuntu-latest
uses: ./.github/workflows/ksud_magic.yml
with:
target: ${{ matrix.target }}
os: ${{ matrix.os }}
build-manager:
needs: build-ksud
needs: build-ksud_magic
runs-on: ubuntu-latest
defaults:
run:
@@ -69,15 +82,33 @@ jobs:
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Download arm64 ksud
- name: Download arm64 ksud_overlayfs
uses: actions/download-artifact@v4
with:
name: ksud-aarch64-linux-android
path: .
name: ksud_overlayfs-aarch64-linux-android
path: ./overlayfs
- name: Copy ksud to app jniLibs
- name: Verify artifact structure
run: |
cp -f ../aarch64-linux-android/release/ksud ../manager/app/src/main/jniLibs/arm64-v8a/libksud.so
ls -R ./overlayfs
- name: Copy ksud_overlayfs to app jniLibs
run: |
cp -f ./overlayfs/aarch64-linux-android/release/ksud ../manager/app/src/main/jniLibs/arm64-v8a/libksud_overlayfs.so
- name: Download arm64 ksud_magic
uses: actions/download-artifact@v4
with:
name: ksud_magic-aarch64-linux-android
path: ./magic
- name: Verify artifact structure
run: |
ls -R ./magic
- name: Copy ksud_magic to app jniLibs
run: |
cp -f ./magic/aarch64-linux-android/release/ksud ../manager/app/src/main/jniLibs/arm64-v8a/libksud_magic.so
- name: Build with Gradle
run: |

View File

@@ -1,4 +1,4 @@
name: Build ksud
name: Build ksud_magic
on:
workflow_call:
inputs:
@@ -31,7 +31,7 @@ jobs:
- name: Prepare LKM fies
if: ${{ inputs.pack_lkm }}
run: |
cp android*-lkm/*_kernelsu.ko ./userspace/ksud/bin/aarch64/
cp android*-lkm/*_kernelsu.ko ./userspace/ksud_magic/bin/aarch64/
- name: Setup rustup
run: |
@@ -40,18 +40,18 @@ jobs:
rustup target add aarch64-apple-darwin
- uses: Swatinem/rust-cache@v2
with:
workspaces: userspace/ksud
workspaces: userspace/ksud_magic
cache-targets: false
- name: Install cross
run: |
cargo install cross --git https://github.com/cross-rs/cross --rev 66845c1 --force
- name: Build ksud
run: CROSS_NO_WARNINGS=0 cross build --target ${{ inputs.target }} --release --manifest-path ./userspace/ksud/Cargo.toml
- name: Build ksud_magic
run: CROSS_NO_WARNINGS=0 cross build --target ${{ inputs.target }} --release --manifest-path ./userspace/ksud_magic/Cargo.toml
- name: Upload ksud artifact
- name: Upload ksud_magic artifact
uses: actions/upload-artifact@v4
with:
name: ksud-${{ inputs.target }}
name: ksud_magic-${{ inputs.target }}
path: userspace/ksud/target/**/release/ksud*

57
.github/workflows/ksud_overlayfs.yml vendored Normal file
View File

@@ -0,0 +1,57 @@
name: Build ksud_overlayfs
on:
workflow_call:
inputs:
target:
required: true
type: string
os:
required: false
type: string
default: ubuntu-latest
pack_lkm:
required: false
type: boolean
default: true
use_cache:
required: false
type: boolean
default: true
jobs:
build:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Prepare LKM fies
if: ${{ inputs.pack_lkm }}
run: |
cp android*-lkm/*_kernelsu.ko ./userspace/ksud_overlayfs/bin/aarch64/
- name: Setup rustup
run: |
rustup update stable
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
- uses: Swatinem/rust-cache@v2
with:
workspaces: userspace/ksud_overlayfs
cache-targets: false
- name: Install cross
run: |
cargo install cross --git https://github.com/cross-rs/cross --rev 66845c1 --force
- name: Build ksud_overlayfs
run: CROSS_NO_WARNINGS=0 cross build --target ${{ inputs.target }} --release --manifest-path ./userspace/ksud_overlayfs/Cargo.toml
- name: Upload ksud_overlayfs artifact
uses: actions/upload-artifact@v4
with:
name: ksud_overlayfs-${{ inputs.target }}
path: userspace/ksud/target/**/release/ksud*