Init.d scripts

Search This thread

stevehkim

Senior Member
Oct 29, 2011
2,840
743
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://xdaforums.com/showthread.php?p=18285859

PHP:
 

Attachments

  • S70darky_zipalign.txt
    1.4 KB · Views: 1,344
  • s98bolt1.txt
    1.9 KB · Views: 1,157
  • S98CFS.txt
    503 bytes · Views: 869
  • S98screenstate_scaling.txt
    34.1 KB · Views: 1,110
  • S98system_tweak.txt
    33 KB · Views: 1,766
Last edited:

moustro

Senior Member
May 26, 2011
419
136
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
 
Last edited:

stevehkim

Senior Member
Oct 29, 2011
2,840
743
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.
 

stevehkim

Senior Member
Oct 29, 2011
2,840
743
I almost gaurantee your phone will sleep like a baby. And fly like the wind when in use.
 

Bethrezen1453

Senior Member
Jan 19, 2012
81
10
São Paulo
Thanks for the scripts!

I've also found an interesting script at 9100 Siyah Kernel topic ( http://xdaforums.com/showthread.php?t=1263838&page=1813 )

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

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;
 
Last edited:

stevehkim

Senior Member
Oct 29, 2011
2,840
743
# 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!!
 

moustro

Senior Member
May 26, 2011
419
136
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.
 

tdamocles

Senior Member
Aug 11, 2009
2,044
240
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.
 

stevehkim

Senior Member
Oct 29, 2011
2,840
743
Sorry guys for the late reply. Busy at work. Yes these scripts are universal for any ROM. Just make sure your kernel supports init.d. Siyah and Entropy both support them.
 

Entropy512

Senior Recognized Developer
Aug 31, 2007
14,088
25,086
Owego, NY
Miui 2.1.13

I believe these scripts are universal and can run on siyah or entropy dd. Can someone else confirm this?

No, some of them depend on tunables in Siyah I haven't ported over yet.

Personally, I would not recommend putting voltage settings in a script that you distribute to the public, as voltages are device-unique.

I'm also a firm believer in a number of small separate scripts with descriptive names, instead of a "megascript" that does it all - harder to analyze and harder to pick and choose.

I'll take a look at the specific script contents when I have some time.
 

stevehkim

Senior Member
Oct 29, 2011
2,840
743
thx for clarifying entropy. i did state specifically about the voltages and they have been modified to my likings. so for now use for siyah kernel. and once again pls adjust the voltages to values that your phone can handle. some phones can only take a -25 mv from stock voltages. s98bolt1 and screenstate should be used as a base only. adjust them to your liking. the other scripts are system tweaks and are universal for most roms.

Sent from my SGH-I777 using xda premium
 

jasvncnt1

Senior Member
Dec 8, 2011
2,392
707
Union NJ
Thanks for this post Steve. Im sure once I get a handle on these tweaks and applying them I will greatly benefit from them!
 

stevehkim

Senior Member
Oct 29, 2011
2,840
743
No problem. Trying to help out anyway I can. I know all these scripts can be confusing and a headache. I noticed a lot of people asking how to make scripts and OC and UV settings so why not make them avail for the general public. It's just a good base to start off with for siyah users. If anyone has or needs any help in reading the scripts and how to adjust them let me know.
 
  • Like
Reactions: jasvncnt1

jasvncnt1

Senior Member
Dec 8, 2011
2,392
707
Union NJ
I could ask ya a million questions..but I wont lol. Just trying to do lots of reading here..and on Google to learn about scripts..init.d..OC and UV. Sometimes I think I got it...but then i get all confused. The only script I have now is the V6. That one just seemed like I could handle since it basically walks ya through the entire process. And to be honest..not even sure i notice a difference.
 

skatin707

Senior Member
Jun 23, 2011
2,602
297
Honolulu, HI
I could ask ya a million questions..but I wont lol. Just trying to do lots of reading here..and on Google to learn about scripts..init.d..OC and UV. Sometimes I think I got it...but then i get all confused. The only script I have now is the V6. That one just seemed like I could handle since it basically walks ya through the entire process. And to be honest..not even sure i notice a difference.

Trust me, it made a difference. It's nothing flashy, and nothing some people would notice, but it did.

Nice post stevehkim, I may give these are try.

Sent from my SGH-I777 using xda premium
 
  • Like
Reactions: jasvncnt1

jasvncnt1

Senior Member
Dec 8, 2011
2,392
707
Union NJ
If I may..s70darkyzipalign, s98cfs, s98systemtweak...Are theses kinda like OC and UV or just minor system tweaks? I tried opening them and taking a look...but have no idea what im looking at. I admit, I am not the smartest person thats for sure
 

skatin707

Senior Member
Jun 23, 2011
2,602
297
Honolulu, HI
They, from their titles, are system tweaks. I haven't looked through them, so I can't tell for sure.

Edit: Steve, you might want to post a brief description of what each script does, which can be run independently, which need to be run together, and most importantly how to implement them.

Just a suggestion to cut back on confusion and potential fights :p

Sent from my SGH-I777 using xda premium
 
Last edited:
  • Like
Reactions: jasvncnt1

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    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://xdaforums.com/showthread.php?p=18285859

    PHP:
    2
    haha sorry guys. I did post in the OP which ones are universal. The s98systemtweaks, s98cfs, and s70darkyzipalign are universal. These have no oc/uv in them and ONLY adjust system params. and are ok to use on any rom/device.
    It's the s98bolt1 and screenstate scaling that mess with oc/uv and kernel crap like i/o schedular and governer.
    2
    Regarding permission, according to this guide:http://xdaforums.com/showthread.php?t=1369817

    permissions for init.d scripts should be: Using root explorer, copy the script to /etc/init.d and set permissions:
    owner : rwx
    group : r_x
    others : r_x

    Is there a difference the way permissions are set related to I777 versus I9100(referenced guide is from I9100 forums)? I thought it didn't matter...

    It doesn't matter. 755 the minimum (rwxr-xr-x). 777 is to make sure everyone can write to the scripts no matter what.
    1
    No problem. Trying to help out anyway I can. I know all these scripts can be confusing and a headache. I noticed a lot of people asking how to make scripts and OC and UV settings so why not make them avail for the general public. It's just a good base to start off with for siyah users. If anyone has or needs any help in reading the scripts and how to adjust them let me know.
    1
    I could ask ya a million questions..but I wont lol. Just trying to do lots of reading here..and on Google to learn about scripts..init.d..OC and UV. Sometimes I think I got it...but then i get all confused. The only script I have now is the V6. That one just seemed like I could handle since it basically walks ya through the entire process. And to be honest..not even sure i notice a difference.

    Trust me, it made a difference. It's nothing flashy, and nothing some people would notice, but it did.

    Nice post stevehkim, I may give these are try.

    Sent from my SGH-I777 using xda premium