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

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

Tip us?
 
iridaki
Old
#1  
iridaki's Avatar
Retired Forum Moderator / Recognized Themer - OP
Thanks Meter 4648
Posts: 3,688
Join Date: Feb 2007
Location: Edinburgh, Scotland

 
DONATE TO ME
Thumbs up [MOD] Enable init.d scripts support on stock kernel

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 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:
Select 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:
Select 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!


The Following 63 Users Say Thank You to iridaki For This Useful Post: [ Click to Expand ]
 
aimcr7
Old
#2  
aimcr7's Avatar
Senior Member
Thanks Meter 769
Posts: 1,824
Join Date: Jun 2010
Location: Yogyakarta
Good, nice to see this posted here too.

Sent from my MT15i using XDA App
 
YongJeah
Old
#3  
Senior Member
Thanks Meter 82
Posts: 159
Join Date: Nov 2011
Location: Canton
great work!
 
kcthomlau
Old
#4  
Member
Thanks Meter 4
Posts: 64
Join Date: Oct 2011
Could this be used in other android devices?
 
aimcr7
Old
#5  
aimcr7's Avatar
Senior Member
Thanks Meter 769
Posts: 1,824
Join Date: Jun 2010
Location: Yogyakarta
Quote:
Originally Posted by kcthomlau View Post
Could this be used in other android devices?
Yes, it should be works well on other devices, just try it and let us know.

Sent from my MT15i using XDA App
 
sgj1
Old
#6  
sgj1's Avatar
Member
Thanks Meter 6
Posts: 75
Join Date: May 2010
Location: spain
itīs necessary to have unlocked bootloader?
I have followed this tutorial and have not created the file "init.d_log_test.txt"
when i go to /data/local/tmp i only have init.rc file
 
pawo99
Old
#7  
pawo99's Avatar
Senior Member
Thanks Meter 189
Posts: 547
Join Date: Dec 2007
Quote:
Originally Posted by sgj1 View Post
itīs necessary to have unlocked bootloader?
I have followed this tutorial and have not created the file "init.d_log_test.txt"
when i go to /data/local/tmp i only have init.rc file
no. I have now locked bootloader and it is working
LG NEXUS 4
SE XPERIA NEO
 
aimcr7
Old
#8  
aimcr7's Avatar
Senior Member
Thanks Meter 769
Posts: 1,824
Join Date: Jun 2010
Location: Yogyakarta
Quote:
Originally Posted by sgj1 View Post
itīs necessary to have unlocked bootloader?
I have followed this tutorial and have not created the file "init.d_log_test.txt"
when i go to /data/local/tmp i only have init.rc file
This is working great on mine mate, just try it again maybe you left something, i tested it with init.d scripts from SE Tweaked and it works.

Sent from my MT15i using XDA App
 
csiziktomi
Old
#9  
Senior Member
Thanks Meter 7
Posts: 115
Join Date: Mar 2009
Location: Győr
hello guys!

what kind of script is the neo?
 
onlavu
Old
(Last edited by onlavu; 15th January 2012 at 08:10 AM.)
#10  
Member
Thanks Meter 13
Posts: 94
Join Date: Jan 2011
Location: Opava
Thumbs up Confirmed, working:)

I tried this mod and it seems to be working. Before its application, Supercharger tells me that he cannot reach init.d or something like that. But with this mod it can use init.d without any problems, no more warning. So it is working. Thank you
LG P500 Optimus One ==> SE Xperia NEO ==> SONY Xperia S running SlimBean ROM

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes