[Vibrant Android Development] ttabbal:
OK, this is a little strange, but I think the idea is useful for people that want to mod the ramdisk but don't want to fiddle with compilers and such. It requires a kernel, so I'm including a proof of concept here. However, once the basic support is in a kernel, you can change anything about the ramdisk and the boot process WITHOUT changing your kernel!

For example, say you want to change init.rc... You can do that, and if it fails to boot, if you stored it on your external SD card, just pop out the card and boot up, the change won't be able to copy over at boot, so you are back where you started. No odin, no kernel mod. :)

The basic idea is simple. It runs init.d style scripts (if found) BEFORE the android init process starts up. This allows you to change literally anything in the ramdisk without the hassle of building a kernel. You can replace the /sbin/init binary if you want to, whatever.

This also means you could install and/or upgrade a lagfix, even voodoo, by copying a single file to /system/etc/init.d and rebooting. :)

This is more useful for devs I think than for end users, but perhaps users will find it useful.

NOTE: This is DANGEROUS STUFF. If you store your files in a world-writable location like /sdcard, ANY app could change your ramdisk! As it is, any root app can do it with this change. Anything run in the pre-init scripts is, by definition, run as root. So watch your permissions and don't store stuff used by the pre-init scripts in a FAT filesystem. EXT2/3/4 and RFS will work fine if you set them to root-write only. If in doubt, use "chmod 700 <file>". All of this should be obvious to most people here, but I think it's important to point out just in case.

This is based on Unhelpful's 1.7 kernel. It runs great on my Vibrant. There is one known bug, it reverts the locale to en_GB on boot, which is mildly irritating. I can't figure out why this happens. If someone knows, please post. :) I did write a simple app that switches it back to en_US using MoreLocale 2 (market) on boot, if people want it.

Credit to Unhelpful (kernel source and nice build scripts), JAC and Supercurio (examples for setting up the ramdisk properly for this sort of thing).

All the init scripts live in /system/etc/init.d. P*** are pre-init scripts. E*** are early-init scripts run before /data and /dbdata are mounted, allowing you to override mount options and such at that point, S*** are standard init scripts that launch right before the Android OS starts up, so the full environment is available to them. So you now have 3 hooks to start init scripts up. The boot process will wait for them to complete, so don't do anything that takes a long time if you don't have to, or start it in the background with "cmd &" or similar.

http://www.tabbal.net/files/t959-ttabbal-v1.0.tar

Flash with Odin. I'll consider putting up a ZIP later. Please, be at a computer with Odin and a known good kernel when you do this, this should be considered beta at best. Hardware locked phones should probably avoid this as well. Also, disable voodoo before messing with this, it does not include the voodoo script. If you really want to try it, you should be able to copy it to the init.d directory, but it would be better to wait a bit. :)

If it works well, hopefully other kernel devs will include the framework. I may also start posting updates from Unhelpful's git tree if there is interest as well now that I have a decent environment set up. See his thread in the Captivate forum for details on what changes have been done. OC/UV is supported, but I haven't worked with it much. You have to enable it by creating a config file and putting it on the phone. I'd recommend the external SD card in case you have a problem with a bad config, so you can pull the card and boot without clock changes. The OC/UV config can also be changed at runtime.

There is no need to pre-flash anything, and init.d need not exist or have any scripts in it. The system will boot fine without them.

If you try it, please post your thoughts. I'd like to see if there is interest for this line of work. If you don't understand a thing I said above, please don't install it. :p

Updates:

http://www.tabbal.net/files/Kernel-ttabbal-v1.2.zip

http://www.tabbal.net/files/Kernel-ttabbal-v1.4.zip

http://www.tabbal.net/files/z4mod-ttabbal-v1.1.zip