Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sat, 03 Jan 2015 15:37:57 -0800
From: Andy Lutomirski <luto@...capital.net>
To: musl@...ts.openwall.com
Subject: Re: Failed to execute /init (error -2) for system-wide musl libc

On 12/31/2014 10:04 AM, piranna@...il.com wrote:
> On NodeOS we are having some problems creating an i686 cross-compiler
> using musl (https://github.com/NodeOS/NodeOS/pull/89).
> 
> The point is that by generating a fully statically linked Node.js
> executable it boot correctly, but by using a dynamically one we get a
> "Failed to execute /init (error -2)" error. We have crafted the
> cross-compiler following the instructions at
> http://clfs.org/view/clfs-embedded with no lack. The fact is that
> executables compiled with the cross-toolchain works on our desktops
> but they don't on QEmu, and we've added all the dynamic libraries that
> readelf request (only libc.so, libstdc++.so & libgcc_s.so). As a
> curious side note, when installing the musl-linked gcc libraries, the
> /lib/ld-musl-i386.so.1 link dissapear from the cross-toochain folder,
> but also adding it by hand all the dynamic linked executables refuse
> to load on QEmu, also a simple "Hello World" that only depends on
> libc.so :-/
> 
> We are getting out of ideas, any clue about what could be happening?
> 
> Greetings, and Happy New Year :-)
> 
> Jesús Leganés Combarro "piranna"
> 
> 

To debug init problems, it might help a lot to run your init in a
container under strace.

For example:

$ unshare -r -p -f
# strace chroot /my_rootfs /sbin/init

--Andy

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.