All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Ohly <patrick.ohly@intel.com>
To: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: qemu + initramfs
Date: Tue, 25 Aug 2015 14:27:18 +0200	[thread overview]
Message-ID: <1440505638.24929.64.camel@intel.com> (raw)
In-Reply-To: <1440417012.3543.16.camel@intel.com>

On Mon, 2015-08-24 at 13:50 +0200, Patrick Ohly wrote:
> However, that failed initially with:
[...]
>         Kernel Offset: 0x0 from 0xc1000000 (relocation range: 0xc0000000-0xd07dffff)
>         ---[ end Kernel panic - not syncing: /dev/console is missing or not a character device!
>         Please ensure your rootfs is properly configured
> 
> Searching for the kernel panic led me to:
> http://stackoverflow.com/questions/10437995/initramfs-built-into-custom-linux-kernel-is-not-running
> 
> The hint given there (/dev/console must exist in the initramfs because
> the kernel opens it before executing /init) worked for like this:
> 
> diff --git a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
> b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
> index b54cb61..4066beb 100644
> --- a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
> +++ b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
> @@ -11,9 +11,12 @@ S = "${WORKDIR}"
>  
>  do_install() {
>          install -m 0755 ${WORKDIR}/init-live.sh ${D}/init
> +        install -d ${D}/dev
> +        mknod -m 622 ${D}/dev/console c 5 1
> +        mknod -m 622 ${D}/dev/tty0 c 4 0
>  }
>  
> -FILES_${PN} += " /init "
> +FILES_${PN} += " /init /dev "
>  
>  # Due to kernel dependency
>  PACKAGE_ARCH = "${MACHINE_ARCH}"
> 
> But I am surprised that I had to make such an adjustment. Isn't that
> something that also occurs in other build configurations? Do I perhaps
> miss something which avoids the issue (some kernel configuration
> perhaps)?

This is getting weirder. I checked MACHINE=intel-corei7-64 from
meta-intel with a regular live image (i.e. without my fix above). Some
additional ls debugging commands at the top of the init script show
that /dev/console exists, with a time that changes during each boot.
There's also /dev/0 -> /dev/console and similar entries for 1 and 2.

I know that /dev/ is from the rootfs (i.e. no tmpfs mounted on top of
it) because I still see a fake /dev/rootfs-dev file that I created in
the core-image-minimal-initramfs.

It almost looks like an overlay created or modified file system by the
kernel (because it's there before /init does anything), but I have no
idea what feature might responsible for that. Any hints?

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.





      parent reply	other threads:[~2015-08-25 12:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-24 11:50 qemu + initramfs Patrick Ohly
2015-08-24 12:05 ` Patrick Ohly
2015-08-24 15:36   ` Christopher Larson
2015-08-25 12:27 ` Patrick Ohly [this message]

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=1440505638.24929.64.camel@intel.com \
    --to=patrick.ohly@intel.com \
    --cc=openembedded-core@lists.openembedded.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.