The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Nick Bowler <nbowler@elliptictech.com>
To: Andreas Mohr <andi@lisas.de>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] FIX IT
Date: Mon, 16 Nov 2009 15:35:45 -0500	[thread overview]
Message-ID: <20091116203545.GA2028@emergent.ellipticsemi.com> (raw)
In-Reply-To: <20091116194015.GA13820@rhlx01.hs-esslingen.de>

On 20:40 Mon 16 Nov     , Andreas Mohr wrote:
> ChangeLog: Partially fix B0RKEN kernel usability

Improving error messages is a good idea, but I'm not sure how much this
patch actually helps.

> --- linux-2.6/init/main.c.orig	2009-11-16 20:13:08.000000000 +0100
> +++ linux-2.6/init/main.c	2009-11-16 20:14:51.000000000 +0100
> @@ -846,7 +846,8 @@ static noinline int init_post(void)
>  	run_init_process("/bin/init");
>  	run_init_process("/bin/sh");
>  
> -	panic("No init found.  Try passing init= option to kernel.");
> +	panic("No init found.  Try passing init= option to kernel. "
> +	      "See Linux Documentation/init.txt for guidance.");

I think that the people who know where to look after reading this are
mainly the people who don't need to read that file, with one exception -
point (C) later on.

> +OK, so you've got this pretty unintuitive message (currently located
> +in init/main.c) and are wondering what the H*** went wrong.
> +Some high-level reasons for failure (listed roughly in order of execution)
> +to load the init binary are:
> +A) Unable to mount root FS

Whenever the root FS has been unable to mount, I've always received an
error message that included the string "VFS: Unable to mount root fs".
Has this changed recently?  What sort of setup causes one to receive "No
init found" instead?

> +B) init binary doesn't exist on rootfs
> +C) other requirements not met

The introduction to this list already stated that it is not exhaustive,
so this entry adds no new information.  After reading the detailed
explanation, "broken console device" seems more appropriate here.

> +D) binary exists but dependencies not available
> +E) binary cannot be loaded

To me, (B), (D) and (E) are the same thing, and could just be "binary
cannot be loaded".  The details can be expanded upon in the next
section.

> +Detailed explanations:
<snip>
> +C) Possibly a conflict in console= setup --> initial console unavailable.
> +E.g. some serial consoles are unreliable due to serial IRQ issues (e.g. missing
> +interrupt-based configuration).
> +Try using a different console= device or e.g. netconsole=.

This appears to be by far the most interesting point in this file, since
it clarifies that "No init found." might be caused by a configuration
problem which seems completely unrelated to loading init.

> +D) e.g. crucial library dependencies of the init binary such as
> +/lib/ld-linux.so.2 missing or broken. Use readelf -d <INIT>|grep NEEDED
> +to find out which libraries are required.
> +E) make sure the binary's architecture matches your hardware.
> +E.g. i386 vs. x86_64 mismatch, or trying to load x86 on ARM hardware.
> +Or did you try loading a non-binary file here!?! (shell script?)

Linux is perfectly happy to load a shell script as init, so this comment
is very misleading.

-- 
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)


  reply	other threads:[~2009-11-16 20:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-16 19:40 [PATCH] FIX IT Andreas Mohr
2009-11-16 20:35 ` Nick Bowler [this message]
2009-11-17 20:40   ` Andreas Mohr
2009-12-27 15:03     ` [PATCH] Improve usability in case of init binary failure Andreas Mohr
2010-02-02  7:10       ` David Rientjes
2010-02-02 17:20         ` Andrew Morton
2010-02-02 17:48           ` Andreas Mohr

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=20091116203545.GA2028@emergent.ellipticsemi.com \
    --to=nbowler@elliptictech.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@lisas.de \
    --cc=linux-kernel@vger.kernel.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox