summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2015-09-03 20:42:27 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-06 15:26:24 +0100
commitcc9ff1a86a3a6f921d2a2409b9ce313b870f61db (patch)
tree0e0672d5b6ca148271d6485860e6dc0a9b5c848a
parent8215c42af1d2a2eae8e1538d5a8029bc1e221e5e (diff)
downloadpoky-cc9ff1a86a3a6f921d2a2409b9ce313b870f61db.tar.gz
initramfs-framework: create /dev/console
Some kernels, for example linux-yocto 3.19 for qemux86, fail to execute /init in an initramfs unless there is already a /dev/console char device in the initramfs. Booting then fails with: Kernel panic - not syncing: /dev/console is missing or not a character device! Please ensure your rootfs is properly configured The panic itself comes from a linux-yocto specific patch to kernel_init_freeable in init/main.c, but even without it, that function will print an error when /dev/console is missing. The kernel's Documentation/initrd.txt also mentions creating that device. It remained unclear why this is not a problem on other machines. On intel-corei7-64 from meta-intel, something (the kernel?) creates /dev/console and /dev/[012] before transfering control to the init script. In that case, creating /dev/console in advance is not necessary, but does not cause any problem either. (From OE-Core rev: 0352841cd92f6316bcac092e2fff9d28c352b36b) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb7
1 files changed, 6 insertions, 1 deletions
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb
index 89b900dba9..6c37b9aef6 100644
--- a/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb
+++ b/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb
@@ -34,6 +34,11 @@ do_install() {
34 34
35 # debug 35 # debug
36 install -m 0755 ${WORKDIR}/debug ${D}/init.d/00-debug 36 install -m 0755 ${WORKDIR}/debug ${D}/init.d/00-debug
37
38 # Create device nodes expected by some kernels in initramfs
39 # before even executing /init.
40 install -d ${D}/dev
41 mknod -m 622 ${D}/dev/console c 5 1
37} 42}
38 43
39PACKAGES = "${PN}-base \ 44PACKAGES = "${PN}-base \
@@ -42,7 +47,7 @@ PACKAGES = "${PN}-base \
42 initramfs-module-e2fs \ 47 initramfs-module-e2fs \
43 initramfs-module-debug" 48 initramfs-module-debug"
44 49
45FILES_${PN}-base = "/init /init.d/99-finish" 50FILES_${PN}-base = "/init /init.d/99-finish /dev"
46 51
47SUMMARY_initramfs-module-mdev = "initramfs support for mdev" 52SUMMARY_initramfs-module-mdev = "initramfs support for mdev"
48RDEPENDS_initramfs-module-mdev = "${PN}-base" 53RDEPENDS_initramfs-module-mdev = "${PN}-base"