LKM mode
LKM (loadable kernel module) is how XenonSU roots a device without replacing the kernel. A patched init_boot boots normally and ksud loads kernelsu.ko at late-load time.
How the module is chosen
ksud reads the running kernel's KMI and picks the matching prebuilt module:
android12-5.10 android13-5.10 android13-5.15 android14-5.15
android14-6.1 android15-6.6 android16-6.12 android17-6.18Those eight .ko files are embedded inside the ksud binary at build time. You can list what a given build carries:
ksud kernel supported-kmi"Failed to load ..._kernelsu.ko"
If the install screen stops with:
Patch Error: Failed to load android15-6.6_kernelsu.ko
Caused by: asset not found: android15-6.6_kernelsu.kothe ksud binary in the APK was built without the modules embedded. That happens when the source tree was cloned without the prebuilt .ko files (userspace/ksud/bin/.gitignore excludes **/*.ko) and the binary was then packed. Verify with:
ksud kernel supported-kmi # prints nothing when the assets are missingOfficially built APKs always carry all eight. If you build from source, place the modules in userspace/ksud/bin/aarch64/ before cargo build, and rebuild from clean — rust-embed is built with compression, so an incremental build will not pick up newly added files.
Why a module and not a kernel patch
LKM keeps vendor_boot, dtbo and the rest of the boot chain untouched, so an OTA is less likely to leave the device in a half-patched state. The trade-off is that LKM needs the matching prebuilt module for your KMI; a kernel patch does not.