FORUMS
Remove All Ads from XDA

[MOD] Enable init.d scripts support on stock kernel

4,537 posts
Thanks Meter: 5,233
 
Post Reply Email Thread
Hello!

This is a small mod, inspired by non other than our great DoomLord (so if it helped you, thank him/donate to him/worship him ) and his thread in the X10 section.

I am trying a lot of things on my phone, so I often switch back and forth from stock kernel to DoomKernel.
However, I use lots of init.d scripts (my favorite one being SuperCharger)
and I just don't want to lose this feature when I'm on stock.

So, without further ado, here are the steps that are needed to make init.d scripts run automatically at boot on stock kernel.

Requirements:

1. Stock Kernel
2. Root
3. Busybox
4. CMW Recovery for Stock Kernel by nAa.
5. Root Explorer or any other similar app.

Instructions:

1. Download the attached zip and place it in a folder in your SD card.

2. With Root Explorer, go to /system/etc. Press the Mount RW button on top right corner.
a. If the file install-recovery.sh is not there, then press Menu and create a New File.
Name it install-recovery.sh and then long-press on it and select Open in Text Editor.
Paste this text in it:
Code:
#!/system/bin/sh
# init.d support
busybox run-parts /system/etc/init.d/
Save it and delete any .bak file that Root Explorer might have created. Set the permissions as in the attached screenshot.
OR
b. If the file install-recovery.sh is already there, long-press on it and select Open in Text Editor. Paste this text in the end:

Code:
# init.d support
busybox run-parts /system/etc/init.d/
In both scenarios, don't forget to leave one empty line at the end of install-recovery.sh file. ***

3. Reboot into Recovery and flash the init.d-autorunner-stock.zip.

4. Reboot your phone and with Root Explorer go to /data/local/tmp.
There should be a txt file there named "init.d_log_test.txt" and once you open it, you should see the word "done".

5. Now you can use your favorite init.d scripts on stock kernel!

If you want to check if the scripts you want to use actually work, please refer to one of my older threads about how to test them.


*** I am not including an install-recovery.sh because this is the file that Link2SD depends on, so it's better if you modify it yourself, rather than use mine.


Let me know if it worked for you!
Attached Thumbnails
Click image for larger version

Name:	screenshot_2011-12-22_1414_1.jpg
Views:	115035
Size:	37.8 KB
ID:	825756   Click image for larger version

Name:	screenshot_2011-12-22_1414.jpg
Views:	123523
Size:	15.0 KB
ID:	825757   Click image for larger version

Name:	screenshot_2011-12-22_1418.jpg
Views:	139844
Size:	29.1 KB
ID:	825758  
Attached Files
File Type: zip init.d-autorunner-stock.zip - [Click for QR Code] (534.3 KB, 44810 views)
The Following 30 Users Say Thank You to iridaki For This Useful Post: [ View ] Gift iridaki Ad-Free
 
 
22nd December 2011, 01:14 PM |#2  
adiktz's Avatar
Senior Member
Flag Nashik
Thanks Meter: 211
 
Donate to Me
More
Quote:
Originally Posted by iridaki

Hello!

This is a small mod, inspired by non other than our great DoomLord (so if it helped you, thank him/donate to him/worship him ) and his thread in the X10 section.

I am trying a lot of things on my phone, so I often switch back and forth from stock kernel to DoomKernel.
However, I use lots of init.d scripts (my favorite one being SuperCharger)
and I just don't want to lose this feature when I'm on stock.

So, without further ado, here are the steps that are needed to make init.d scripts run automatically at boot on stock kernel.

Requirements:

1. Stock Kernel
2. Root
3. Busybox
4. CMW Recovery for Stock Kernel by nAa.
5. Root Explorer or any other similar app.

Instructions:

1. Download the attached zip and place it in a folder in your SD card.

2. With Root Explorer, go to /system/etc. Press the Mount RW button on top right corner.
a. If the file install-recovery.sh is not there, then press Menu and create a New File.
Name it install-recovery.sh and then long-press on it and select Open in Text Editor.
Paste this text in it:

Code:
#!/system/bin/sh
# init.d support
busybox run-parts /system/etc/init.d/
Save it and delete any .bak file that Root Explorer might have created. Set the permissions as in the attached screenshot.
OR
b. If the file install-recovery.sh is already there, long-press on it and select Open in Text Editor. Paste this text in the end:

Code:
# init.d support
busybox run-parts /system/etc/init.d/
In both scenarios, don't forget to leave one empty line at the end of install-recovery.sh file. ***

3. Reboot into Recovery and flash the init.d-autorunner-stock.zip.

4. Reboot your phone and with Root Explorer go to /data/local/tmp.
There should be a txt file there named "init.d_log_test.txt" and once you open it, you should see the word "done".

5. Now you can use your favorite init.d scripts on stock kernel!

If you want to check if the scripts you want to use actually work, please refer to one of my older threads about how to test them.


*** I am not including an install-recovery.sh because this is the file that Link2SD depends on, so it's better if you modify it yourself, rather than use mine.


Let me know if it worked for you!

Was looking for this...!!! Thanks...!!!

Sent from my LT15i using xda premium
22nd December 2011, 06:01 PM |#3  
Senior Member
Flag Ho Chi Minh
Thanks Meter: 37
 
More
thank you. but what is this script for? Can you explain it 2 me?
22nd December 2011, 06:40 PM |#4  
iridaki's Avatar
OP Retired Forum Moderator
Flag Edinburgh, Scotland
Thanks Meter: 5,233
 
Donate to Me
More
Quote:
Originally Posted by mercury_beta

thank you. but what is this script for? Can you explain it 2 me?

This is a setup in order for scripts placed in /system/etc/init.d to be executed automatically at boot. Such scripts can do lots of things, like RAM optimisation, CPU scaling, mount options, etc etc etc.
The Following User Says Thank You to iridaki For This Useful Post: [ View ] Gift iridaki Ad-Free
23rd December 2011, 01:03 AM |#5  
emannxperia's Avatar
Senior Member
Flag Kuching, Sarawak
Thanks Meter: 2,769
 
More
Can the script be added to hw_config.sh? Will it be execute on boot? Inteks' swap2cache script can be added to hw_config.sh too.

Sent from my digital typewriter..
23rd December 2011, 05:34 AM |#6  
iridaki's Avatar
OP Retired Forum Moderator
Flag Edinburgh, Scotland
Thanks Meter: 5,233
 
Donate to Me
More
Quote:
Originally Posted by emannxperia

Can the script be added to hw_config.sh? Will it be execute on boot? Inteks' swap2cache script can be added to hw_config.sh too.

Sent from my digital typewriter..

Sorry, I don't know for sure. But probably yes.
The Following User Says Thank You to iridaki For This Useful Post: [ View ] Gift iridaki Ad-Free
29th December 2011, 04:54 AM |#7  
aimcr7's Avatar
Senior Member
Flag Yogyakarta
Thanks Meter: 892
 
More
Great post mate, thanks. (already give you thanks button)
2nd January 2012, 07:55 AM |#8  
chiefy009's Avatar
Senior Member
Thanks Meter: 803
 
More
Seeing if this works on ray

I get this file in the init.d folder after.flashing the file

#!/system/bin/sh
touch /data/local/tmp/init.d_log_test.txt
echo "done" >> /data/local/tmp/init.d_log_test.txt

Not in data/ local

I have ran supercharger script and files are appearing in inlit.d folder think it's working

Edit : tested it as per the thread further up it would seem its all working!

Sweet

Hope it is ok I have shared this on the Ray thread? (I have linked back to your thread)

sent from my gorgeus Xperia Ray
3rd January 2012, 04:01 AM |#9  
hansip87's Avatar
Senior Member
Flag Jakarta
Thanks Meter: 2,152
 
Donate to Me
More
Hi iridaki thanks for your little mod here! I just want to give a hint of what might been a little issue but might make your whole mod is not running. You do mention about changing permission on install-recovery.sh, but you gave it as a picture. The Problem is XDA on web these days is not arranging the image as inline, but as an attachment. So i and chiefy009 did the same mistake, not changing the permission because it is just a one line and not clear enough. Please add additional step like:

Quote:

3. Make sure install-recovery.sh have permissions of rwxr-xr-x

Thanks
The Following User Says Thank You to hansip87 For This Useful Post: [ View ] Gift hansip87 Ad-Free
6th October 2013, 06:43 PM |#10  
Member
Flag Sakarya
Thanks Meter: 31
 
Donate to Me
More
Worked for me. I'm using Sony Ericsson Xperia Pro MK16i with stock rom (root + cwm including).
9th December 2017, 10:41 AM |#11  
Junior Member
Thanks Meter: 0
 
More
Hello

doesn't worked for me ;(
Sony Xperia Arc S (LT18i) build ver. 4.1.B.0.587
nAa's CWM 5.0.2.7
rooted

there is no this test log file in /data/local/tmp afret applying the zip

so what i have after "apply zip file" in recovery meny and rebooting:
in /system/xbin new binary file run-parts
in /system/etc new folder init.d with test99 script in it
in /sysrem/etc file install-recovery.sh which was made by us previously
it looks like would work...but it does not

So, what can i do myself?
Thank you in any way
Post Reply Subscribe to Thread

Tags
autorunner, init.d, scripts, stock kernel

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes