[GUIDE] How To Add Init.d Support to Your Kernel & Rom
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
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 :
service sysinit /system/bin/sysinit
4- Save , Exit and repack ramdisk and boot.img
Step 2 : Making Rom Ready !
1- Open /system/bin/sysinit
2- Add this codes :
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 !
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it.