Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/system/bin/sh
- #
- # Device : Xiaomi Redmi Note 3 Pro (kenzo)
- # Android Version : CyanogenMod 13.1 (Android 6.0.1-MOB30M)
- # Tweaks & Mods : MOVZX (http://forum.xda-developers.com/member.php?u=4460588)
- #
- #
- # I'm using non-generic busybox binary which is specifically build for arm64, because I need fstrim and some other commands.
- # I also enabled init.d support by editing /system/etc/init.qcom.post_boot.sh, adding this (below) command to the last line of the file (init.qcom.post_boot.sh) to enable init.d:
- #
- # busybox run-parts /system/etc/init.d
- #
- # So, to fully install busybox into the system, I run this install command (after mounting /system partition to rw: mount -o remount,rw /system) via ADB:
- #
- # /system/xbin/busybox --install /system/xbin
- #
- # This is my personal tweaks for every ROM/Kernel made for Xiaomi Redmi Note 3 Pro (kenzo), I prefer my phone to run fast but also still maintaining better battery life.
- #
- # Definitions
- CPU_LITTLE_CLUSTER=`ls -d /sys/devices/system/cpu/cpu0`;
- CPU_BIG_CLUSTER=`ls -d /sys/devices/system/cpu/cpu4`;
- CPU_LITTLE_CLUSTER_FREQ=`ls -d /sys/devices/system/cpu/cpu0/cpufreq`;
- CPU_BIG_CLUSTER_FREQ=`ls -d /sys/devices/system/cpu/cpu4/cpufreq`;
- VIRTUAL_MEMORY=`ls -d /proc/sys/vm`;
- IO_SCHEDULER=`ls -d /sys/block/mmcblk0/queue`;
- KERNEL=`ls -d /proc/sys/kernel`;
- LMK=`ls -d /sys/module/lowmemorykiller/parameters`;
- KSM=`ls -d /sys/kernel/mm/ksm`;
- NETWORKING=`ls -d /proc/sys/net/ipv4`;
- LOG_FILE="/sdcard/MyPersonalTweaks.log";
- # Logging
- if [ -e $LOG_FILE ]; then
- rm $LOG_FILE;
- fi;
- echo "Starting Metal Droid Tweaks at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
- echo "" | tee -a $LOG_FILE;
- # CPU Tweaks
- echo "CPU Tweaks" | tee -a $LOG_FILE;
- #
- # Disable Core Control
- echo " Disable Core Control" | tee -a $LOG_FILE;
- #
- echo "0" > /sys/module/msm_thermal/core_control/enabled;
- for mode in /sys/devices/soc.0/qcom,bcl.*/mode; do
- echo -n disable > $mode;
- done
- for hotplug_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_mask; do
- bcl_hotplug_mask=`cat $hotplug_mask`;
- echo "0" > $hotplug_mask;
- done
- for hotplug_soc_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_soc_mask; do
- bcl_soc_hotplug_mask=`cat $hotplug_soc_mask`;
- echo "0" > $hotplug_soc_mask;
- done
- for mode in /sys/devices/soc.0/qcom,bcl.*/mode; do
- echo -n enable > $mode;
- done
- #
- # Little
- echo " Set CPU Little Cluster" | tee -a $LOG_FILE;
- #
- for l in $CPU_LITTLE_CLUSTER; do
- # CPU idle load threshold
- echo "30" > $l/sched_mostly_idle_load;
- # CPU idle nr run threshold
- echo "3" > $l/sched_mostly_idle_nr_run;
- # CPU prefer idle
- echo "0" > $l/sched_prefer_idle;
- # Enable sched guided freq control
- echo "1" > $l/cpufreq/interactive/use_sched_load;
- echo "1" > $l/cpufreq/interactive/use_migration_notif;
- done
- for l in $CPU_LITTLE_CLUSTER_FREQ; do
- echo "interactive" > $l/scaling_governor;
- echo "400000" > $l/scaling_min_freq;
- echo "99 400000:75 691200:80 806400:85 1017600:90 1305600:95 1401600:99" > $l/interactive/target_loads;
- echo "10000" > $l/interactive/above_hispeed_delay;
- echo "691200" > $l/interactive/hispeed_freq;
- echo "99" > $l/interactive/go_hispeed_load;
- echo "10000" > $l/interactive/timer_rate;
- echo "10000" > $l/interactive/min_sample_time;
- echo "10000" > $l/interactive/timer_slack;
- echo "0" > $l/interactive/boost;
- echo "0" > $l/interactive/io_is_busy;
- echo "10000" > $l/interactive/max_freq_hysteresis;
- echo "10000" > $l/interactive/boostpulse_duration;
- done
- #
- # Big
- echo " Set CPU Big Cluster" | tee -a $LOG_FILE;
- #
- for b in $CPU_BIG_CLUSTER; do
- # CPU idle load threshold
- echo "50" > $b/sched_mostly_idle_load;
- # CPU idle nr run threshold
- echo "5" > $b/sched_mostly_idle_nr_run;
- # CPU prefer idle
- echo "0" > $b/sched_prefer_idle;
- # Enable sched guided freq control
- echo "1" > $b/cpufreq/interactive/use_sched_load;
- echo "1" > $b/cpufreq/interactive/use_migration_notif;
- done
- for b in $CPU_BIG_CLUSTER_FREQ; do
- echo "interactive" > $b/scaling_governor;
- echo "400000" > $b/scaling_min_freq;
- echo "99 400000:75 883200:80 1056000:85 1305600:90 1612800:95 1804800:99" > $b/interactive/target_loads;
- # echo "90 400000:41 883200:84 940800:85 998400:85 1056000:85 1113600:84 1190400:86 1248000:86 1305600:85 1382400:77 1612800:83 1747200:90" > $b/interactive/target_loads;
- echo "10000" > $b/interactive/above_hispeed_delay;
- echo "883200" > $b/interactive/hispeed_freq;
- echo "99" > $b/interactive/go_hispeed_load;
- echo "10000" > $b/interactive/timer_rate;
- echo "10000" > $b/interactive/min_sample_time;
- echo "10000" > $b/interactive/timer_slack;
- echo "0" > $b/interactive/boost;
- echo "0" > $b/interactive/io_is_busy;
- echo "10000" > $b/interactive/max_freq_hysteresis;
- echo "10000" > $b/interactive/boostpulse_duration;
- done
- #
- # Re-Enable Core Control
- echo " Re-Enable Core Control" | tee -a $LOG_FILE;
- #
- echo "1" > /sys/module/msm_thermal/core_control/enabled;
- for mode in /sys/devices/soc.0/qcom,bcl.*/mode; do
- echo -n disable > $mode;
- done
- for hotplug_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_mask; do
- echo $bcl_hotplug_mask > $hotplug_mask;
- done
- for hotplug_soc_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_soc_mask; do
- echo $bcl_soc_hotplug_mask > $hotplug_soc_mask;
- done
- for mode in /sys/devices/soc.0/qcom,bcl.*/mode; do
- echo -n enable > $mode;
- done
- # GPU Tweaks
- echo "GPU Tweaks" | tee -a $LOG_FILE;
- #
- # For battery life!
- echo "simple_ondemand" > /sys/class/kgsl/kgsl-3d0/devfreq/governor
- # VM Tweaks
- echo "VM Tweaks" | tee -a $LOG_FILE;
- #
- for v in $VIRTUAL_MEMORY; do
- echo "0" > $v/swappiness;
- echo "500" > $v/dirty_writeback_centisecs;
- echo "300" > $v/dirty_expire_centisecs;
- done
- # I/O Scheduler Tweaks
- echo "I/O Scheduler Tweaks" | tee -a $LOG_FILE;
- #
- for s in $IO_SCHEDULER; do
- # echo "noop" > $s/scheduler;
- echo "fiops" > $s/scheduler;
- echo "128" > $s/read_ahead_kb;
- done
- # Entropy Tweaks
- echo "Entropy Tweaks" | tee -a $LOG_FILE;
- #
- for e in $KERNEL; do
- echo "512" > $e/random/read_wakeup_threshold;
- echo "1024" > $e/random/write_wakeup_threshold;
- done
- # KSM Tweaks
- echo "KSM Tweaks" | tee -a $LOG_FILE;
- #
- for k in $KSM; do
- # I disabled KSM for battery life, also because I own XRN3Pro with 3GB of RAM, so Free-RAM is not a problem for me.
- echo "0" > $k/run;
- # echo "89" > $k/pages_to_scan;
- # echo "55" > $k/sleep_millisecs;
- done
- # Minfree Tweaks
- echo "Minfree Tweaks" | tee -a $LOG_FILE;
- #
- for m in $LMK; do
- echo "0,1,2,7,14,15" > $m/adj;
- echo "2560,4096,6144,7168,8192,9216" > $m/minfree;
- done
- # Networking Tweaks
- echo "Networking Tweaks" | tee -a $LOG_FILE;
- #
- for n in $NETWORKING; do
- echo "1" > $n/tcp_timestamps;
- echo "1" > $n/tcp_sack;
- echo "1" > $n/tcp_window_scaling;
- done
- # FSTrim
- echo "FSTrim" | tee -a $LOG_FILE;
- #
- echo " Trimming CACHE Partition" | tee -a $LOG_FILE;
- fstrim /cache;
- echo " Trimming CUST Partition" | tee -a $LOG_FILE;
- fstrim /cust;
- echo " Trimming DATA Partition" | tee -a $LOG_FILE;
- fstrim /data;
- echo " Trimming DSP Partition" | tee -a $LOG_FILE;
- fstrim /dsp;
- echo " Trimming PERSIST Partition" | tee -a $LOG_FILE;
- fstrim /persist;
- echo " Trimming SYSTEM Partition" | tee -a $LOG_FILE;
- fstrim /system;
- # Cleaning VM Cache
- echo "Cleaning VM Cache" | tee -a $LOG_FILE;
- #
- for v in $VIRTUAL_MEMORY; do
- sync;
- echo "3" > $v/drop_caches;
- sleep 1;
- echo "0" > $v/drop_caches;
- done
- echo "" | tee -a $LOG_FILE;
- echo "Metal Droid Tweaks finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
- echo "" | tee -a $LOG_FILE;
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement