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

Root Tweaks Script for Stylo

Bichofelix

Android Enthusiast
[Updated 9/6/15]

Works for both cm and stock.


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.
  • You spontaneously combust.

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

The main reason I created it is 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 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.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:
With the addition of ZRAM you should now be able to cache the entire 20 background apps allowable by the system, which means faster app loading & performance in general.
I also observed that recent apps does not need to be cleared to reduce lag anymore.
 
If you do restore your phone to proper working condition adb pull /system/etc/init.qcom.post_boot.sh please so i may look.
 
If you can connect via adb push a blank file called CPU.sh to sdcard (adb push CPU.sh /sdcard)
Then (adb shell su
dd if=/sdcard/cpu.sh of=/system/su.d/cpu.sh)
And that should fix it. If not you'll have to use the exact same method in download mode. Send command doesn't seem to like rm -rf
 
If you can connect via adb push a blank file called CPU.sh to sdcard (adb push CPU.sh /sdcard)
Then (adb shell su
dd if=/sdcard/cpu.sh of=/system/su.d/cpu.sh)
And that should fix it. If not you'll have to use the exact same method in download mode. Send command doesn't seem to like rm -rf

could i do it with the external SD?
 
If you can connect via adb push a blank file called CPU.sh to sdcard (adb push CPU.sh /sdcard)
Then (adb shell su
dd if=/sdcard/cpu.sh of=/system/su.d/cpu.sh)
And that should fix it. If not you'll have to use the exact same method in download mode. Send command doesn't seem to like rm -rf

i got
hokage_6th@Asus-X551MA:~/Downloads$ dd if=/sdcard/cpu.sh of=/system/su.d/cpu.sh
dd: failed to open ‘/sdcard/cpu.sh’: No such file or directory
 
Have to use external if in download mode. Otherwise you need to create the blank file in the root of your internal.
I think the path is /storage/external_SD or /storage/sdcard1 for cm for sd
 
Have to use external if in download mode. Otherwise you need to create the blank file in the root of your internal.
I think the path is /storage/external_SD or /storage/sdcard1 for cm for sd

well i unbricked it but I’m still having a hard time figuring out how....well now I’m unrooted and I’m gonna have to figure out my own root process but in Ubuntu 15.04 wish me luck
 
well i unbricked it but I’m still having a hard time figuring out how....well now I’m unrooted and I’m gonna have to figure out my own root process but in Ubuntu 15.04 wish me luck
Sorry about that, I should have checked the link first. The problem is media fire displayed the script but when you saved it, it saved a bunch of html as well. That's what bootlooped you. I updated the link again to something that shouldn't 404.
 
Sorry about that, I should have checked the link first. The problem is media fire displayed the script but when you saved it, it saved a bunch of html as well. That's what bootlooped you. I updated the link again to something that shouldn't 404.

okay so this is what i get when opening the script in Ubuntu

"#!/system/bin/sh

#enable zram
echo "536870912" > /sys/block/zram0/disksize
mkswap /dev/block/zram0
swapon /dev/block/zram0
echo "100" > /proc/sys/vm/swappiness

# HMP scheduler settings for 8916

echo "2" > /proc/sys/kernel/sched_window_stats_policy

# HMP scheduler load tracking settings

echo "5" > /proc/sys/kernel/sched_ravg_hist_size

# HMP Task packing settings for 8916

echo "50" > /proc/sys/kernel/sched_small_task
echo "50" > /sys/devices/system/cpu/cpu0/sched_mostly_idle_load
echo "10" > /sys/devices/system/cpu/cpu0/sched_mostly_idle_nr_run


# apply gov settings
# disable thermal core_control to update scaling_min_freq

echo "0" > /sys/module/msm_thermal/core_control/enabled
echo "1" > /sys/devices/system/cpu/cpu0/online
echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

# causes perms error
# echo "1" > /sys/devices/system/cpu/cpu0/rq-stats/hotplug_disable

echo "200000" > /sys/devices/system/cpu/cpu0/sched_mostly_idle_freq
echo "200000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo "998400" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

# enable thermal core_control now

echo "1" > /sys/module/msm_thermal/core_control/enabled
echo "80000 998400:60000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo "99" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo "130000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo "200000" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo "0" > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
echo "1 200000:85 200000:90 200000:80" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo "150000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo "0" > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
echo "20000" > /sys/devices/system/cpu/cpufreq/interactive/max_freq_hysteresis
echo "1" > /sys/devices/system/cpu/cpufreq/interactive/use_sched_load
echo "1" > /sys/devices/system/cpu/cpufreq/interactive/align_windows
echo "1" > /sys/devices/system/cpu/cpufreq/interactive/use_migration_notif
echo "3" > /sys/devices/system/cpu/cpufreq/interactive/boost
echo "10000" > /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
echo "180000" > /sys/devices/system/cpu/cpufreq/interactive/timer_slack

# sdtweaks

echo "deadline" > /sys/block/mmcblk0/queue/scheduler
echo "deadline" > /sys/block/mmcblk1/queue/scheduler
echo "2048" > /sys/block/mmcblk0/queue/read_ahead_kb
echo "2048" > /sys/block/mmcblk1/queue/read_ahead_kb"

does that ^^^^ look correct?
 
Back
Top Bottom