• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root Script

Did this help you?

  • Nope, not at all.

    Votes: 0 0.0%

  • Total voters
    7

Bichofelix

Android Enthusiast
Jun 28, 2013
405
242
[Updated 9/6/15]

I am not responsible if:
  • Your house blows up or your kitten dies.
  • If you had a super important meeting and your alarm just didn't go off.
  • Your phone mysteriously catches fire.
  • You didn't follow directions.

So.. What is it?

It's a simple script that automatically sets governor settings, read ahead to 2048, and scheduler to deadline. Also enables ZRAM of 512mb

Most importantly. it sets freq_min to 200mhz instead of 800mhz.


What are the benefits of this?
It scales better according to load.
Potentially better battery life.
Solves a major heat problem on the Leon, not seen on the GStylo
Idles at 200mhz half the time it runs 1.2ghz



How do I use it?

  1. Download script HERE
  2. Use file explorer and go to /system
  3. Create a folder called "su.d"
  4. Give folder rwx-rx-rx permissions
  5. Place file in folder.
  6. Give file rwx-rx-rx permissions
  7. Profit!

Code:
 Changelog:
[*] V1.0 - Initial release[/B]
[*] V1.2 - separated cm/stock, add scheduler and SD tweaks.
[*] V1.3 - Added init.d support. Simplified script. Removed errors.
[*] V1.4 - Added su.d support for both stock and cm. Added Zram of 512mb. Added support for GStylo. Merged stock and cm scripts back.


Enjoy
 
Last edited:
sounds great. Last govenor i installed would automatically shutdown Apps in the background.. like pandora, so i couldnt like browse the internet while listening, or when the phone went to sleep, it would auto shutdown. I had to keep it on the pandora app.

Personally the phone isnt heating up nor am I having terrible battery life.. (just played youtube & pandora back and fourth via bluetooth and wifi into my surround sound system for like 5 hours, battery isn't dead, phone isnt hot.

Not trying to knock it, but I think I will wait to see if anyone has any issues with it, with CM12.1 installed on there leon.

Thanks for the script tho, seems good.

btw, what does scaling better according to load mean? Doesnt tie up as much resources?
 
Upvote 0
sounds great. Last govenor i installed would automatically shutdown Apps in the background.. like pandora, so i couldnt like browse the internet while listening, or when the phone went to sleep, it would auto shutdown. I had to keep it on the pandora app.

Personally the phone isnt heating up nor am I having terrible battery life.. (just played youtube & pandora back and fourth via bluetooth and wifi into my surround sound system for like 5 hours, battery isn't dead, phone isnt hot.

Not trying to knock it, but I think I will wait to see if anyone has any issues with it, with CM12.1 installed on there leon.

Thanks for the script tho, seems good.

btw, what does scaling better according to load mean? Doesnt tie up as much resources?
Means the CPU isn't running at high frequencies all the time and will only raise them when processes need more resources. The higher the frequencies at long periods of time the faster the battery drains and heats up. This is the case with the current kernel.
 
Upvote 0
How do I know if the script is working its magic?
Do I use kernel adiutor?
Kernel Adiutor apparently doesn't work well with our kernel. Bichofelix suggested using Device Control (Play search, first app)
Under CPU menu you'll notice the last core will be turned off and the cores will idle between 200 - 400 MHz instead of nearly full blast. To turn the last core back on (for whatever reason) just change min speed to 200. When you return to the CPU menu, it'll always revert to 1209/1209. Ignore that, it's a bug with the kernel readout and you'll notice the cores are responding as the script advertises.
 
Upvote 0
After I run the script, all cpu cores are still active and all of them are running at 1GHz.

No... No they're not. I set max_freq when hotplug is inactive to 1094400, but it idles at 20000. It's just so music/video doesn't lag when not touching it. The hotplug still maxes at 1209600 when touched.
Yes, 4 cores turn on. You should be running powersave all day anyways which cuts core 3-4.
 
Upvote 0
Look, it works..
tmp_10156-Screenshot_2015-07-29-05-46-341040646943.png
 
  • Like
Reactions: ModifHigher
Upvote 0
gave it a shot.....

by "ignore all the errors" you mean the errors after running the script that say no such file or directory, after every single script string in your script?

using "system Monitor" no change.
That's because those strings are for things on stock that cm doesn't have.
Except a few that are for a different processor and iI didnt comment them out since it doesn't hurt anything.
 
Upvote 0
That's because those strings are for things on stock that cm doesn't have.
Except a few that are for a different processor and iI didnt comment them out since it doesn't hurt anything.

My first error was access denied.. Idk I gave it rw-r-r, so I guess time will tell..

idlieing at 200mhz on c1-4, 3-4 are not taking any load. Spike when I took screenie.

Screenshot_2015-08-02-12-29-11.png



Side note, from 100%-26% battery life over 6 hours of constant use... No sleep time, streaming Pandora over a WiFi, thru a BT system.

6hours - 74% used.

I'll report back on the difference
 
Upvote 0
My first error was access denied.. Idk I gave it rw-r-r, so I guess time will tell..

idlieing at 200mhz on c1-4, 3-4 are not taking any load. Spike when I took screenie.

View attachment 91715


Side note, from 100%-26% battery life over 6 hours of constant use... No sleep time, streaming Pandora over a WiFi, thru a BT system.

6hours - 74% used.

I'll report back on the difference
That's slightly above average battery life, but not very demanding processes.
Try playing Modern Combat/Hearthstone/watching from Twitch streams on "Source" quality for 5 hours on LTE...got me down to 3%. That's not too shabby and could more than likely go further as the ROM/kernel develops ^_^
 
Upvote 0
Ppl seem weary, but aside from longer battery life, I can't tell I installed anything. So great script.


Also something to note, I used an app to play with memory usage and it patched over the script, causing my cores to run at 800mhz again. So just reran script and back to fast normal temp long lasting cm12.1 smooth lg Leon. Only app I've needed for performance is 360 booster every few hours, which just cleans caches and makes the phone run smoother overall.
 
Upvote 0
So after giving rw r r I get permission denied all across the board with no changes to frequency

U sure bout your no frequency change?

The script will basically say it did nothing. I use system monitor, and it would spike my resources, than run at 200mhz when I checked. It also shows iirc 1% for cores 1 & 2, 0% for cores 3 & 4.


Earlier in the thread it shows that. Also try rebooting. I don't think u need to but I don't remember. Just keep in mind the script mngr will say access denied, and a whole bunch of things it was unable to do, it won't say it completed anything.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones