Gentoo Archives: gentoo-embedded

From: chris@××××××××××××.com
To: gentoo-embedded@l.g.o
Subject: Re: [gentoo-embedded] gentoo baselayout "Attempted to kill init"
Date: Fri, 22 Apr 2011 14:04:45
Message-Id: cf9cb6b7c971643375cf9bd8af2cc28e@basementcode.com
In Reply to: Re: [gentoo-embedded] gentoo baselayout "Attempted to kill init" by "Jörg Faschingbauer"
1 On Fri, 22 Apr 2011 08:00:35 +0200, Jörg Faschingbauer
2 <joerg.faschingbauer@×××.at> wrote:
3 > On Thu, 2011-04-21 at 16:18 -0500, chris@××××××××××××.com wrote:
4 >> I've got a filesystem created with the following toolchain: (from
5 >> crossdev)
6 >>
7 >> arm-unknown-linux-gnu-
8 >>
9 >> with
10 >>
11 >> arm-unknown-linux-gnu-emerge system
12 >> arm-unknown-linux-gnu-emerge baselayout
13 >>
14 >> I created the kernel separately, and was able to boot it with
15 >> another
16 >> filesystem that was created by somebody else.
17 >>
18 >> During the boot process the kernel says "Attempted to kill init"
19 >> because the /init program exited for some reason.
20 >> The problem is that I can't get any other error from the init
21 >> program.
22 >> I have no idea why it's exiting. It could be a missing library,
23 >> segfault
24 >> or bad invocation, so I have no idea where to start.
25 >
26 > Provided that /init is an executable:
27 >
28 > If the instruction set that the root filesystem was compiled for
29 > doesn't
30 > match your architecture's, then it's an "illegal instruction" signal
31 > that bites init. This usually happens quite early, before any
32 > configuration error is seen.
33 >
34 > You can verify this by building your own busybox-only tree with the
35 > same
36 > toolchain you built the kernel with. Choose a static build
37 > (CONFIG_STATIC, "Busybox Settings"/"Build Options"/"blah static
38 > blah").
39 > Copy init and all that it needs (glibc?) over from your real rootfs
40 > into
41 > your small tree. Boot the kernel into the small tree, passing it
42 > init=/bin/sh (which is busybox). Call /init and see what happens.
43 >
44 > Alternatively, you could augment your tree with busybox, by
45 > installing
46 > it into it. Boot into the tree, but with init=/bin/sh (the augmented
47 > busybox).
48 >
49 > Have fun,
50 > Joerg
51
52 You were right about the "Illegal Instruction". I booted the working
53 filesystem and chrooted into the new one where I was able to play around
54 with the "broken" init file.
55
56 I'm guessing I stuck a bad flag in make.conf, since the same compiler
57 was able to produce a working kernel.
58
59 Thanks.