Description
This guide is mostly for 3.18 / 3.10 / 3.4 and possibly 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: 0201931...9744be4
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 whats missing
for 3.18 and below you probably need:
for 3.10 and below you also need:
for 3.4 and below you also need:
- fs: export kernel_write
- ARM: provide current_user_stack_pointer [1] - since you're likely building for ARM
[1]: alternative to this is writing on start_stack while this works, this is technically incorrect, but it is likely fineee
for 3.10 / 3.4
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 a struct, so we have to remove .val as uid is uid itself, not uid.val.
[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.
extras
- if youre building with an old compiler, you probably have to build ksu with
-Wno-error
or cast all PTR_ERR to int
apply: KernelSU: adapt to 3.10 + old gcc
Thats it!
show depreciated
- BACKPORT: fs/readdir: provide iterate_dir [2] (optional)
[2]: iterate_dir -> vfs_readdir fallback was added so this is now optional