Tuesday, December 9, 2014

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


Enable init.d scripts support 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:
#!/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! 


  





Thanks XDA Devs.