Files
SukiSU-Ultra/docs/guide/how-to-integrate.md
OukaroMF 21aa58f1ee docs: EN: add simple translation for tracepoint-hook docs (#352)
* add EN translation for tracepoint-hook

* add EN translation for tracepoint-hook
2025-08-24 11:38:04 +08:00

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

  1. 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).
  2. Manual hook:

  3. Tracepoint Hook:

If you're able to build a bootable kernel, there are two ways to integrate KernelSU into the kernel source code:

  1. Automatically with kprobe
  2. 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)