Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build KernelSU as LKM #1254

Merged
merged 22 commits into from
Mar 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
some fixes
  • Loading branch information
tiann committed Mar 12, 2024
commit 995d65d96e1a04d08502971b42136c092ccf8ee3
3 changes: 1 addition & 2 deletions .github/workflows/build-kernel-a12.yml
Original file line number Diff line number Diff line change
@@ -132,5 +132,4 @@ jobs:
version_name: android12-5.10.177
tag: android12-5.10-2023-06
os_patch_level: 2023-06
patch_path: "5.10"
build_lkm: true
patch_path: "5.10"
13 changes: 1 addition & 12 deletions .github/workflows/build-kernel-a13.yml
Original file line number Diff line number Diff line change
@@ -159,24 +159,13 @@ jobs:
- version: "5.10"
sub_level: 189
os_patch_level: 2023-10
build_lkm: false
- version: "5.10"
sub_level: 189
os_patch_level: 2023-10
build_lkm: true
- version: "5.15"
sub_level: 123
os_patch_level: 2023-10
build_lkm: false
- version: "5.15"
sub_level: 123
os_patch_level: 2023-10
build_lkm: true
uses: ./.github/workflows/gki-kernel.yml
with:
version: android13-${{ matrix.version }}
version_name: android13-${{ matrix.version }}.${{ matrix.sub_level }}
tag: android13-${{ matrix.version }}-${{ matrix.os_patch_level }}
os_patch_level: ${{ matrix.os_patch_level }}
patch_path: ${{ matrix.version }}
build_lkm: ${{ matrix.build_lkm }}
patch_path: ${{ matrix.version }}
5 changes: 1 addition & 4 deletions .github/workflows/build-kernel-a14.yml
Original file line number Diff line number Diff line change
@@ -132,16 +132,13 @@ jobs:
- version: "5.15"
sub_level: 110
os_patch_level: 2023-09
build_lkm: true
- version: "6.1"
sub_level: 68
os_patch_level: 2024-02
build_lkm: true
uses: ./.github/workflows/gki-kernel.yml
with:
version: android14-${{ matrix.version }}
version_name: android14-${{ matrix.version }}.${{ matrix.sub_level }}
tag: android14-${{ matrix.version }}-${{ matrix.os_patch_level }}
os_patch_level: ${{ matrix.os_patch_level }}
patch_path: ${{ matrix.version }}
build_lkm: ${{ matrix.build_lkm }}
patch_path: ${{ matrix.version }}
41 changes: 41 additions & 0 deletions .github/workflows/build-lkm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build LKM for KernelSU
on:
push:
branches: ["main", "ci", "checkci"]
paths:
- ".github/workflows/gki-kernel.yml"
- "kernel/**"
pull_request:
branches: ["main"]
paths:
- ".github/workflows/gki-kernel.yml"
- "kernel/**"
workflow_call:
jobs:
build-lkm:
if: github.event_name != 'pull_request' && github.ref != 'refs/heads/checkci'
strategy:
matrix:
include:
- version: "android12-5.10"
sub_level: 198
os_patch_level: "2024-01"
- version: "android13-5.10"
sub_level: 198
os_patch_level: 2023-12
- version: "android13-5.15"
sub_level: 137
os_patch_level: 2023-12
- version: "android14-5.15"
sub_level: 110
os_patch_level: 2023-09
- version: "android14-6.1"
sub_level: 68
os_patch_level: 2024-02
uses: ./.github/workflows/gki-kernel.yml
with:
version: ${{ matrix.version }}
version_name: ${{ matrix.version }}.${{ matrix.sub_level }}
tag: ${{ matrix.version }}-${{ matrix.os_patch_level }}
os_patch_level: ${{ matrix.os_patch_level }}
build_lkm: true
2 changes: 2 additions & 0 deletions kernel/core_hook.c
Original file line number Diff line number Diff line change
@@ -734,6 +734,7 @@ void __init ksu_lsm_hook_init(void)
#endif
}

#ifdef MODULE
static int memcpy_ro(void *dst, const void *src, size_t len)
{
unsigned long base = (unsigned long)dst & PAGE_MASK;
@@ -822,6 +823,7 @@ void __init ksu_lsm_hook_init_hack(void)
KSU_LSM_HOOK_HACK_INIT(task_fix_setuid, ksu_task_fix_setuid);
smp_mb();
}
#endif

void __init ksu_core_init(void)
{
Loading