Thread (4 messages) 4 messages, 2 authors, 2015-08-25

Re: qemu + initramfs

From: Patrick Ohly <hidden>
Date: 2015-08-25 12:27:20

On Mon, 2015-08-24 at 13:50 +0200, Patrick Ohly wrote:
However, that failed initially with:
[...]
quoted hunk ↗ jump to hunk
        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.



Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help