3.8 KiB
Integrate
SukiSU can be integrated into both GKI and non-GKI kernels and has been backported to 4.14.
Some OEMs' customization could result in as much as 50% of kernel code being out-of-tree code and not from upstream Linux kernels or ACKs. Due to this, the custom nature of non-GKI kernels resulted in significant kernel fragmentation, and we lacked a universal method for building them. Therefore, we cannot provide boot images of non-GKI kernels.
Prerequisites: open source bootable kernel.
Hook method
-
KPROBES hook:
- Default hook method on GKI kernels.
- Requires
# CONFIG_KSU_MANUAL_HOOK is not set&CONFIG_KPROBES=y - Used for Loadable Kernel Module (LKM).
-
Manual hook:
- Requires
CONFIG_KSU_MANUAL_HOOK=y - Requires
guide/how-to-integrate.md - Requires https://github.com/~
- Requires
-
Tracepoint Hook:
- Hook method introduced since SukiSU commit 49b01aad
- Requires
CONFIG_KSU_TRACEPOINT_HOOK=y - Requires
guide/tracepoint-hook.md
If you're able to build a bootable kernel, there are two ways to integrate KernelSU into the kernel source code:
- Automatically with
kprobe - Manually
Integrate with kprobe
Applicable:
- GKI kernel
Not applicable:
- non-GKI kernel
KernelSU uses kprobe to do kernel hooks. If kprobe runs well in your kernel, it's recommended to use it this way.
Please refer to this document https://github.com/~. Although it is titled “for non-GKI,” it only applies to GKI.
The execution command for the step that adds KernelSU to your kernel source tree is replaced with:
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s main
Manually modify the kernel source
Applicable:
- GKI kernel
- non-GKI kernel
Please refer to this document https://github.com/~ (Integrate for non-GKI) and https://github.com/~ (Build for GKI) to integrate manually, although first link is titled “for non-GKI,” it also applies to GKI. It can work on them both.
There is another way to integrate but still work in the process.
Run command for the step that adds KernelSU(SukiSU) to your kernel source tree is replaced with:
GKI kernel
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s main
non-GKI kernel
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s nongki
GKI / non-GKI kernel with susfs (experiment)
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s susfs-{{branch}}
Branch:
main(susfs-main)test(susfs-test)- version (for example: susfs-1.5.7, you should check the branches)