[klibc] [PATCH] RFC: Running initscripts from kinit

Mike Waychison mikew at google.com
Mon May 10 12:02:34 PDT 2010

H. Peter Anvin wrote:
> On 04/28/2010 01:39 PM, Mike Waychison wrote:
>> For our platforms, we'd like to embed several different userland scripts /
>> programs that are executed before we have mounted the root filesystem as part
>> of the initramfs payload.
>> Specifically, I'd like to have multiple scripts executed before do_mounts(), so
>> I coded up this simple do_initscripts function that executes all executables
>> found in /etc/init.d in alphabetically sorted order.
>> I realize now that this could be all simplified to blindly calling:
>> system("/etc/rc.sysinit");
>> or similar though and leaving the drop directory handling to it (which is
>> easier done in shell anyway).
>> What are other folks' thoughts on the matter?  Would anyone object to calling
>> system() as part of the kinit process?
> I guess the first thing I have to ask is why it can't simply be handled
> by invoking something before kinit is run, 

I hadn't even considered doing this.  I'll try this out and send out a 
simple patch if using a script before kinit doesn't work out.


> but I don't have any
> fundamental objections to calling system() or execvp() -- if there are
> no scripts, one can simply omit the shell, too.
> 	-hpa
> _______________________________________________
> klibc mailing list
> klibc at zytor.com
> http://www.zytor.com/mailman/listinfo/klibc

More information about the klibc mailing list