Init.d Support

Liquidplacidity

Well-known member
Feb 8, 2011
153
20
0
Visit site
For anyone using aosp0415, I've added init.d support to the kernel, so you can run custom scripts at bootup. Do a nandroid backup before trying anything, in case something gets messed up. In your clockwork recovery, go to advanced settings and flash it over your current boot.img. Make sure you POWER OFF, not reboot. If anyone else would like support for another ROM, just let me know and i'll work on it.

Download : This is now just for testing. Anybody willing to try it out, go for it. It causes a boot loop for me though.
 
Last edited:

sdxben

Well-known member
Feb 19, 2011
122
11
0
Visit site
So this will just Automate the script I manually run with gscript after startup into the bootup of the phone?
 

Liquidplacidity

Well-known member
Feb 8, 2011
153
20
0
Visit site
So this will just Automate the script I manually run with gscript after startup into the bootup of the phone?

Exactly. All you have to do is rename your script to userinit.sh, and put it in the designated folder.(I can't remember right now, I'll have to check when my phone is done flashing), or you can just put it right in the /etc/init.d folder. You're also gonna have to set permissions. chmod 755 /system/etc/init.d/Your Script Name and after.. chown root.shell /system/etc/init.d/Your Script Name.
 

Delphis

Well-known member
Mar 21, 2011
86
12
0
Visit site
be careful .. /etc/init.d stuff often gets run before a lot of other stuff but after the init.rc scripts. I use a script in /etc/init.d to set up stuff on the data partition, for example.
 

Liquidplacidity

Well-known member
Feb 8, 2011
153
20
0
Visit site
be careful .. /etc/init.d stuff often gets run before a lot of other stuff but after the init.rc scripts. I use a script in /etc/init.d to set up stuff on the data partition, for example.

But since they execute in order in that folder, all you do is place it higher up than the previous script, so it runs after everything else.


Edit: Put the files into one of your nandroid backup folders. Start an adb shell and do the following..
cd /sdcard/clockworkmod/backup/Nameofbackup
rm nandroid.md5
md5sum *img > nandroid.md5

This will fix any MD5 errors you encounter.
 
Last edited:

Liquidplacidity

Well-known member
Feb 8, 2011
153
20
0
Visit site
Nevermind to this apparently. After everything I've tried, I just can't get the phone to boot after flashing. It gets stuck at the LG screen. It doesn't make sense though because all I added in was some code to init.rc. Anyone know how to make it load?
 

mmarz

Well-known member
Mar 9, 2011
1,130
447
0
Visit site
Nevermind to this apparently. After everything I've tried, I just can't get the phone to boot after flashing. It gets stuck at the LG screen. It doesn't make sense though because all I added in was some code to init.rc. Anyone know how to make it load?

Maybe you made a mistake repackaging it. What are you using to unpack and repack this?
 

Delphis

Well-known member
Mar 21, 2011
86
12
0
Visit site
Since we're talking about scripts and you guys know more about how Android works than me, what scripts are run on shutdown? Are the part of the boot.img too? I'm trying to understand what calls what and when :) TIA.
 

mmarz

Well-known member
Mar 9, 2011
1,130
447
0
Visit site

Delphis

Well-known member
Mar 21, 2011
86
12
0
Visit site
Yeah, I tried those as well. I could always unpack them. But repacking never turned out right for me. Try unpacking and repacking with no changes. I bet it will fail. If not, then it was just my problem, but that is the reason I never tried messing with the ramdisk.

Yea, I did find that too the other day and tried it myself when I was looking at what the init.rc script does. I was able to unpack okay too. I did not find the mkbootimg C program as I recall. I didn't know if anyone knew what gets run at shutdown. Maybe I just need to look through it more.
 

mmarz

Well-known member
Mar 9, 2011
1,130
447
0
Visit site
CyanogenMod's already have this enabled...

As far as the Optimus V is concerned, CyanogenMod cripples an already fully functioning phone. Besides the screen off animation and built in sip, it is inferior to even the stock V rom. Just my opinion.
 

lift3d

Active member
Mar 25, 2011
34
3
0
Visit site
Yea, I'm not using that and nor do I want to :) I am wanting to learn about this stuff so your comment is not helpful :>

i was talking to the OP, and maybe next time ill keep my mouth shut because it seems some people want to learn the hard way ... learning nonetheless : )
 

lift3d

Active member
Mar 25, 2011
34
3
0
Visit site
As far as the Optimus V is concerned, CyanogenMod cripples an already fully functioning phone. Besides the screen off animation and built in sip, it is inferior to even the stock V rom. Just my opinion.

I agree - which is why I am rolling back to stock + xionia

I'll wait for VM to release gingerbread in july or w/e
 

Delphis

Well-known member
Mar 21, 2011
86
12
0
Visit site
i was talking to the OP, and maybe next time ill keep my mouth shut because it seems some people want to learn the hard way ... learning nonetheless : )

My apologies for my snark. I didn't understand where you were coming from with that statement. While CyanogenMod is a great piece of work I rather like the idea of tinkering with things myself. While it may be learning about something someone else has already done, I find it helpful myself since I like to know how things work. I thought you were advocating simply giving up.
 

mmarz

Well-known member
Mar 9, 2011
1,130
447
0
Visit site
You may want to try this to get init.d support going:

[KITCHEN][APR. 22 '11] HTC Android Kitchen, v0.157 [Linux / Mac / Windows] - xda-developers

It is confirmed working on Optimus One roms. Worth a shot.


If you didn't see my other post, I found a work around to init.d support. I was mistaken before when I said Xionia had it enabled. I installed a2sd which places a script in the init.d folder and runs it magically on boot. When I tried putting other scripts in that folder, they did not run. I then edited the a2sd script and add the lines:

sh /system/etc/init.d/02script.sh
sh /system/etc/init.d/03script.sh
sh /system/etc/init.d/04script.sh
...

And now I can run the scripts I want at boot.
 
Last edited:
  • Like
Reactions: Liquidplacidity

Takenover83

Well-known member
Mar 7, 2011
499
76
0
Visit site
You may want to try this to get init.d support going:

[KITCHEN][APR. 22 '11] HTC Android Kitchen, v0.157 [Linux / Mac / Windows] - xda-developers

It is confirmed working on Optimus One roms. Worth a shot.


If you didn't see my other post, I found a work around to init.d support. I was mistaken before when I said Xionia had it enabled. I installed a2sd which places a script in the init.d folder and runs it magically on boot. When I tried putting other scripts in that folder, they did not run. I then edited the a2sd script and add the lines:

sh /system/etc/init.d/02script.sh
sh /system/etc/init.d/03script.sh
sh /system/etc/init.d/04script.sh
...

And now I can run the scripts I want at boot.
Thank's for that link mmarz. This is going to be fun lol. Another kitchen for me to play with lol.
 

Forum statistics

Threads
943,130
Messages
6,917,427
Members
3,158,832
Latest member
Akshay