-
Notifications
You must be signed in to change notification settings - Fork 43
Description
This guide is mostly for 3.18 / 3.10 / 3.4 and 3.0.
If you're planning to integrate KernelSU on an ultra-legacy device, yep this is the thread for you.
Aside from standard Legacy 4.x fixes, this repo's KernelSU also has adaptations for Ultra-Legacy.
Reference: f2afcfa...8301c4c
Lets start,
Main issue on 3.x is that, theres no LSM_HOOK_INIT / security_add_hooks.
So make sure to apply
Make sure to build your KernelSU with CONFIG_KSU_LSM_SECURITY_HOOKS=n
Now that's done, follow manual hook guide from here
Make sure to use what's appropriate to your kernel!
as for kernel side changes
for 3.18 and below you probably need:
for 3.4 and below you also need:
for 3.10 / 3.4 / 3.0
Since you're likely building your kernel without CONFIG_UIDGID_STRICT_TYPE_CHECKS, we have to patch this on KernelSU side.
if this is disabled, uid is not kuid_t, so we have to remove .val as uid is uid_t already, and theres no uid.val
- you can run
kuid_ul_fix.shinside the driver directory - another option is to apply: KernelSU: adapt to CONFIG_UIDGID_STRICT_TYPE_CHECKS=n [3]
[3]: inlining a massive ifdef for this was evaluated, but since it is too nasty and very few builds 3.10 and older, just edit it yourself.
Thats it!
show deprecated
READ: THESE ARE NOW USELESS
THIS IS HERE JUST FOR REFERENCE PURPOSES
- BACKPORT: fs/readdir: provide iterate_dir [2] (optional)
[2]: iterate_dir -> vfs_readdir fallback was added so this is now optional - ARM: provide current_user_stack_pointer - solved by 5b47e46
- UPSTREAM: Provide a binary to hex conversion function - a weak symbol is now provided
extras
- if youre building with an old compiler, you probably have to build ksu with
-Wno-erroror cast all PTR_ERR to int
apply either: