[OLPC-devel] Re: buildrom issues

Ronald G Minnich rminnich at lanl.gov
Thu Jun 29 11:41:52 EDT 2006


ok, what I've got.

I have a working initrd. It has a statically linked kbl as /init. It 
comes up and works fine.

There is also a /bin/ash. If, on the qemu command line, I say
init=/bin/ash as part of the -append it ignores that and runs /init 
anyway. I can not convince the kernel to run some other program as init. 
  Note that all other -append directives I have tried work fine.

If I copy /bin/busybox to /init, it won't boot, 'init: applet not found' 
which makes sense in the busybox world, I just wish it would work, 
dammit :-)

Now the fun begins.

If I remove init, i.e. take the file away, so there is no init in the 
initrd file, the kernel comes up and says it can not find ram0 etc. etc.

The problem is not, I think, that it can't find the root device. The 
problem is that init is missing. No idea why this is happening, or even 
how it could happen, I've never seen it before. I will try to dig some 
more tonight.

So, I did the simple thing:

main(){execl("/bin/ash", "ash", 0);}

and I statically linked that and made it my init. It's 432K, 
unfortunately, even stripped, so I'm probably going to do it in 
assembly, unless I can figure out a way to compile it as a busybox app. 
But I can now get an initrd that will drop me into an ash on boot. Oh 
happy day!

But ... there's a weird kernel bug in all this somewhere, I'm just not 
sure where.

ron



More information about the Devel mailing list