mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Isaac Dunham <ibid.ag@gmail.com>
To: musl@lists.openwall.com
Subject: Re: Failed to execute /init (error -2) for system-wide musl libc
Date: Wed, 31 Dec 2014 13:55:50 -0800	[thread overview]
Message-ID: <20141231215549.GF1809@newbook> (raw)
In-Reply-To: <CAKfGGh3wYDUkHLnTnDAnP38QrJpMKDtP1Zkvm_4G_AQguWjwRg@mail.gmail.com>

On Wed, Dec 31, 2014 at 09:17:06PM +0100, piranna@gmail.com wrote:
> > I'm not clear what your root filesystem for qemu looks like
> > (the contents of /lib are the interesting part).
> 
> It's being generated by a cpio.txt file (it's being bundle into Linux
> kernel to be used as initramfs). You can check it at
> https://github.com/NodeOS/NodeOS/pull/89/files#diff-2
> 
> 
> > An ls -l of that directory would be useful.
> >
> > It *should* look like this:
> > /lib
> > /lib/ld-musl-i386.so.1 # either file or  -> /lib/libc.so
> > /lib/libc.so # only if ld-musl-i386.so.1 is symlink
> > /lib/libstdc++.so.6
> > /lib/libgcc_s.so.1
> >
> > Note the version numbers.
> 
> 
> > All of these should be chmod 0755.
> 
> Does this to be mandatory? As you can see, I'm using a 0555 permission
> on libc.so (because it's an executable) and 0444 for the other libs,
> and 0111 for the directories. This is on purposse, both for security
> and to keep users eyes out of ugly things and internal implementation
> details (they should only worry about Node.js APIs).
> 
> Anyway, this gave me and idea and reviewing the cpio.txt file I've
> found this line:
> 
> #dir /lib 0111 0 0
> 
> I uncommented it and the Hello World init has written to the console,
> so I've just recompile using Node.js as /init, and...
> 
> > [    2.255765] input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input3
> [    2.863453] Switched to clocksource tsc
> 1 +1
> 2
> > Date()
> 'Wed Dec 31 2014 20:08:31 GMT+0000 (GMT)'
> >
> 
> /me head banging in the wall X-D I'll do some more tests, but seems
> that was the issue X-D If so, probably it's a bug on the Linux kernel
> initramfs builder (gen_init_cpio), because the .cpio.gz file is being
> correctly generated and include the libraries without raising an
> error... :-/

Glad you figured it out.

This is one of the arcane details of cpio:
as originally designed, every input that you specify corresponds to
exactly one record, and every record creates at most one file/directory.
The Linux kernel follows this approach; if you create /lib/file but not
/lib in your initrd, the non-existence of /lib will result in /lib/file
not being created.


Thanks,
Isaac Dunham


  parent reply	other threads:[~2014-12-31 21:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-31 18:04 piranna
2014-12-31 19:35 ` Szabolcs Nagy
2014-12-31 19:49   ` piranna
2014-12-31 20:08     ` Matias A. Fonzo
     [not found]       ` <CAKfGGh0EoXAb7FH2pn2FW1ND7Bts8XSjj2ur-aoc6Ugbb6atNw@mail.gmail.com>
2014-12-31 21:09         ` Matias A. Fonzo
2014-12-31 21:25           ` piranna
2014-12-31 19:40 ` Isaac Dunham
2014-12-31 20:17   ` piranna
2014-12-31 20:36     ` piranna
2014-12-31 21:55     ` Isaac Dunham [this message]
2015-01-01 20:02       ` piranna
2015-01-03 23:37 ` Andy Lutomirski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141231215549.GF1809@newbook \
    --to=ibid.ag@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).