linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: klightspeed@killerwolves.net (Ben Peddell)
To: linux-arm-kernel@lists.infradead.org
Subject: problems with external initramfs passed to device tree kernel
Date: Mon, 06 Aug 2012 19:25:09 +1000	[thread overview]
Message-ID: <501F8D75.8070108@killerwolves.net> (raw)
In-Reply-To: <CAB9O=CMADa26benQCkEoLOKKTGNeExjvFeVkFe4HLVi-W=o=Jg@mail.gmail.com>

On 13/06/2012 9:12 AM, John Linn wrote:
> I'm not sure this is specific to ARM, but that's what I'm on so I 
> thought I'd ask.  I'm also running a device tree kernel.  I've
> tried it on 3.0 and 3.3 kernels.
> 
> I'm seeing where I have to remove CONFIG_BLK_DEV_RAM from the
> kernel to get it to boot with an external initramfs image. It says
> the image is not?good (junk in it), but it boots.  The same image
> boots fine when built into the kernel using INITRAMFS_SOURCE, even
> with BLK_DEV_RAM in the kernel.
> 
> I've done quite a bit of digging at the init/initramfs.c and it's
> not obvious to me where the issue lies (user error probably).
> 
> Any thoughts would be appreciated.

If the size of the initramfs image is set in either devicetree or the
initrd= kernel parameter, and is larger than the actual initramfs
image is, then the kernel throws the image away if it's followed by
anything other than null bytes.  U-boot doesn't initialize the RAM to
zeroes, so the initramfs will be followed by whatever was in RAM -
usually 0xFF with zero bits here and there, or the decayed contents
before the previous shutdown if the machine was off for a very short time.

I will follow up with a patch that should remedy this issue.  Please
let me know if there's a better way to do this.

-- 
Ben Peddell
IT Support Bowen, Collinsville and Proserpine Catholic schools
http://klightspeed.killerwolves.net/

  reply	other threads:[~2012-08-06  9:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-12 23:12 problems with external initramfs passed to device tree kernel John Linn
2012-08-06  9:25 ` Ben Peddell [this message]
2012-08-06  9:32   ` [PATCH] initramfs: handle trailing junk after valid image Ben Peddell
2012-08-06 19:05     ` Sergei Shtylyov
2012-08-07  2:02       ` [PATCH 1/1] initramfs: handle trailing junk after valid image (try 2) Ben Peddell

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=501F8D75.8070108@killerwolves.net \
    --to=klightspeed@killerwolves.net \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).