Skip to contentSkip to conversation

initramfs-boot: create /dev/console

PATCH In review Jacob Kroon 1 participant 2 messages Dec 25, 2018 – Jan 8, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 initramfs-boot: create /dev/console

The Yocto kernel expects a proper /dev/console to exist before running init, otherwise booting will fail with the message:

  Kernel panic - not syncing: /dev/console is missing or not a character device!
  Please ensure your rootfs is properly configured

Add similar fix as was done for initramfs-framework and initramfs-live-boot in commits

0352841cd92f6316bcac092e2fff9d28c352b36b
1b64664f0c388f41084f5db6e46e3e68c53fb6d9

---
 meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb +6 -1
index 7ae7969f5e..29ec5ec2ff 100644
@@ -9,8 +9,13 @@ S = "${WORKDIR}"
 
 do_install() {
         install -m 0755 ${WORKDIR}/init-boot.sh ${D}/init
+
+        # 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
 }
 
 inherit allarch
 
-FILES_${PN} += " /init "
+FILES_${PN} += "/init /dev/console"
Signature · 1 line
2.11.0
#1 lore raw
Quoted 38 lines · Jacob Kroon

The Yocto kernel expects a proper /dev/console to exist before running init, otherwise booting will fail with the message:

  Kernel panic - not syncing: /dev/console is missing or not a character device!
  Please ensure your rootfs is properly configured

Add similar fix as was done for initramfs-framework and initramfs-live-boot in commits

0352841cd92f6316bcac092e2fff9d28c352b36b
1b64664f0c388f41084f5db6e46e3e68c53fb6d9

---
 meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb +6 -2
index 7ae7969f5e..29ec5ec2ff 100644
@@ -9,8 +9,13 @@ S = "${WORKDIR}"
 
 do_install() {
         install -m 0755 ${WORKDIR}/init-boot.sh ${D}/init
+
+        # 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
 }
 
 inherit allarch
 
-FILES_${PN} += " /init "
+FILES_${PN} += "/init /dev/console"
--
Quoted 2 lines

2.11.0

ping