FORUMS
Remove All Ads from XDA

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

3,548 posts
Thanks Meter: 7,195
 
Post Reply Email Thread
11th March 2015, 08:40 PM |#501  
tonyafc's Avatar
Senior Member
London
Thanks Meter: 105
 
More
Can someone help im on lollipop rooted busybox stock kernel no matter what i do i cant get testlog in data i get both recoverysh and sysinit but no test log thanks in advance
 
 
24th April 2015, 02:06 AM |#502  
Senior Member
Thanks Meter: 32
 
More
Quote:
Originally Posted by tonyafc

Can someone help im on lollipop rooted busybox stock kernel no matter what i do i cant get testlog in data i get both recoverysh and sysinit but no test log thanks in advance

go to system/etc then find install-recovery.sh open it and delete everything in there paste this then:


#!/system/bin/sh

# If you're implementing this in a custom kernel/firmware,
# I suggest you use a different script name, and add a service
# to launch it from init.rc

# Launches SuperSU in daemon mode only on Android 4.3+.
# Nothing will happen on 4.2.x or older, unless SELinux+Enforcing.
# If you want to force loading the daemon, use "--daemon" instead

/system/xbin/daemonsu --auto-daemon &

# Some apps like to run stuff from this script as well, that will
# obviously break root - in your code, just search this file
# for "install-recovery-2.sh", and if present, write there instead.

/system/etc/install-recovery-2.sh




After that safe and reboot and look for the test.log file in /data

Make sure to give proper permission before rebooting you can find that in op first post
The Following User Says Thank You to el.quechon For This Useful Post: [ View ] Gift el.quechon Ad-Free
8th June 2015, 10:13 AM |#503  
bombadier's Avatar
Senior Member
Flag The Borders
Thanks Meter: 3,009
 
Donate to Me
More
scripts in my init.d folder are not starting, those in su.d work fine, I have installed uni-init to test and everything looks good,anyone any ideas ?

Example
The script 00test which will create a log in /data, put the script in init.d it does not work, move it to su.d and rename it 00test.sh and it runs and generates a log in /data
I am on slimsaber which has init.d support and the app reports that everything is working, scripts in init.d do not work but manually running them does
Correct permissions etc
latest busybox 1.23.2
Also going to /system/etc/init.d and running the script manually works,just not at startup like it meant to.
8th June 2015, 06:05 PM |#504  
Perseus's Avatar
Forum Moderator / Recognized Developer
Atlantis
Thanks Meter: 7,885
 
Donate to Me
More
Quote:
Originally Posted by bombadier

scripts in my init.d folder are not starting, those in su.d work fine, I have installed uni-init to test and everything looks good,anyone any ideas ?

Example
The script 00test which will create a log in /data, put the script in init.d it does not work, move it to su.d and rename it 00test.sh and it runs and generates a log in /data
I am on slimsaber which has init.d support and the app reports that everything is working, scripts in init.d do not work but manually running them does
Correct permissions etc
latest busybox 1.23.2
Also going to /system/etc/init.d and running the script manually works,just not at startup like it meant to.

Can you please use System Manager to see if Scripts do get executed at Boot ? Alternatively Script Manager is also a good test.

If one or both fail then there's a chance your kernel does not look in init.d and you'd need to look into some sort of insmod option or continue Script manager.
The Following User Says Thank You to Perseus For This Useful Post: [ View ]
8th June 2015, 06:18 PM |#505  
bombadier's Avatar
Senior Member
Flag The Borders
Thanks Meter: 3,009
 
Donate to Me
More
Quote:
Originally Posted by Perseus

Can you please use System Manager to see if Scripts do get executed at Boot ? Alternatively Script Manager is also a good test.

If one or both fail then there's a chance your kernel does not look in init.d and you'd need to look into some sort of insmod option or continue Script manager.

Thanks for the pointers,sorry dont understand how to check with system manager? is that an app ? Am using slimsaber and ak's kernel which is meant to have support, it seems like the init.d folder is definitely not being allowed to run at boot, odd that su.d is working, as I said I can run the script and it works, just not at startup
8th June 2015, 06:36 PM |#506  
Perseus's Avatar
Forum Moderator / Recognized Developer
Atlantis
Thanks Meter: 7,885
 
Donate to Me
More
Quote:
Originally Posted by bombadier

Thanks for the pointers,sorry dont understand how to check with system manager? is that an app ? Am using slimsaber and ak's kernel which is meant to have support, it seems like the init.d folder is definitely not being allowed to run at boot, odd that su.d is working, as I said I can run the script and it works, just not at startup

Can you Try SManager AKA Script Manager ?

Meant to say [APP 2.1+] System Tuner not Manager.
The Following User Says Thank You to Perseus For This Useful Post: [ View ]
8th June 2015, 07:11 PM |#507  
bombadier's Avatar
Senior Member
Flag The Borders
Thanks Meter: 3,009
 
Donate to Me
More
Quote:
Originally Posted by Perseus

Can you Try SManager AKA Script Manager ?

Meant to say [APP 2.1+] System Tuner not Manager.

Now I found the app but still not sure how to use it to show what got ran on boot,although I suspect that it will show the scripts not being ran,will ask in ak's thread to see if its something with the kernel,
The same script with a .sh added execute on startup from the su.d folder,hope that makes sense?
Ok asked in ak's thread and he says known limitation with lollipop,that will be that then

tapatyping fae the bacon
16th June 2015, 02:43 AM |#508  
alanthehat's Avatar
Member
Thanks Meter: 10
 
More
Code:
su
mkdir /data/logs
chmod 0777 /data/logs
touch /data/logs/startup.log
Then, in every startup script:
Code:
echo $(date) $0 >> /data/logs/startup.log
will tell you what has run & when (you can substitute the name of the script for '$0')
Code:
cat /data/logs/startup.log
21st June 2015, 06:32 PM |#509  
viaimpedita's Avatar
Member
Flag Quarrata
Thanks Meter: 11
 
More
Some one can help me?
I don't nave log in data after reboot.
I try run script install-recovery.sh an install-recovery-2.sh with script manager bit i have this error :

Only position indipendent executables (PIE) are supported
I have fonetab 8 with lollipop

EDIT : i solved get runparts file from my samsung s4 mini


EDIT 2 : Also for me the script do't run at boot, why??
If i run script with script manager i have testlog i data

Thanks all

Sent from my GT-I9195 using XDA Free mobile app
17th September 2015, 12:08 AM |#510  
Junior Member
Thanks Meter: 4
 
More
working on z3c kitkat stock ! thanx so much ^^
19th September 2015, 01:11 AM |#511  
Junior Member
Flag 8gerd
Thanks Meter: 1
 
More
Quote:
Originally Posted by Ryuinferno

**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:


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




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

tnx man.it worked great on Xperia V lt25i 4.3 rooted stock ROM.
Post Reply Subscribe to Thread

Tags
app, init.d, stock kernel, terminal emulator
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes