tytydraco / KTweak

A no-nonsense kernel tweak script for Linux and Android systems, backed by evidence.
BSD 2-Clause "Simplified" License
401 stars 80 forks source link

Patch custom ROMs #3

Closed ZJaume closed 4 years ago

ZJaume commented 4 years ago

I'm very interested in these tweaks but I don't use any kind of root or systemless root like Magisk. Are those available in the form of a patchset or something that can be included in a custom build process? I imagine that, anyway, I could simply copy the parameters to my kernel config before building. But I've seen that some parameters are changed dynamically during execution, so I assume the script you made needs to be included in system.

tytydraco commented 4 years ago

You can try to manually set the tunables in your kernel source. The issue is that there are so many different places where the tunables exist, so you'd have to track them all down and change them individually. Also, Android init likes to write to many of the same tunables, overwriting any early boot changes. That's why ktweak applies 20s later.

You could try to bundle the ktweak script with your rom's ramdisk and have it execute post-boot. Another idea is to include the script in /system/bin/ with your rom and have a script execute ktweak.

Hopefully this helps!

ZJaume commented 4 years ago

All right! I'm novice in building Android ROMs actually, but I'll investigate how to include it as a system binary and execute it in the way you do.

tytydraco commented 4 years ago

Good luck! I'll go ahead and close this issue but feel free to open it back up if you have further questions. You can also DM me directly or email me if you'd like. Thanks!