[GUIDE] How To Add Init.d Support to Your Kernel & Rom - Galaxy S Plus I9001 Android Development

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 !

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

Someone had to document this ^^, good job

RobyRc said:
Bull*hit. JUST INSTALL pimpmyrom and finish ..Easy.:victory:
Click to expand...
Click to collapse
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

RobyRc said:
Bull*hit. JUST INSTALL pimpmyrom and finish ..Easy.:victory:
Click to expand...
Click to collapse
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

alireza7991 said:
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
Click to expand...
Click to collapse
You are wrong.

RobyRc said:
You are wrong.
Click to expand...
Click to collapse
well, if he is wrong you can explain why, he explained why according to him is better this way, you could explain why not

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

vMAC said:
What happens if your ROM doesn't have /system/bin/sysinit?
Click to expand...
Click to collapse
* 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

alireza7991 said:
* 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
Click to expand...
Click to collapse
And is it possible to create sysinit and init.d folder with an updater script?

GT-af said:
And is it possible to create sysinit and init.d folder with an updater script?
Click to expand...
Click to collapse
sure but do'nt forget :
1- your kernel must support init.d ( look at first post step 1)
2- do step 2 at fist post on sys init or you wo'nt have init.d support !

I have MTK 6577 device this will work ?

andrman1 said:
I have MTK 6577 device this will work ?
Click to expand...
Click to collapse
all android devices are supported

alireza7991 said:
all android devices are supported
Click to expand...
Click to collapse
In init.rc file I haven't code "stop bootanim" why and where I put this code ?
And I haven't in /system/bin file "sysinit" ?

andrman1 said:
In init.rc file I haven't code "stop bootanim" why and where I put this code ?
And I haven't in /system/bin file "sysinit" ?
Click to expand...
Click to collapse
Place those codes on the middle of init.rc ; the only difference is execute order . if you put it at first init.d wont execute becuase we have'nt system mounted still and if you put it at the end you will stop at your homescreen for a few secound so its better to execute it while you are seeing bootanimation
make new file name it sysinit and put codes siad in OP inside it .

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/
Is this needed?
I've seen some ROMs not having /system/bin/sysinit but init.d kernel support, and I've tested a ROM myself not having this file, but the
99test init.d script gave some output to /data/tmp. So I guess it was executed properly.

t-ryder said:
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/
Is this needed?
I've seen some ROMs not having /system/bin/sysinit but init.d kernel support, and I've tested a ROM myself not having this file, but the
99test init.d script gave some output to /data/tmp. So I guess it was executed properly.
Click to expand...
Click to collapse
There are many ways to get init.d working , you may include sysinit in init.rc or you may completely remove it and use a direct code in init.rc to execute init.d scripts or ....
Here in this method , I used sysinit in user-space to let init.d be dynamicly modifed or removed without repacking the kernel

alireza7991 said:
There are many ways to get init.d working , you may include sysinit in init.rc or you may completely remove it and use a direct code in init.rc to execute init.d scripts or ....
Here in this method , I used sysinit in user-space to let init.d be dynamicly modifed or removed without repacking the kernel
Click to expand...
Click to collapse
So just the file
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/
would make it run (having busybox in /xbin) without having to mess around in the kernel using e.g. virtous ten studio?

t-ryder said:
So just the file
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/
would make it run (having busybox in /xbin) without having to mess around in the kernel using e.g. virtous ten studio?
Click to expand...
Click to collapse
there are many strange and not suggested methods which add init.d without repacking kernel but the best method is using init.rc .
But I have some ideas on getting init.d working withouy messing around kernel . I am going to test them ;

alireza7991 said:
there are many strange and not suggested methods which add init.d without repacking kernel but the best method is using init.rc .
But I have some ideas on getting init.d working withouy messing around kernel . I am going to test them ;
Click to expand...
Click to collapse
Hi; I googled for a while to find a way to add init.d to my ROM and found your thread. Can you also explain how to adjust the source tree before compilation that I get the init.d? I am compiling AOSP with the stock kernel. I saw a few posts before that this method just works for a kernel which supports init.d. I have no clue if the stock kernel does. Thanks

Related

[Q] My init.d script does not work, why?

Hello,
I want to change my voodoo colors at boot, so I made a script in init.d folder:
Code:
#!/system/bin/sh
echo 2447339790 >/sys/devices/virtual/misc/voodoo_color/red_multiplier
echo 2159029280 >/sys/devices/virtual/misc/voodoo_color/green_multiplier
echo 2782492160 >/sys/devices/virtual/misc/voodoo_color/blue_multiplier
echo -14 >/sys/devices/virtual/misc/voodoo_color/red_v1_offset
echo -17 >/sys/devices/virtual/misc/voodoo_color/green_v1_offset
echo -18 >/sys/devices/virtual/misc/voodoo_color/blue_v1_offset
And here is my init.d folder : http://i.imgur.com/nhkdy.png , 99voodoo is my script.
When I paste this codes to android terminal emulator, it is working flawlessly.
But it does not work in init.d folder. Tried different roms which support init.d scripting, but no luck.
What is wrong with it? Can anyone help?
Thanks.
I had the same issue with couple of kernels not sure why im prety sure they even support (Eugene and glados)
you have to set full permissions on the script also but still didn't work for me
I gave up and just used ROM toolbox and made it run at startup works no problem
There must be a solution. What am I doing wrong!?
Do you have Busybox installed?
Hostile89 said:
Do you have Busybox installed?
Click to expand...
Click to collapse
Yes, preinstalled with the rom I've been using:
http://forum.xda-developers.com/showthread.php?t=1397358
features "root, busybox, zipalign, Bash, init.d scripts ... etc".
Any help? No solution?
What is your ROM and kernel combination?
I was using Aosp+ Rom and ICUP-Speedy-3 kernel.
Now, I have just flashed CyberGR rom. Comes with GLaDOS 2.7 kernel. Feature list says "Init.d scripts support", but no luck for me. My script doesn't work with this rom too. What is wrong with it :S
I found the solution.
I was trying to move my script to init.d folder manually via RootExplorer app.
But pushing the same file via adb just worked.
Thanks to this: http://forum.xda-developers.com/showthread.php?t=1424032

[MOD] EZ InitD - init.d the EZ way !!

Root IS required !!
This mod will add init.d support to any rom even stock roms without editing the ramdisk. Instead it uses the post_boot.sh file that is in most if not all roms. It should work on most devices, if it does not work on yours please look in /system/etc and post the name of the file that contains "post_boot.sh".
This mod has been tested on the OneX and OneS.
To use just flash in recovery and add your favorite scripts to init.d.
For devs:
To add this method to your rom simply edit the post_boot.sh file and add this line at the bottom:
Code:
/system/etc/init.d/*
Easy right ? Suprised it hasn't been done before, well at least that i know of.
All files in init.d will be executed at boot just like regular init.d. You can also manually add the line and make it whatever directory you want.
Download:
http://goo.im/devs/smokin1337/Mods/EZ-InitD.zip
reserved.....
I did something similar to the Garminfone to give it init.d support. One question, have you considered using the runparts command (in busybox I believe) to execute the scripts. That is the standard way of doing it. You can also use logwrapper to have it output to logcat.

[MOD][APK+SCRIPT+ZIP] Enable Init.d for Any Phones w/o Need of Custom Kernels!!!

** NOT Android 4.3 compatible!!! Term-init is recommended for now!!!
**Note...this is only for those who do not have init.d support...if you are using custom kernels (cyanogen mod original kernel etc.) that already supports init.d, you shouldn't run this......but if you accidentally ran this, it is ok...won't mess up anything...
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
v1.0
init.d support through an app!!!​
What is init.d:
the_scotsman (Moderator Liaison Admin / Moderator Committee / XDA News Writer) said:
Init.d plays an important role in the world of Android development and customization It allows users to install scripts and mods to be run at boot—everything from battery tweaks to performance tweaks. It essentially opens the door to a world of mods only possible through the Init.d process, which in turn is usually only available on custom kernels.
Click to expand...
Click to collapse
But how?
Concept:
I have recently learnt some linux scripting and was searching for a method to enable init.d scripts support for my phone which has a stock kernel. Inspired by this thread by iridaki, I finally managed to get init.d working in my phone!!! However, I thought of the other users who still do not have a proper custom recovery...how are they gonna flash zip packages? And if it has to be done manually, it requires a lot of typing, changing file permissions etc....a very tedious process...
Therefore, I've decided to come up with a script to automate this process!!! *Drum rolls*...lol
BUT now, with the aid of Androguide.fr (creator of Pimp My ROM), we managed to integrate the script into an app to save the hassle of typing commands in terminal emulator! With just a button click, the commands will be carried out! With just a button click, the app will verify whether is there init.d support or not!
Do I have init.d support?:
Well, here is a way to test:
1. Download the file from here: View attachment 1612958
2. Extract the file, you will get a file named 00test. DO NOT flash!
3. Paste it into /etc/init.d. If there is no init.d folder, most probably you DO NOT have init.d support. However, if you still wanna try, just create the folder named "init.d"
4. Change the permissions of the init.d folder and 00test into rwxrwxrwx.
5. Reboot.
6. If you see a file named Test.log in /data, you have init.d support. If not, you will have to run Uni-init, Term-init or Zip-init.
Features:
- Utilises install-recovery.sh (if your kernel supports that, but of course, but most do...) to enable init.d scripts (busybox run-parts required)
- Will add lines in install-recovery.sh if it already exists (will not replace install-recovery.sh because certain apps such as Link2SD requires that to work), creates it if it doesn't
- Creates the init.d folder with correct permissions
- Adds 2 init.d scripts: one for testing (shows time of execution), another to ensure that the scripts in init.d folder always have the correct permissions
- Adds sysinit in /system/bin, will add the required lines if it already exists
- Deletes duplicate files and lines to ensure the least of errors
Requirements:
- a rooted phone of course...
- busybox with required applets (especially run-parts), if not sure what is this, just install this by Stericson: Link and please reboot after installing before running this script......use "normal install" method, don't use "smart install"...
Instructions:
1. Download the apk.
2. Install the apk like any normal app.
3. Launch the app.
4. The rest are pretty self-explanatory...
5. You can uninstall the app after that...
Screenshots:
**To check whether init.d is really working or not, reboot your phone and navigate to /data...you should find a Test.log in there...If it is present, congrats, you have a WORKING init.d support!
Download:
If you have already read all the instructions and understand them, then click here to download:
Uni-init v1.0.apk
Credits:
Thanks to:
Androguide.fr for the android app base!
Donators (big thank you! ):
@bigknowz
Feel free to posts questions below...I will try my best to help......By the way, those who used the app and found that it works, please leave a post here, stating you phone model, android version and ROM...thanks! but don't just leave comnents saying 'it doesn't work' etc...give more details if possible...
Please don't mirror / modify my work, ask for permissions first...​
**UPDATE: v3 is out now! Android 4.3 compatible!
**Term-init is also used in Droid Manager!!!**
**Featured in the XDA News Portal: Init.d Support for Any Rooted Phone (Thanks to the_scotsman!)
Hi guys...as stated in the title above, I have created a script to be ran in terminal emulator so that it will enable the support of init.d scripts!!!
**Note...this is only for those who do not have init.d support...if you are using custom kernels (cyanogen mod original kernel etc.) that already supports init.d, you shouldn't run this......but if you accidentally ran this, it is ok...won't mess up anything...
init.d support through terminal emulator!!!​
What is init.d:
the_scotsman (Moderator Liaison Admin / Moderator Committee / XDA News Writer) said:
Init.d plays an important role in the world of Android development and customization It allows users to install scripts and mods to be run at boot—everything from battery tweaks to performance tweaks. It essentially opens the door to a world of mods only possible through the Init.d process, which in turn is usually only available on custom kernels.
Click to expand...
Click to collapse
But how?
Concept:
I have recently learnt some linux scripting and was searching for a method to enable init.d scripts support for my phone which has a stock kernel. Inspired by this thread by iridaki, I finally managed to get init.d working in my phone!!! However, I thought of the other users who still do not have a proper custom recovery...how are they gonna flash zip packages? And if it has to be done manually, it requires a lot of typing, changing file permissions etc....a very tedious process...
Therefore, I've decided to come up with a script to automate this process!!! *Drum rolls*...lol
Do I have init.d support?:
Well, here is a way to test:
1. Download the file from here: View attachment test_initd.zip
2. Extract the file, you will get a file named 00test. DO NOT flash!
3. Paste it into /etc/init.d. If there is no init.d folder, most probably you DO NOT have init.d support. However, if you still wanna try, just create the folder named "init.d"
4. Change the permissions of the init.d folder and 00test into rwxrwxrwx.
5. Reboot.
6. If you see a file named Test.log in /data, you have init.d support. If not, you will have to run Uni-init, Term-init or Zip-init.
Features:
- Auto checks for required files [v2]
- Utilises install-recovery.sh (if your kernel supports that, but of course, but most do...) to enable init.d scripts (busybox run-parts required)
- Will move install-recovery.sh to install-recovery-2.sh if it already exists and call it from the main install-recovery.sh (will not replace install-recovery.sh because certain apps such as Link2SD requires that to work), creates it if it doesn't [v3]
- If Superuser is using install-recovery.sh, will use install-recovery-2.sh instead [v3]
- Creates the init.d folder with correct permissions
- Adds 2 init.d scripts: one for testing (shows time of execution [v2]), another to ensure that the scripts in init.d folder always have the correct permissions
- Adds sysinit in /system/bin, will add the required lines if it already exists. This is for utilising a similar method to enabling init.d in AOSP ROMs
Requirements:
- a rooted phone of course...
- busybox with required applets (especially run-parts), if not sure what is this, just install this by Stericson: Link and please reboot after installing before running this script......use "normal install" method, don't use "smart install"...
- terminal emulator such as this: Link
Instructions:
1. Download the file.
2. Place it in the root of your sdcard directory.
3. Launch terminal emulator.
4. Type: su
5. Grant SuperUser access if prompted
6. Type: sh /sdcard/term-init.sh
7. The script will run and follow the instructions! As simple as that...
**To check whether init.d is working or not, reboot your phone and navigate to /data...you should find a Test.log in there...If it is present, congrats, you have init.d support!
Download:
If you have already read all the instructions and understand them, then click here to download:
term-init.sh v3
Feel free to posts questions below...I will try my best to help......By the way, those who used my script and found that it works, please leave a post here, stating you phone model, android version and ROM...thanks! but don't just leave comnents saying 'it doesn't work' etc...give more details and screenshots if possible...
Please don't mirror / modify my work, ask for permissions first...
Source code & changelog: https://github.com/Ryuinferno/Term-init​
** NOT Android 4.3 compatible!!! Term-init is recommended for now!!!
**Note...this is only for those who do not have init.d support...if you are using custom kernels (cyanogen mod original kernel etc.) that already supports init.d, you shouldn't run this......but if you accidentally ran this, it is ok...won't mess up anything...
As Term-init does not work for certain people, I have came up with a CWM flashable zip:
init.d support through CWM!!! ​
What is init.d:
the_scotsman (Moderator Liaison Admin / Moderator Committee / XDA News Writer) said:
Init.d plays an important role in the world of Android development and customization It allows users to install scripts and mods to be run at boot—everything from battery tweaks to performance tweaks. It essentially opens the door to a world of mods only possible through the Init.d process, which in turn is usually only available on custom kernels.
Click to expand...
Click to collapse
Do I have init.d support?:
Well, here is a way to test:
1. Download the file from here: test_initd.zip
2. Extract the file, you will get a file named 00test. DO NOT flash!
3. Paste it into /etc/init.d. If there is no init.d folder, most probably you DO NOT have init.d support. However, if you still wanna try, just create the folder named "init.d"
4. Change the permissions of the init.d folder and 00test into rwxrwxrwx.
5. Reboot.
6. If you see a file named Test.log in /data, you have init.d support. If not, you will have to run Uni-init, Term-init or Zip-init.
Features:
- Utilises install-recovery.sh (if your kernel supports that, but of course, but most do...) to enable init.d scripts (busybox run-parts required)
- Will add lines in install-recovery.sh if it already exists (will not replace install-recovery.sh because certain apps such as Link2SD requires that to work), creates it if it doesn't
- Creates the init.d folder with correct permissions
- Adds 2 init.d scripts: one for testing, another to ensure that the scripts in init.d folder always have the correct permissions
- Adds sysinit in /system/bin, will add the required lines if it already exists
- Deletes duplicate files and lines to ensure the least of errors
Requirements:
- a rooted phone of course...
- busybox with required applets (especially run-parts), if not sure what is this, just install this by Stericson: Link and please reboot after installing before running this script......use "normal install" method, don't use "smart install"...
- a working CWM custom recovery
Instructions:
1. Download the file.
2. Flash zip-init.zip thorough CWM.
3. Reboot and you are done!
**If you get a status 0 error in CWM, please replace the update-binary in zip-init.zip with a working update-binary of your phone (just extract it from any CWM zip meant for your phone)...
**To check whether init.d is working or not, reboot your phone and navigate to /data...you should find a Test.log in there...If it is present, congrats, you have init.d support!
Download:
If you have already read all the instructions and understand them, then click here to download:
zip-init.zip v2
Feel free to posts questions below...I will try my best to help......By the way, those who used my mod and found that it works, please leave a post here, stating you phone model, android version and ROM...thanks! but don't just leave comnents saying 'it doesn't work' etc...give more details and screenshots if possible...
Please don't mirror / modify my work, ask for permissions first...​
Troubleshooting
Troubleshooting:
**CWM might warn something about disable recovery flash when using this mod, it is just a false positive, please DO NOT select yes or else it won't work anymore**
If you have already applied the script but there is no /data/Test.log, please refer the steps below:
1. Check whether have you installed busybox properly, especially run-parts. REBOOT after installing, then only apply this script.
2. If you are using the busybox installer by Stericson, please use "normal installation method", NOT "smart installation method".
3. Check whether are these files present with the correct permissions (please change if the permissions are wrong):
- /system/bin/sysint (rwxr-xr-x) [owner: root (0), group: shell (2000)]
- /system/etc/init.d (rwxrwxrwx) [owner: root (0), group: root (0)]
- /system/etc/init.d/00test (rwxrwxrwx) [owner: root (0), group: root (0)]
-/system/etc/init.d/08setperm (rwxrwxrwx) [owner: root (0), group: root (0)]
- /system/etc/install-recovery.sh (rwxr-xr-x) [owner: root (0), group: root (0)]
- /system/etc/install-recovery-2.sh (rwxr-xr-x) [owner: root (0), group: root (0)] (may or may not be present)
4. Check whether you have run-parts installed. Go to /system/xbin, you should be able to find a fine named "run-parts"
5. Check whether you have these lines in /system/etc/install-recovery.sh (if not, please add them in manually (using Root Explorer or keep the EOL in Unix format...Google about it), remember to leave an EMPTY line at the end of the file)
Code:
# init.d support
busybox run-parts /system/etc/init.d/
6. If all the above are still not helping, please download this: run-parts.zip and extract it (DO NOT flash it). Place the file named "run-parts" in /system/xbin. Change permissions to rwxrwxrwx, owner to root (o) and group to shell (2000). Reboot and check /data again.
7. Still fails? Check your /init.rc for any lines containing "install-recovery"...if there are none, this method won't work...so use the Script Manager method.
8. Use this as a last resort: Download Script Manager from Play Store: Link. Then navigate to /etc/install-recovery.sh, select it and run as root and at boot (select the skull and gear icon).
9. If all the above are not working, and the "install-recovery" line is present, then please paste the contents of your /etc/install-recovery.sh and /etc/install-recovery-2.sh if present somewhere (like http://pastebin.com and after applying the mod of course) here for me to debug. Take a screenshot of the output after running Term-init and post here, along with your ROM version, android version and name of device.
ace 5830i stock rom
Ryuinferno said:
Hi guys...as stated in the title above, I have created a script to be ran in terminal emulator so that it will enable the support of init.d scripts!!!
Term-init --> init.d support through terminal emulator!!!
But how?
Concept:
I have recently learnt some linux scripting and was searching for a method to enable init.d scripts support for my phone which has a stock kernel. Inspired by this thread by iridaki, I finally managed to get init.d working in my phone!!! However, I thought of the other users who still do not have a proper custom recovery...how are they gonna flash zip packages? And if it has to be done manually, it requires a lot of typing, changing file permissions etc....a very tedious process...
Therefore, I've decided to come up with a script to automate this process!!! *Drum rolls*...lol
Features:
- Utilises install-recovery.sh to enable init.d scripts (busybox run-parts required)
- Will add lines in install-recovery.sh if it already exists (will not replace install-recovery.sh because certain apps such as Link2SD requires that to work), creates it if it doesn't
- Creates the init.d folder with correct permissions
- Adds 2 init.d scripts: one for testing, another to ensure that the scripts in init.d folder always have the correct permissions
- Adds sysint in /system/bin, will add the required lines if it already exists
- Deletes duplicate files and lines to ensure the least of errors
Requirements:
- busybox with required applets (especially run-parts), if not sure what is this, just install this by Stericson: BusyBox
- terminal emulator such as this
Instructions:
1. Download the file.
2. Place it in the root of your sdcard directory.
3. Launch terminal emulator.
4. Type: su
5. Grant SuperUser access if prompted
6. Type: sh /sdcard/term-init.sh
7. The script will run and follow the instructions! As simple as that...
Example:
**To check whether init.d is working or not, reboot your phone and navigate to /data...you should find a Test.log in there...If it is present, congrats, you have init.d support!
Download:
If you have already read all the instructions and understand them, then click here to download:
term-init.sh
Feel free to posts questions below...I will try my best to help...
Hit the thanks button if you liked my work...it gives me a boost!
Please don't mirror / modify my work, ask for permissions first...​
Click to expand...
Click to collapse
its not working
ranjitkhera said:
its not working
Click to expand...
Click to collapse
Well, are the all the files present? Did you follow all the steps? I suggest you to reinstall busybox by using the link I gave...then attempt this again...
This mod work on MIUI UK official for desire s
Tested with v6 supercharger by zep
Thanks a lot
Sent from my HTC Desire S using xda app-developers app
Hi ,
I use an Motoluxe xt615 , i Fllow your guide step by step . But nothing.
The Phone Restarts an in /data is no Test.log
Busybox install Terminal install . Terminal say all is ok but the test.log fails. After Reboot i cant find it.
Sorry for my bad Englisch
hexer7568 said:
Hi ,
I use an Motoluxe xt615 , i Fllow your guide step by step . But nothing.
The Phone Restarts an in /data is no Test.log
Busybox install Terminal install . Terminal say all is ok but the test.log fails. After Reboot i cant find it.
Sorry for my bad Englisch
Click to expand...
Click to collapse
Ok...let me interpret...you installed busybox by using the link I gave, then you ran this in terminal emulator right? Can you please give me a screenshot of your terminal emulator running this script? Thanks...
Ryuinferno said:
Ok...let me interpret...you installed busybox by using the link I gave, then you ran this in terminal emulator right? Can you please give me a screenshot of your terminal emulator running this script? Thanks...
Click to expand...
Click to collapse
how can i make this???
ah ok
http://s1.directupload.net/file/d/3042/ofxoh9z3_png.htm
Err...run the script in terminal emulator, when it finished running, take a screenshot...
Ryuinferno said:
Err...run the script in terminal emulator, when it finished running, take a screenshot...
Click to expand...
Click to collapse
http://s1.directupload.net/file/d/3042/ofxoh9z3_png.htm
hexer7568 said:
how can i make this???
ah ok
http://s1.directupload.net/file/d/3042/ofxoh9z3_png.htm
Click to expand...
Click to collapse
Ok...by looking at your first few lines...I saw that su permissions for terminal emulator are not granted properly...and my script seems to be only running in the surface (only shows the text)...did you reboot after installing busybox? And by the way, please check your /system/etc...is there a init.d folder and a file named "install-recovery.sh"? And what andriod version are you using?
P.s. A working example should be like my screenshot on the first page...the first few lines in your screenshot should not appear...
Ok...I will include a flashable zip soon...cause terminal emulator does not seem to work with some...
Ryuinferno said:
Ok...by looking at your first few lines...I saw that su permissions for terminal emulator are not granted properly...and my script seems to be only running in the surface (only shows the text)...did you reboot after installing busybox? And by the way, please check your /system/etc...is there a init.d folder and a file named "install-recovery.sh"? And what andriod version are you using?
P.s. A working example should be like my screenshot on the first page...the first few lines in your screenshot should not appear...
Click to expand...
Click to collapse
1 Reboot after busybox install no
2, no
3. no
That's why...the script did not have the correct permissions to run...did you grant terminal emulator su access when you type "su"? Try installing busybox again, reboot, run the script and reboot again...
Ryuinferno said:
That's why...the script did not have the correct permissions to run...did you grant terminal emulator su access when you type "su"? Try installing busybox again, reboot, run the script and reboot again...
Click to expand...
Click to collapse
When i type su , the first massage is "log_write: cannot open Device" , then after this massage i have su
When you type "su" for the first time after installing terminal emulator, a pop up will appear, asking you to grant or deny superuser access...did that happen?
Ryuinferno said:
When you type "su" for the first time after installing terminal emulator, a pop up will appear, asking you to grant or deny superuser access...did that happen?
Click to expand...
Click to collapse
i install emulator new, and i lock that
Ok..seems that the su access in your terminal emulator is not working well, so I will upload a cwm zip soon...wait for that...

Impossible to get the init.d support in ramdisk

Hello guys!
I am not new in the Android and Nexus world but at this time I need some help.
I am used to root any Nexus phone in this way:
1. Put su, daemonsu, busybox on /system/xbin/ path;
2. Create the init.d folder in /system/etc/ path;
3. Add a script file to start the superuser daemon at the boot;
4. Edit the kernel ramdisk adding the sysinit script to add the init.d support at the boot;
5. Edit the updated-script for the right permissions to the new init.d folder (and its content) and to the su binary file.
I never had problems with Galaxy Nexus and LG Nexus 4 but today I am having troubles with the Nexus 5.
Is this a common issue?
I hope to get answers,
regards,
kalo86
kalo86 said:
Hello guys!
I am not new in the Android and Nexus world but at this time I need some help.
I am used to root any Nexus phone in this way:
1. Put su, daemonsu, busybox on /system/xbin/ path;
2. Create the init.d folder in /system/etc/ path;
3. Add a script file to start the superuser daemon at the boot;
4. Edit the kernel ramdisk adding the sysinit script to add the init.d support at the boot;
5. Edit the updated-script for the right permissions to the new init.d folder (and its content) and to the su binary file.
I never had problems with Galaxy Nexus and LG Nexus 4 but today I am having troubles with the Nexus 5.
Is this a common issue?
I hope to get answers,
regards,
kalo86
Click to expand...
Click to collapse
fastboot oem unlock
flash custom recovery
flash SuperSU in recovery
Of course I have unlocked the bootloder but the init.d script does not work.
Neither a test script works...
This is the test script that I am using to verify if the init.d support is working. The file 00test is placed in /system/etc/init.d/.
Code:
#!/system/bin/sh
#Init.d Test
busybox mount -o remount,rw -t auto /system
if [ -e /system/Test.log ]; then
rm /system/Test.log
fi
echo "kalo86 @ XDA 2014" > /system/Test.log
echo "Init.d is working !!!" >> /system/Test.log
kalo86 said:
Of course I have unlocked the bootloder but the init.d script does not work.
Neither a test script works...
This is the test script that I am using to verify if the init.d support is working. The file 00test is placed in /system/etc/init.d/.
Code:
#!/system/bin/sh
#Init.d Test
busybox mount -o remount,rw -t auto /system
if [ -e /system/Test.log ]; then
rm /system/Test.log
fi
echo "kalo86 @ XDA 2014" > /system/Test.log
echo "Init.d is working !!!" >> /system/Test.log
Click to expand...
Click to collapse
You're making it way too difficult. Just flash supersu in a custom recovery
Sent from my Nexus 5 using XDA Free mobile app
You could install an application such as Universal init.d from the playstore. It works for me on both my Nexus 5 and 10. Initially works without issue.
Sent from my Nexus 10 using XDA Premium HD app
jd1639 said:
You're making it way too difficult. Just flash supersu in a custom recovery
Sent from my Nexus 5 using XDA Free mobile app
Click to expand...
Click to collapse
Why difficult? This is the same identical mechanism that Chainfire uses to root your phone but I like to share a rooted-ROM ready to use.
The init.d folder is not supported at the moment. This is the truth.
And I don't want a workaround since the init.d support is very useful also for other stuff which is not only root access.

INIT.D SUPPORT Kernel method *adds INIT.D folder*

HI guys
I just discovered a way to make init.d work on my rom and it should work on other roms as long as everything is followed down to the T
Basically there are 5 things you need to do
1: BootImageExtractor *links to follow* need to get it from my other laptop
2: Notepad++ *ask google*
3: Rashr *or any other apps that can flash kernels I just use this one*
4: Rooted Device
5: Rootexplorer *or any apps that let you dig deep into the root of THE android*
Ok lets start
First up is to unpack your boot.img and you should see your RAMDISK folder
now go ahead and look for init.rc and open it with notepad++ now add this code either at the very top or below the import scripts.
Code:
import /init.d.sh
You can use any name really as long as you have the same import script and name of the sh file
Now on to the next step which is to create a .sh file
Open up notepad++ and add this code in
Code:
#!/system/bin/sh
on property:sys.boot_completed=1
start sysinit
service sysinit /sbin/sysinit.sh
oneshot
class late_start
user root
group root
disabled
Now save as and use all types and name it init.d.sh and be sure its in the ramdisk folder
Having fun yet?
now last but not the least the sysinit.sh file!
same method as above but with a different code and is saved in the sbin folder
Code:
#!/system/bin/sh
mount -o remount,rw /;
mount -o rw,remount /system
# init.d support
if [ ! -e /system/etc/init.d ]; then
mkdir /system/etc/init.d
chown -R root.root /system/etc/init.d
chmod -R 755 /system/etc/init.d
fi
# start init.d
for FILE in /system/etc/init.d/*; do
sh $FILE >/dev/null
done;
And there you have it folks!
I would like to credit where I got the idea from but alas the guy who gave me the boot.img says he got it from another site and got it randomly.... so would like to thank my buddy Car *actually a human not a machine*
I already tried using the 00test script by Ryuinferno to see if it works and after two reboots I found the test log file in /data
I am new at this so please be gentle and I am still working on this because I want to integrate the scripts of Ryuinferno into the kernel *scripts being the 00test and the 00setperm* he will allow me to use them.
Again thanks XDA! my new home
Feedback please ^_^
Reserved
Where is the difference to the easy to use apps from other devs?
-CALIBAN666- said:
Where is the difference to the easy to use apps from other devs?
Click to expand...
Click to collapse
This is just an alternate method
and there are some phones who cant get init.d to work even with the universal init.d app * i know cause my device has that problem*
I am not saying those apps are not working, infact I use those when I help mates with their phones performance *its easier yes*
and this is something like kernel injection so just flashing a kernel will add init.d and would/could be useful for some devs or guys who just want to know how things tick *like me*
Ok,cool,thanx for answer bro.greeetz!
Working...
Thanks

Categories

Resources