[Techtalk] problem loading a kernel

Rajiv Saxena raj_linux at yahoo.com
Thu Sep 6 18:18:28 EST 2001


--- Almut Behrens <almut_behrens at yahoo.com> wrote:

> I assume you do have the executable bit set, and
> normally the sash
> should be linked statically, so there *should* be no
> issue with
> loading libraries... (after all, the "stand alone"
> aspect is the
> main purpose of using the sash). But who knows where
> you got that
> sash from, and if it's been built properly -- so you
> might want to
> be paranoid and check with ldd whether there really
> aren't any
> dependencies.
There are no dependencies.
 
> Another coarse test would be to mount your ramdisk
> image somewhere,
> and do a chroot to that directory (because of
> absolute paths).
> Then, see if you can run your /bin/init (sash) in
> that chroot-ed
> environment.
> If that works, this doesn't necessarily mean that it
> would work at
> boot time. OTOH, if that already fails, the kernel
> will certainly
> have the same problem.
Well,done that too. sash works well when ramdisk is
mounted somewhere else.
 
> Something else to try would be to mess around with
> the kernel source
> and temporarily add a few debug print-statements to
> yield some more
> info about why the execve() fails.
>> 
>   if (execute_command)
>          
> execve(execute_command,argv_init,envp_init);
>   printk("execve(custom init) failed: errno = %d\n",
> errno); /* debug */
>   execve("/sbin/init",argv_init,envp_init);
>   printk("execve(/sbin/init) failed: errno = %d\n",
> errno);
>   execve("/etc/init",argv_init,envp_init);
>   printk(... etc. ...);
>   execve("/bin/init",argv_init,envp_init);
>   execve("/bin/sh",argv_init,envp_init);
>   panic("No init found.  Try passing init= option to
> kernel.");
> 
> (in case the symbol errno isn't known, just
> "#include <linux/errno.h>")
> For an interpretation of the errno's you'll get, see
> "man execve",
> "man errno", or take a look at the errno.h header
> file(s).
This is exactly what I did to get the error
description..put in a few printks. The return value of
execve() is ENOEXEC,which actually means that the file
is not in the recognised format or for a different
architecture.
sash is a ELF executble,which means no problem.
I think I need to get sash for MIPS...probably.

Thanks,
<raj>




__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com




More information about the Techtalk mailing list