Guest User

Untitled

a guest
Jan 20th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.98 KB | None | 0 0
  1. #!/system/bin/sh
  2.  
  3. sleep 30
  4. echo "Start workingÉ"
  5. PERSEUS_TWEAKS()
  6. {
  7.  
  8. # Set GPU Clock
  9. #---------------
  10. # Modifica le frequenze di lavoro della GPU
  11.  
  12. #Customize the following 4 lines for GPU_CLOCK
  13.  
  14. GPU_STEP_LOW=54
  15. GPU_STEP_MIDDLE=160
  16. GPU_STEP_HIGH=350
  17. GPU_STEP_END=533
  18. GPU_STEP_UP=700
  19.  
  20. # CLOCK INFO:
  21. # 54, 108, 160, 200, 266, 275, 300, 333, 350, 400, 440, 500, 533, 600, 640, 666, 700 Mhz are valid frequencies
  22. # 160, 266, 350, 440 are stock/default
  23.  
  24. if [ -e /sys/class/misc/gpu_clock_control/gpu_control ];
  25. then
  26. echo "Previous clock settings:"
  27. cat /sys/class/misc/gpu_clock_control/gpu_control
  28. echo "$GPU_STEP_LOW $GPU_STEP_MIDDLE $GPU_STEP_HIGH $GPU_STEP_END $GPU_STEP_UP" > /sys/class/misc/gpu_clock_control/gpu_control
  29. echo "New clock settings:"
  30. cat /sys/class/misc/gpu_clock_control/gpu_control
  31. fi;
  32.  
  33. # --------------------------GPU Voltage------------------------------
  34.  
  35. # Set GPU Voltage
  36. #---------------
  37. # Modifica le frequenze di lavoro della GPU
  38.  
  39. #Customize the following 4 lines for GPU_VOLT
  40.  
  41. GPU_VOLT_LOW=800000
  42. GPU_VOLT_MIDDLE=825000
  43. GPU_VOLT_HIGH=925000
  44. GPU_VOLT_END=1000000
  45. GPU_VOLT_UP=1075000
  46.  
  47. # GPU VOLTAGE INFO:
  48. # GPU Voltage in script are default
  49.  
  50. echo "Previous voltage settings:"
  51. cat /sys/class/misc/gpu_voltage_control/gpu_control
  52. echo "$GPU_VOLT_LOW $GPU_VOLT_MIDDLE $GPU_VOLT_HIGH $GPU_VOLT_END $GPU_VOLT_UP" > /sys/class/misc/gpu_voltage_control/gpu_control
  53. echo "New voltage settings:"
  54. cat /sys/class/misc/gpu_voltage_control/gpu_control
  55.  
  56. # ------------------------------Undervolt------------------------------
  57. #UV_BEGIN#
  58. # CPU Voltage Modify
  59. # Modifica voltaggio per ogni frequenza (1500 max, 750 min)
  60.  
  61. echo "Set UV"
  62. echo "1300 1300 1275 1213 1175 1138 1075 1025 975 925 875 863 850 838 825 800 800" > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table
  63.  
  64. #UV_END
  65. }
  66.  
  67. #saját cuccok
  68. FILE_NAME=S86halaszk;
  69.  
  70. # default settings (1000 = 10 seconds)
  71. dirty_expire_centisecs_default=1000;
  72. dirty_writeback_centisecs_default=1000;
  73.  
  74. # battery settings
  75. dirty_expire_centisecs_battery=0;
  76. dirty_writeback_centisecs_battery=0;
  77.  
  78. # =========
  79. # Renice - kernel thread responsible for managing the swap memory and logs
  80. # =========
  81. renice 15 -p `pidof kswapd0`;
  82. renice 15 -p `pgrep logcat`;
  83.  
  84. # ==============================================================
  85. # I/O-TWEAKS
  86. # ==============================================================
  87. IO_TWEAKS()
  88. {
  89. MMC=`ls -d /sys/block/mmc*`;
  90. ZRM=`ls -d /sys/block/zram*`;
  91.  
  92. for z in $ZRM; do
  93.  
  94. if [ -e $i/queue/rotational ]; then
  95. echo "0" > $i/queue/rotational;
  96. fi;
  97.  
  98. if [ -e $i/queue/iostats ]; then
  99. echo "0" > $i/queue/iostats;
  100. fi;
  101.  
  102. if [ -e $i/queue/rq_affinity ]; then
  103. echo "1" > $i/queue/rq_affinity;
  104. fi;
  105.  
  106. if [ -e $i/queue/read_ahead_kb ]; then
  107. echo "512" > $i/queue/read_ahead_kb;
  108. fi;
  109.  
  110. if [ -e $i/queue/max_sectors_kb ]; then
  111. echo "512" > $i/queue/max_sectors_kb; # default: 127
  112. fi;
  113.  
  114. done;
  115.  
  116. for i in $MMC; do
  117.  
  118. if [ -e $i/queue/scheduler ]; then
  119. echo $scheduler > $i/queue/scheduler;
  120. fi;
  121.  
  122. if [ -e $i/queue/rotational ]; then
  123. echo "0" > $i/queue/rotational;
  124. fi;
  125.  
  126. if [ -e $i/queue/iostats ]; then
  127. echo "0" > $i/queue/iostats;
  128. fi;
  129.  
  130. if [ -e $i/queue/read_ahead_kb ]; then
  131. echo "2048" > $i/queue/read_ahead_kb; # default: 128
  132. fi;
  133.  
  134. if [ -e $i/queue/max_sectors_kb ]; then
  135. echo "512" > $i/queue/max_sectors_kb; # default: 512
  136. fi;
  137.  
  138. if [ -e $i/queue/nr_requests ]; then
  139. echo "64" > $i/queue/nr_requests; # default: 128
  140. fi;
  141.  
  142. if [ -e $i/queue/iosched/writes_starved ]; then
  143. echo "1" > $i/queue/iosched/writes_starved;
  144. fi;
  145.  
  146. if [ -e $i/queue/iosched/back_seek_max ]; then
  147. echo "16384" > $i/queue/iosched/back_seek_max; # default: 16384
  148. fi;
  149.  
  150. if [ -e $i/queue/iosched/max_budget_async_rq ]; then
  151. echo "2" > $i/queue/iosched/max_budget_async_rq; # default: 4
  152. fi;
  153.  
  154. if [ -e $i/queue/iosched/back_seek_penalty ]; then
  155. echo "1" > $i/queue/iosched/back_seek_penalty; # default: 2
  156. fi;
  157.  
  158. if [ -e $i/queue/iosched/fifo_expire_sync ]; then
  159. echo "125" > $i/queue/iosched/fifo_expire_sync; # default: 125
  160. fi;
  161.  
  162. if [ -e $i/queue/iosched/fifo_expire_async ]; then
  163. echo "250" > $i/queue/iosched/fifo_expire_async; # default: 250
  164. fi;
  165.  
  166. if [ -e $i/queue/iosched/timeout_async ]; then
  167. echo "2" > $i/queue/iosched/timeout_async; # default: HZ / 25
  168. fi;
  169.  
  170. if [ -e $i/queue/iosched/slice_idle ]; then
  171. echo "2" > $i/queue/iosched/slice_idle; # default: 8
  172. fi;
  173.  
  174. if [ -e $i/queue/iosched/quantum ]; then
  175. echo "8" > $i/queue/iosched/quantum; # default: 4
  176. fi;
  177.  
  178. if [ -e $i/queue/iosched/slice_async_rq ]; then
  179. echo "2" > $i/queue/iosched/slice_async_rq; # default: 2
  180. fi;
  181.  
  182. if [ -e $i/queue/iosched/fifo_batch ]; then
  183. echo "1" > $i/queue/iosched/fifo_batch;
  184. fi;
  185.  
  186. if [ -e $i/queue/iosched/rev_penalty ]; then
  187. echo "1" > $i/queue/iosched/rev_penalty;
  188. fi;
  189.  
  190. if [ -e $i/queue/iosched/low_latency ]; then
  191. echo "1" > $i/queue/iosched/low_latency;
  192. fi;
  193.  
  194. done;
  195.  
  196. if [ -e /sys/devices/virtual/bdi/default/read_ahead_kb ]; then
  197. echo "2048" > /sys/devices/virtual/bdi/default/read_ahead_kb;
  198. fi;
  199.  
  200. SDCARDREADAHEAD=`ls -d /sys/devices/virtual/bdi/179*`;
  201. for i in $SDCARDREADAHEAD; do
  202. echo "2048" > $i/read_ahead_kb;
  203. done;
  204.  
  205. echo "15" > /proc/sys/fs/lease-break-time;
  206.  
  207. log -p i -t $FILE_NAME "*** filesystem tweaks ***: enabled";
  208. }
  209.  
  210. KERNEL_TWEAKS()
  211. {
  212. echo "1" > /proc/sys/vm/oom_kill_allocating_task;
  213. sysctl -w vm.panic_on_oom=0;
  214.  
  215. log -p i -t $FILE_NAME "*** kernel tweaks ***: enabled";
  216. }
  217.  
  218. SYSTEM_TWEAKS()
  219. {
  220. # enable Hardware Rendering
  221. setprop video.accelerate.hw 1;
  222. setprop debug.performance.tuning 1;
  223. setprop debug.sf.hw 1;
  224. setprop persist.sys.use_dithering 1;
  225. #setprop persist.sys.ui.hw true; # ->reported as problem maker in some roms.
  226.  
  227. # render UI with GPU
  228. setprop hwui.render_dirty_regions false;
  229. setprop windowsmgr.max_events_per_sec 120;
  230. setprop profiler.force_disable_err_rpt 1;
  231. setprop profiler.force_disable_ulog 1;
  232.  
  233. # Proximity tweak
  234. setprop mot.proximity.delay 15;
  235.  
  236. # more Tweaks
  237. setprop dalvik.vm.execution-mode int:jit;
  238. setprop persist.adb.notify 0;
  239. setprop pm.sleep_mode 1;
  240.  
  241. if [ "`getprop dalvik.vm.heapsize | sed 's/m//g'`" -lt 120 ]; then
  242. setprop dalvik.vm.heapsize 128m
  243. fi;
  244.  
  245. log -p i -t $FILE_NAME "*** system tweaks ***: enabled";
  246. }
  247.  
  248. CPU_GOV_TWEAKS()
  249. {
  250. SYSTEM_GOVERNOR=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor`;
  251.  
  252. if [ $SYSTEM_GOVERNOR == "abyssplug" ]; then
  253. echo "70000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate;
  254. echo "5" > /sys/devices/system/cpu/cpufreq/ondemand/hotplug_in_sampling_periods;
  255. echo "15" > /sys/devices/system/cpu/cpufreq/ondemand/hotplug_out_sampling_periods;
  256. echo "5" > /sys/devices/system/cpu/cpufreq/abyssplug/down_differential;
  257. echo "50" > /sys/devices/system/cpu/cpufreq/abyssplug/down_threshold;
  258. echo "80" > /sys/devices/system/cpu/cpufreq/abyssplug/up_threshold;
  259. fi;
  260.  
  261. if [ $SYSTEM_GOVERNOR == "pegasusq" ]; then
  262. echo "80000" > /sys/devices/system/cpu/cpufreq/pegasusq/sampling_rate;
  263. echo "80" > /sys/devices/system/cpu/cpufreq/pegasusq/up_threshold;
  264. echo "2" > /sys/devices/system/cpu/cpufreq/pegasusq/sampling_down_factor;
  265. echo "5" > /sys/devices/system/cpu/cpufreq/pegasusq/down_differential;
  266. echo "30" > /sys/devices/system/cpu/cpufreq/pegasusq/freq_step;
  267. echo "80" > /sys/devices/system/cpu/cpufreq/pegasusq/up_threshold_at_min_freq;
  268. echo "200000" > /sys/devices/system/cpu/cpufreq/pegasusq/freq_for_responsiveness;
  269. echo "0" > /sys/devices/system/cpu/cpufreq/pegasusq/max_cpu_lock;
  270. echo "0" > /sys/devices/system/cpu/cpufreq/pegasusq/dvfs debug;
  271. echo "0" > /sys/devices/system/cpu/cpufreq/pegasusq/hotplug_lock;
  272. echo 500000 > /sys/devices/system/cpu/cpufreq/pegasusq/hotplug_freq_1_1
  273. echo 200000 > /sys/devices/system/cpu/cpufreq/pegasusq/hotplug_freq_2_0
  274. echo 500000 > /sys/devices/system/cpu/cpufreq/pegasusq/hotplug_freq_2_1
  275. echo 400000 > /sys/devices/system/cpu/cpufreq/pegasusq/hotplug_freq_3_0
  276. echo 800000 > /sys/devices/system/cpu/cpufreq/pegasusq/hotplug_freq_3_1
  277. echo 500000 > /sys/devices/system/cpu/cpufreq/pegasusq/hotplug_freq_4_0
  278. echo 150 > /sys/devices/system/cpu/cpufreq/pegasusq/hotplug_rq_1_1
  279. echo 150 > /sys/devices/system/cpu/cpufreq/pegasusq/hotplug_rq_2_0
  280. echo 250 > /sys/devices/system/cpu/cpufreq/pegasusq/hotplug_rq_2_1
  281. echo 300 > /sys/devices/system/cpu/cpufreq/pegasusq/hotplug_rq_3_0
  282. echo 400 > /sys/devices/system/cpu/cpufreq/pegasusq/hotplug_rq_3_1
  283. echo 400 > /sys/devices/system/cpu/cpufreq/pegasusq/hotplug_rq_4_0
  284. fi;
  285. }
  286.  
  287. MEMORY_TWEAKS()
  288. {
  289. echo "$dirty_expire_centisecs_default" > /proc/sys/vm/dirty_expire_centisecs;
  290. echo "$dirty_writeback_centisecs_default" > /proc/sys/vm/dirty_writeback_centisecs;
  291. echo "15" > /proc/sys/vm/dirty_background_ratio; # default: 10
  292. echo "20" > /proc/sys/vm/dirty_ratio; # default: 20
  293. echo "4" > /proc/sys/vm/min_free_order_shift; # default: 4
  294. echo "0" > /proc/sys/vm/overcommit_memory; # default: 0
  295. echo "1000" > /proc/sys/vm/overcommit_ratio; # default: 50
  296. echo "128 128" > /proc/sys/vm/lowmem_reserve_ratio;
  297. echo "3" > /proc/sys/vm/page-cluster; # default: 3
  298. echo "4096" > /proc/sys/vm/min_free_kbytes
  299. echo "65530" > /proc/sys/vm/max_map_count;
  300. echo "250 32000 32 128" > /proc/sys/kernel/sem; # default: 250 32000 32 128
  301.  
  302. log -p i -t $FILE_NAME "*** memory tweaks ***: enabled";
  303. }
  304.  
  305. OTHER_TWEAKS(){
  306.  
  307. # enable NMI Watchdog to detect hangs
  308. if [ -e /proc/sys/kernel/nmi_watchdog ]; then
  309. echo "1" > /proc/sys/kernel/nmi_watchdog;
  310. fi;
  311.  
  312. # fs settings
  313. echo "25" > /proc/sys/vm/vfs_cache_pressure;
  314.  
  315. # process priority modifications
  316. (
  317. for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20;do
  318. sleep 5;
  319. renice 15 `pidof kswapd0`;
  320. renice 3 `pidof android.process.acore`;
  321. renice 3 `pidof android.process.media`;
  322. renice -10 `pidof com.sec.android.app.launcher`;
  323. renice -10 `pidof com.anddoes.launcher`;
  324. renice -10 `pidof com.teslacoilsw.launcher`;
  325. renice -10 `pidof com.sec.android.inputmethod`;
  326. renice -10 `pidof com.cootek.smartinputv5`;
  327. renice -10 `pidof com.swype.android.inputmethod`;
  328. done;
  329. )&
  330. }
  331. #és akkor alkalmazzuk a beállításokat
  332.  
  333. PERSEUS_TWEAKS;
  334. IO_TWEAKS;
  335. KERNEL_TWEAKS;
  336. SYSTEM_TWEAKS;
  337. CPU_GOV_TWEAKS;
  338. MEMORY_TWEAKS;
  339. OTHER_TWEAKS;
Add Comment
Please, Sign In to add comment