public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [MIPS] Build an embedded initramfs into mips kernel
@ 2007-12-18 20:08 Alon Bar-Lev
  2007-12-18 21:27 ` H. Peter Anvin
  0 siblings, 1 reply; 6+ messages in thread
From: Alon Bar-Lev @ 2007-12-18 20:08 UTC (permalink / raw)
  To: linux-mips, LKML

Hello,

I am trying to build a basic initramfs image into the kernel, using
the CONFIG_INITRAMFS_SOURCE. The required result is a single image
loaded into a target containing usermode application (busybox).

I use cross compile mipsel-unknown-linux-uclibc in order to build the
kernel and the initramfs's usermode.

The cpio image is created using cpio -o -H newc command.

The same configuration works with i586-pc-linux-uclibc cross compile.

printk at init/main.c::run_init_process() shows that the
kernel_execve() returns -2 (ENOENT) for /init and -14 (EFAULT) for
/*/init.

Looking at the initramfs /init is available and executable.

Any reason why I get ENOENT?
Any special procedure should be performed for mips arch?

Best Regards,
Alon Bar-Lev.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [MIPS] Build an embedded initramfs into mips kernel
  2007-12-18 20:08 [MIPS] Build an embedded initramfs into mips kernel Alon Bar-Lev
@ 2007-12-18 21:27 ` H. Peter Anvin
  2007-12-18 22:09   ` Alon Bar-Lev
  0 siblings, 1 reply; 6+ messages in thread
From: H. Peter Anvin @ 2007-12-18 21:27 UTC (permalink / raw)
  To: Alon Bar-Lev; +Cc: linux-mips, LKML

Alon Bar-Lev wrote:
> Hello,
> 
> I am trying to build a basic initramfs image into the kernel, using
> the CONFIG_INITRAMFS_SOURCE. The required result is a single image
> loaded into a target containing usermode application (busybox).
> 
> I use cross compile mipsel-unknown-linux-uclibc in order to build the
> kernel and the initramfs's usermode.
> 
> The cpio image is created using cpio -o -H newc command.
> 
> The same configuration works with i586-pc-linux-uclibc cross compile.
> 
> printk at init/main.c::run_init_process() shows that the
> kernel_execve() returns -2 (ENOENT) for /init and -14 (EFAULT) for
> /*/init.
> 
> Looking at the initramfs /init is available and executable.
> 
> Any reason why I get ENOENT?
> Any special procedure should be performed for mips arch?
> 

Make sure your /init doesn't depend on an interpreter or library which 
isn't available.

	-hpa

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [MIPS] Build an embedded initramfs into mips kernel
  2007-12-18 21:27 ` H. Peter Anvin
@ 2007-12-18 22:09   ` Alon Bar-Lev
  2007-12-18 22:11     ` H. Peter Anvin
  2007-12-18 22:47     ` Willy Tarreau
  0 siblings, 2 replies; 6+ messages in thread
From: Alon Bar-Lev @ 2007-12-18 22:09 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: linux-mips, LKML

On 12/18/07, H. Peter Anvin <hpa@zytor.com> wrote:
> Make sure your /init doesn't depend on an interpreter or library which
> isn't available.

Thank you for your answer.

I already checked.

/init is hardlink to busybox, it depends on libc.so.0 which is available at /lib

But shouldn't I get a different error code if this is the case?

Best Regards,
Alon Bar-Lev.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [MIPS] Build an embedded initramfs into mips kernel
  2007-12-18 22:09   ` Alon Bar-Lev
@ 2007-12-18 22:11     ` H. Peter Anvin
  2007-12-18 22:47     ` Willy Tarreau
  1 sibling, 0 replies; 6+ messages in thread
From: H. Peter Anvin @ 2007-12-18 22:11 UTC (permalink / raw)
  To: Alon Bar-Lev; +Cc: linux-mips, LKML

Alon Bar-Lev wrote:
> On 12/18/07, H. Peter Anvin <hpa@zytor.com> wrote:
>> Make sure your /init doesn't depend on an interpreter or library which
>> isn't available.
> 
> Thank you for your answer.
> 
> I already checked.
> 
> /init is hardlink to busybox, it depends on libc.so.0 which is available at /lib
> 
> But shouldn't I get a different error code if this is the case?

Don't think so.

	-hpa

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [MIPS] Build an embedded initramfs into mips kernel
  2007-12-18 22:09   ` Alon Bar-Lev
  2007-12-18 22:11     ` H. Peter Anvin
@ 2007-12-18 22:47     ` Willy Tarreau
  2007-12-19 18:46       ` Alon Bar-Lev
  1 sibling, 1 reply; 6+ messages in thread
From: Willy Tarreau @ 2007-12-18 22:47 UTC (permalink / raw)
  To: Alon Bar-Lev; +Cc: H. Peter Anvin, linux-mips, LKML

On Wed, Dec 19, 2007 at 12:09:46AM +0200, Alon Bar-Lev wrote:
> On 12/18/07, H. Peter Anvin <hpa@zytor.com> wrote:
> > Make sure your /init doesn't depend on an interpreter or library which
> > isn't available.
> 
> Thank you for your answer.
> 
> I already checked.
> 
> /init is hardlink to busybox, it depends on libc.so.0 which is available at /lib

Are you sure that libc.so.0 is enough and that you don't need any ld.so ?

> But shouldn't I get a different error code if this is the case?

If it does not find part of the dynamic linker or libraries, this error
makes sense to me.

You should try to build a static init with any stupid thing such as a
hello world to ensure that the problem really comes from the init and
nothing else.

Regards,
Willy


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [MIPS] Build an embedded initramfs into mips kernel
  2007-12-18 22:47     ` Willy Tarreau
@ 2007-12-19 18:46       ` Alon Bar-Lev
  0 siblings, 0 replies; 6+ messages in thread
From: Alon Bar-Lev @ 2007-12-19 18:46 UTC (permalink / raw)
  To: Willy Tarreau; +Cc: H. Peter Anvin, linux-mips, LKML

Thank you for your help.
Indeed the dynamic loader of uclibc is the cause.
I upgraded to latest uclibc-0.9.29, and finally the files was linked
against uclibc's ld.
But it did not work...
Tried to run a dynamic linked executable via static shell, and got
floating point exception.
Tried to compile toolchain and uclibc with softfloat, but still did not work.
So I moved to glibc and all works correctly.

Thank you for quick response!
I will continue the discussion at uclibc lists.

Best Regards,
Alon Bar-Lev.

On 12/19/07, Willy Tarreau <w@1wt.eu> wrote:
> On Wed, Dec 19, 2007 at 12:09:46AM +0200, Alon Bar-Lev wrote:
> > On 12/18/07, H. Peter Anvin <hpa@zytor.com> wrote:
> > > Make sure your /init doesn't depend on an interpreter or library which
> > > isn't available.
> >
> > Thank you for your answer.
> >
> > I already checked.
> >
> > /init is hardlink to busybox, it depends on libc.so.0 which is available at /lib
>
> Are you sure that libc.so.0 is enough and that you don't need any ld.so ?
>
> > But shouldn't I get a different error code if this is the case?
>
> If it does not find part of the dynamic linker or libraries, this error
> makes sense to me.
>
> You should try to build a static init with any stupid thing such as a
> hello world to ensure that the problem really comes from the init and
> nothing else.
>
> Regards,
> Willy
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-12-19 18:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-18 20:08 [MIPS] Build an embedded initramfs into mips kernel Alon Bar-Lev
2007-12-18 21:27 ` H. Peter Anvin
2007-12-18 22:09   ` Alon Bar-Lev
2007-12-18 22:11     ` H. Peter Anvin
2007-12-18 22:47     ` Willy Tarreau
2007-12-19 18:46       ` Alon Bar-Lev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox