Init.d Support

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.

Thanks. As soon as I got my optimus, this kitchen is what I used to make my own first custom ROM. They mustve updated it though because the original didn't have the init.d support option in it. *Hits thank button*
 
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.

The only way to "enable" init.d support with an Android kernel is to fake it in init.rc. I say fake, because init is hard-coded and we don't have the same freedom to manipulate the init and shutdown process as in a standard linux system. There are a couple of tricks. One is to have init.rc call a "busybox run-parts" on the init.d folder towards the end of the init.rc file (not at the very end, closer to where it invokes init.goldfish).

Links2SD simulates an init.d mount of sdext by putting it in /system/etc/install-recovery.sh, which is itself invoked by init.rc. This is also why it's not a good idea to disable init.rc calling that file in a ROM or Kernel zip or to have that file blank in the kernel ramdisk (since the blank install-recovery.sh will overwrite the existing customized file on every boot). Knowing this, it is possible to add just about any personalized init stuff in the install-recovery.sh file, or put "/system/xbin/busybox run-parts /system/etc/init.d" as the last line in install-recovery.sh to execute all the scripts in that folder. This is the approach I'm probably going to take with the next release of Bumblebee.

One lingering problem is how to perform actions on shutdown. I don't believe this has ever been actually solved. About the only thing I believe that can be done reliably on shutdown is to unmount an ext partition by taking advantage of the fact that VolumeManager unmounts every volume that is registered by vold. The vold mounts can me specified in vold.fstab. I've only found reference to using it in an emulator, so I still need to do some research here. Luckily, vold is part of the android kernel system. If you adb shell and type "vdc volume list" is will show the sdcard, which is why the sdcard is unmounted cleanly on shutdown. But to get the ext partitions unmounted cleanly as well will require registering them with vold. /added to long list of thing to do :)
 
Last edited:
Well this is weird. I was using the kitchen to edit the aosp415 ROM, and as I clicked add init.d support, I got this message. "CyanogenMod sysinit for /etc/init.d is already enabled in init.rc!" Apparently it already had init.d support enabled? Now I'm confused. Why does it bootloop? I tried mmarz's way and that didn't even work for some reason.

Edit: When I go into the working folder information, it says "BusyBox run-parts support : NO". That's supposedly the way to use init.d. It says it has support, but it doesn't? Now it really doesn't make sense.
 

Trending Posts

Members online

Forum statistics

Threads
956,588
Messages
6,968,981
Members
3,163,580
Latest member
Adamsapple