Post Reply

[GUIDE] How To Add Init.d Support to Your Kernel & Rom

OP alireza7991

20th May 2013, 03:44 PM   |  #1  
alireza7991's Avatar
OP Senior Member
Flag Shahrekord
Thanks Meter: 2,270
 
767 posts
Join Date:Joined: Sep 2012
Donate to Me
More
What is init.d ?

Init.d is a feature which allows you to run brunch of scripts at boot . Thats really useful while you want to set values which reset at boot or run/do any thing at every boot or install tweaks , engines and....

There are some ways to add this feature to you rom but always best way is to add init.d support directly by your kernel . I want to help you to do this

Requirements

1- Ability to unpack boot.img & ramdisk
2- Some basic linux shell knowloedge
3- Having Busybox located in /system/bin/busybox at your rom

Step 1: Making kernel ready

1- Unpack kernel then ramdisk
2- Open Init.rc with a text editor
3- Add this codes at the end , before the paragraph which there is "stop bootanim" command in it :

Code:
service sysinit /system/bin/sysinit
oneshot
4- Save , Exit and repack ramdisk and boot.img

Step 2 : Making Rom Ready !

1- Open /system/bin/sysinit
2- Add this codes :

Code:
#!/system/bin/sh
export PATH=${PATH}:/system/bin:/system/xbin
chmod 777 /system/etc/init.d/*
logwrapper busybox run-parts /system/etc/init.d/
3- Set permissions of sysinit to 777 or 755 ( rwxrwxr-x | rwxrwxrwx )
4- Make a directory at system/etc and name it init.d

Now you have init.d support !
The Following 43 Users Say Thank You to alireza7991 For This Useful Post: [ View ]
20th May 2013, 03:55 PM   |  #2  
Senior Member
Flag Nashville
Thanks Meter: 77
 
337 posts
Join Date:Joined: Feb 2012
More
Bull*hit. JUST INSTALL pimpmyrom and finish ..Easy.
20th May 2013, 03:56 PM   |  #3  
broodplank1337's Avatar
Recognized Contributor / Recognized Developer
Flag Nijmegen
Thanks Meter: 10,044
 
4,941 posts
Join Date:Joined: Nov 2011
Donate to Me
More
Someone had to document this ^^, good job
The Following 2 Users Say Thank You to broodplank1337 For This Useful Post: [ View ]
20th May 2013, 04:18 PM   |  #4  
alireza7991's Avatar
OP Senior Member
Flag Shahrekord
Thanks Meter: 2,270
 
767 posts
Join Date:Joined: Sep 2012
Donate to Me
More
Quote:
Originally Posted by RobyRc

Bull*hit. JUST INSTALL pimpmyrom and finish ..Easy.

Pimp uses one of the worst method to add this feature to your ROM ! it doesn't effect on kernel so : 1- running init.d is slower 2- init.d is not stable at all 3- not usable for ones want to add this feature to his/her kernel 4- not run init.d at end of boot so some script which needs some binaries that are not loaded yet doesn't work 5- Can not be used for room devs

This method is the official method which is used on most famous kernels such as brood kernel . and best for devs and users

any way that depends on users idea that this is good or not
The Following 7 Users Say Thank You to alireza7991 For This Useful Post: [ View ]
20th May 2013, 04:25 PM   |  #5  
Stefano187's Avatar
Senior Member
Flag Frosinone
Thanks Meter: 199
 
337 posts
Join Date:Joined: May 2012
Donate to Me
More
Quote:
Originally Posted by RobyRc

Bull*hit. JUST INSTALL pimpmyrom and finish ..Easy.

Why are you so rude?
There are ways and ways to express own opinions... And alireza has just explained you why this method is better then PIMPMYROM.

Sent from my AriesVe using xda premium
The Following 4 Users Say Thank You to Stefano187 For This Useful Post: [ View ]
21st May 2013, 08:42 PM   |  #6  
Senior Member
Flag Nashville
Thanks Meter: 77
 
337 posts
Join Date:Joined: Feb 2012
More
Quote:
Originally Posted by alireza7991

Pimp uses one of the worst method to add this feature to your ROM ! it doesn't effect on kernel so : 1- running init.d is slower 2- init.d is not stable at all 3- not usable for ones want to add this feature to his/her kernel 4- not run init.d at end of boot so some script which needs some binaries that are not loaded yet doesn't work 5- Can not be used for room devs

This method is the official method which is used on most famous kernels such as brood kernel . and best for devs and users

any way that depends on users idea that this is good or not

You are wrong.
21st May 2013, 09:26 PM   |  #7  
Senior Member
Flag Pescara
Thanks Meter: 1,128
 
1,153 posts
Join Date:Joined: Jan 2013
More
Quote:
Originally Posted by RobyRc

You are wrong.

well, if he is wrong you can explain why, he explained why according to him is better this way, you could explain why not
The Following User Says Thank You to ktulu84 For This Useful Post: [ View ]
25th May 2013, 04:40 PM   |  #8  
Senior Member
Thanks Meter: 11
 
159 posts
Join Date:Joined: Oct 2007
What happens if your ROM doesn't have /system/bin/sysinit?
25th May 2013, 06:33 PM   |  #9  
alireza7991's Avatar
OP Senior Member
Flag Shahrekord
Thanks Meter: 2,270
 
767 posts
Join Date:Joined: Sep 2012
Donate to Me
More
Quote:
Originally Posted by vMAC

What happens if your ROM doesn't have /system/bin/sysinit?

* Your rom has sysinit -> You have already init.d support and no need to this guide

* Your rom has'nt it -> You need to do my guide to get init.d support
The Following 3 Users Say Thank You to alireza7991 For This Useful Post: [ View ]
20th June 2013, 07:58 PM   |  #10  
GT-af's Avatar
Senior Member
Flag Paris
Thanks Meter: 68
 
130 posts
Join Date:Joined: Oct 2012
Quote:
Originally Posted by alireza7991

* Your rom has sysinit -> You have already init.d support and no need to this guide

* Your rom has'nt it -> You need to do my guide to get init.d support

And is it possible to create sysinit and init.d folder with an updater script?

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools
Display Modes