poky/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb
Patrick Ohly cc9ff1a86a 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>
2015-09-06 15:26:24 +01:00

67 lines
1.8 KiB
BlitzBasic

SUMMARY = "Modular initramfs system"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
RDEPENDS_${PN} += "busybox"
PR = "r2"
inherit allarch
SRC_URI = "file://init \
file://finish \
file://mdev \
file://udev \
file://e2fs \
file://debug"
S = "${WORKDIR}"
do_install() {
install -d ${D}/init.d
# base
install -m 0755 ${WORKDIR}/init ${D}/init
install -m 0755 ${WORKDIR}/finish ${D}/init.d/99-finish
# mdev
install -m 0755 ${WORKDIR}/mdev ${D}/init.d/01-mdev
# udev
install -m 0755 ${WORKDIR}/udev ${D}/init.d/01-udev
# e2fs
install -m 0755 ${WORKDIR}/e2fs ${D}/init.d/10-e2fs
# debug
install -m 0755 ${WORKDIR}/debug ${D}/init.d/00-debug
# Create device nodes expected by some kernels in initramfs
# before even executing /init.
install -d ${D}/dev
mknod -m 622 ${D}/dev/console c 5 1
}
PACKAGES = "${PN}-base \
initramfs-module-mdev \
initramfs-module-udev \
initramfs-module-e2fs \
initramfs-module-debug"
FILES_${PN}-base = "/init /init.d/99-finish /dev"
SUMMARY_initramfs-module-mdev = "initramfs support for mdev"
RDEPENDS_initramfs-module-mdev = "${PN}-base"
FILES_initramfs-module-mdev = "/init.d/01-mdev"
SUMMARY_initramfs-module-udev = "initramfs support for udev"
RDEPENDS_initramfs-module-udev = "${PN}-base udev"
FILES_initramfs-module-udev = "/init.d/01-udev"
SUMMARY_initramfs-module-e2fs = "initramfs support for ext4/ext3/ext2 filesystems"
RDEPENDS_initramfs-module-e2fs = "${PN}-base"
FILES_initramfs-module-e2fs = "/init.d/10-e2fs"
SUMMARY_initramfs-module-debug = "initramfs dynamic debug support"
RDEPENDS_initramfs-module-debug = "${PN}-base"
FILES_initramfs-module-debug = "/init.d/00-debug"