Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,737,925 Members 52,775 Now Online
XDA Developers Android and Mobile Development Forum

Init.d scripts

Tip us?
 
stevehkim
Old
(Last edited by stevehkim; 1st February 2012 at 03:14 PM.)
#1  
Senior Member - OP
Thanks Meter 751
Posts: 2,790
Join Date: Oct 2011
Default Init.d scripts

Here are the init.d scripts that I have been using for Siyah. Please note that 95% of the scripts were done by Pikachu's thunderbolt scripts and I have modified then to my liking. Thanks to Pikachu for the hard work he has put in for the developement of our devices. For those that will use these scripts please use them with caution! I am not responsible for any damage done to your phone! You are free to use these as you wish, adjust them to your liking. The s70darkyzipalign, s98cfs, s98systemtweak should be universal for all setups and you do not need to adjust these init.d scripts. The one you need to be aware of is the s98bolt1 and screenstate_scaling script. The s98bolt1 script has cpu freq. steps set at max 1504 min 100. Scaling @ max 1304 min 200. The voltages for these steps are pretty aggressive and may not work for your device so please PLEASE adjust them accordingly. This script will also set ondemand/sio as default. You can replace those as you wish. GPU is set for 40, 133, 267mhz. (Andreilux's settings, Thanks Andrei) Sched_mc and AFTR have been enabled for some extra power saving.

Screenstate_scaling have been modified to set as Ondemand as wake governer and Powersave as sleep governer. You can adjust these as well. The scripts are pretty self explantory and you can adjust these values using root explorer and using the menu in root explorer to "open in text editor". Or you can you wordpad or notepad++ on your pc and adjust them. Save the scripts to your phone. Using root explorer copy the init.d scripts to /etc/init.d. Paste in this directory and set permissions as rwx,rwx,rwx and reboot.

I am sure I missed some things as I'm kind of in a hurry. Please pm me if you have any questions or need help. I have used this setup for quite some time now without any problems. Battery life has been amazing without sacrificing performance. Oh please do not use VC to save boot settings as these will clash. Everything in the init.d scripts will do the same as VC as long as you adjust them accordingly. Good luck and happy flashing/modding!
P.S. After downloading the file remove the .txt extension in the files before using. Thanks!

Here is the link to the Originator and Creator of these awesome scripts. Thanks Pikachu!

http://forum.xda-developers.com/show...php?p=18285859

Attached Files
File Type: txt S70darky_zipalign.txt - [Click for QR Code] (1.4 KB, 1135 views)
File Type: txt s98bolt1.txt - [Click for QR Code] (1.9 KB, 963 views)
File Type: txt S98CFS.txt - [Click for QR Code] (503 Bytes, 695 views)
File Type: txt S98screenstate_scaling.txt - [Click for QR Code] (34.1 KB, 873 views)
File Type: txt S98system_tweak.txt - [Click for QR Code] (33.0 KB, 1485 views)
JKay Framework
Xposed
S4 Golden Eye Rom
The Following 7 Users Say Thank You to stevehkim For This Useful Post: [ Click to Expand ]
 
moustro
Old
(Last edited by moustro; 30th January 2012 at 06:37 PM.)
#2  
Senior Member
Thanks Meter 138
Posts: 415
Join Date: May 2011
Location: OKC
I just want to make sure before I utilize these. I need to use a file manager to place these in /etc/unit.d folder without the .txt correct?

Should I remove the existing scripts as well?

Edit: do these scripts completely take the place of voltage control and setcpu? I wanted to get all of my questions out of the way
 
Alucardis666
Old
#3  
Alucardis666's Avatar
Senior Member
Thanks Meter 229
Posts: 1,942
Join Date: Jul 2009
Location: Miramar
These seem awesome. Can't wait to try them out :)



If anything in this post helped or amused you, please hit the thanks button.


Nexus 5 32GB Black on AT&T + Spigen NeoHybrid Slate
Macbook Pro 13" Retina 512GB Haswell [Fall 2013]
Retina iPad Mini 32GB Space Grey with Apple Black Leather Smart Case
 
stevehkim
Old
#4  
Senior Member - OP
Thanks Meter 751
Posts: 2,790
Join Date: Oct 2011
Quote:
Originally Posted by moustro View Post
I just want to make sure before I utilize these. I need to use a file manager to place these in /etc/unit.d folder without the .txt correct?

Should I remove the existing scripts as well?

Edit: do these scripts completely take the place of voltage control and setcpu? I wanted to get all of my questions out of the way
Everything you posted is correct. Please keep in mind the voltage settings are a little extreme. If you think or know your phone can handle the UV then just drop them in without modifying. But if you're not sure add +25 mv to each step.
JKay Framework
Xposed
S4 Golden Eye Rom
 
stevehkim
Old
#5  
Senior Member - OP
Thanks Meter 751
Posts: 2,790
Join Date: Oct 2011
I almost gaurantee your phone will sleep like a baby. And fly like the wind when in use.
JKay Framework
Xposed
S4 Golden Eye Rom
 
Bethrezen1453
Old
(Last edited by Bethrezen1453; 30th January 2012 at 07:05 PM.)
#6  
Member
Thanks Meter 9
Posts: 80
Join Date: Jan 2012
Location: São Paulo
Thanks for the scripts!

I've also found an interesting script at 9100 Siyah Kernel topic ( http://forum.xda-developers.com/show...3838&page=1813 )

I got sleep of death by using below script so you may want to check voltages setting before using it.

Code:
Select Code
#!/system/bin/sh

# ******************
# 1°) I/O Schedulers
# ******************

# Set i/o scheduler (Valid values are: noop, deadline, cfq, bfq, sio, vr, anticipatory)
echo bfq > /sys/block/mmcblk0/queue/scheduler;


# ************************************************
# 2°) Scaling Governor & Smooth Scaling Parameters
# ************************************************

# Set scaling governor, according to available governors in your kernel
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor;

# Smooth scaling parameters to control any governor jumping to higher frequency directly.
echo 2 > /sys/devices/system/cpu/cpu0/cpufreq/smooth_target;
echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/smooth_offset;
echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/smooth_step;


# ****************************************************************
# 3°) Deepsleep Levels
#     cpulevel = 4 (100Mhz - 800Mhz, default), 5 (100Mhz - 500Mhz)
#     buslevel = 0 (400MHz, default), 1 (266MHz), 2 (133MHz)
# ****************************************************************

# Set deep sleep frequency & bus speed: 
echo 5 > /sys/devices/system/cpu/cpu0/cpufreq/deepsleep_cpulevel;
echo 2 > /sys/devices/system/cpu/cpu0/cpufreq/deepsleep_buslevel;


# ****************************
# 4°) CPU Frequency & Voltages
# ****************************

# Set frequency steps according to the number of steps in your kernel.
echo "1600 1400 1200 1000 800 500 200 100" > /sys/devices/system/cpu/cpu0/cpufreq/freq_table;

# Set voltages for frequency steps. Changes possible at +/-25mV steps
echo "1350 1275 1150 1050 950 900 850 800" > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table;

# Sets global scaling min&max frequencies as 100 and 1000 mhz
echo 100000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq;
echo 1200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;


# ************************************
# 5°) GPU Clock, Voltages & Thresholds
# ************************************

# Set GPU clocks (Valid values are: 100 114 133 160 200 267 300 400 )
echo "40 133 267" > /sys/class/misc/gpu_clock_control/gpu_control;

# Set GPU Up and Down thresholds
echo "90% 25% 90% 45%" > /sys/class/misc/gpu_clock_control/gpu_control;

# Set GPU voltages (Changes possible at +/-50mV ie at 50000 steps)
echo "850000 900000 950000" > /sys/class/misc/gpu_voltage_control/gpu_control;


# ======================================================
# 6°) Hot Plug Thresholds, Sampling Interval & Frequency
# ======================================================

# Set second core kick-in threshold for screen-on state
echo 35 > /sys/module/pm_hotplug/parameters/loadl;
echo 80 > /sys/module/pm_hotplug/parameters/loadh;

# Set second core kick-in threshold for screen-off state
echo 90 > /sys/module/pm_hotplug/parameters/loadl_scroff;
echo 100 > /sys/module/pm_hotplug/parameters/loadh_scroff;

# Set hot plug sampling intervals for screen-on state
echo 400 > /sys/module/pm_hotplug/parameters/rate;
echo 400 > /sys/module/pm_hotplug/parameters/rate_cpuon;

# Set hot plug sampling intervals for screen-off state 
echo 1000 > /sys/module/pm_hotplug/parameters/rate_scroff;

# Set frequency below which second core will not be turned on, regardless of thresholds.
echo 524288 > /sys/module/pm_hotplug/parameters/freq_cpu1on;


# ===================
# 7°) Bus Frequencies
# ===================

# Set bus frequencies for highest-to-lowest cpu frequencies and enable static bus frequency scaling
#echo "0 0 0 1 1 2 2 2" > /sys/devices/system/cpu/cpu0/cpufreq/busfreq_static;
#echo enabled > /sys/devices/system/cpu/cpu0/cpufreq/busfreq_static;


# ====================================
# 8°) Schedule Multi Core & Idle Modes
# ====================================

# Enable sched_mc
echo 1 > /sys/devices/system/cpu/sched_mc_power_savings;

# Enable AFTR
echo 3 > /sys/module/cpuidle/parameters/enable_mask;


# =============================
# 9°) Brightness Curve Settings
# =============================

# Brightness settings (Possible values for min_bl = 0 to 255 | min_gamma = 0 to 24 | max_gamma = 0 to 24)
echo 20 > /sys/class/misc/brightness_curve/min_bl;
echo 1 > /sys/class/misc/brightness_curve/min_gamma;
echo 24 > /sys/class/misc/brightness_curve/max_gamma;

# =================================
# 10°) Touch Sensitivity Parameters
# =================================

# Set touch sensitivity (Possible values are between 40 to 80. Lower value = higher sensitivity)
echo 40 > /sys/devices/virtual/sec/sec_touchscreen/tsp_threshold;

# ===================
# 11°) Charge Current
# ===================

# Set AC, Misc & USB charge current (Do not set Ac & Misc more than 1000mA or Usb more than 450)
echo "950 950 450" > /sys/devices/virtual/misc/charge_current/charge_current;

# =======================================
# 12°) Switch Hotplug/DualCore/SingleCore
# =======================================

# Set Dynamic hotplug mode
echo on > /sys/devices/virtual/misc/second_core/hotplug_on;
echo on > /sys/devices/virtual/misc/second_core/second_core_on;


# ===================
# 13°) Disable logger
# ===================

if [ ! -d /data/.siyah ];
then
  mkdir /data/.siyah;
  chmod 777 /data/.siyah;
fi;
touch /data/.siyah/disable-logger;


# ====================
# 14°) Graphic tunings
# ====================

setprop debug.sf.hw 1;  # HARDWARE RENDERING (GPU) 
setprop video.accelerate.hw 1;
setprop debug.performance.tuning 1;
 
stevehkim
Old
#7  
Senior Member - OP
Thanks Meter 751
Posts: 2,790
Join Date: Oct 2011
# Set deep sleep frequency & bus speed:
echo 5 > /sys/devices/system/cpu/cpu0/cpufreq/deepsleep_cpulevel;
echo 2 > /sys/devices/system/cpu/cpu0/cpufreq/deepsleep_buslevel;

See the echo 5, change that to 4. And your SOD's will be gone!!
JKay Framework
Xposed
S4 Golden Eye Rom
 
moustro
Old
#8  
Senior Member
Thanks Meter 138
Posts: 415
Join Date: May 2011
Location: OKC
Steve you are the man! Thank you for bundling these scripts all in one place. Everything is smooth and my phone is sleeping like a baby so far.
 
desiromeo719
Old
#9  
Senior Member
Thanks Meter 99
Posts: 447
Join Date: Oct 2011
Location: NJ
Quote:
Originally Posted by moustro View Post
Steve you are the man! Thank you for bundling these scripts all in one place. Everything is smooth and my phone is sleeping like a baby so far.
What ROM are you using?

Can these scripts be used on Unnamed?
Phone: Nexus 4 (16GB)
ROM: Mahdi rom
Kernel: Franco Sabermod r209
Theme: Atomic Green
Recovery: TWRP Multirom
Radio: .03
 
tdamocles
Old
#10  
Senior Member
Thanks Meter 69
Posts: 765
Join Date: Aug 2009
Unit.d generator in the i9100 forum works great for this.

Must script manager be used to give these scripts root access to work?

Sent from my i777.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes