Originally Posted by osm0sis
I do actually prefer to keep things inside the ramdisk when possible, but that's just to avoid conflicting with ROM implementations where possible.
Here's what I've reduced that script you linked to:
/system/bin/sh -c "for i in `find /system/etc/init.d -type f | sort`; do if [ ! -d $i ] && [ -x $i ]; then logwrapper $i; fi; done;"
Going to have to experiment to see if I can just plop that on a service and have it work, which would be cool, since that would avoid the need for anything external whatsoever. Then the question is when to inject or not; there's no point in duplicating a ROM implementation or previous injection of something similar. Maybe a grep for "run-parts /system/etc/init.d" or "sysinit" would have it covered.. Kinda makes me not like the full injection idea again. Thoughts?
The simplest way to add init.d support to the ramdisk would probably be:
service sysinit /system/bin/busybox run-parts /system/etc/init.d
Any standard implementation of init.d will include "busybox run-parts /system/etc/init.d" because that's how it's processed. Some implementations use logwrapper as well, but I don't believe that's necessary for it to work with the other parameters specified.
The enhanced init.d was just an idea, but no modifications other than to the ramdisk should be necessary for standard init.d scripting to be added.
EDIT: I don't recommend grepping for "sysinit" for the simple reason that I've seen implementations that call it "userinit" instead. The service can really be named anything.