All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH buildroot] fs/common: Create initial console device
@ 2012-10-31  9:53 Markos Chandras
  2012-10-31 22:46 ` Arnout Vandecappelle
  0 siblings, 1 reply; 3+ messages in thread
From: Markos Chandras @ 2012-10-31  9:53 UTC (permalink / raw)
  To: buildroot

From: Markos Chandras <markos.chandras@imgtec.com>

A /dev/console node must be present in rootfs when the Linux kernel
boots otherwise the kernel will print the following warning:
"Warning: unable to open an initial console"

This is because when we use an initramfs along with devtmpfs, the /dev
directory is not populated at this point. This can cause problems when a
program (e.g ldso with early debugging enabled) opens a standard file
descriptor for read/write before these descriptors are actually created by
the init process later on.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
---
 fs/common.mk |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/fs/common.mk b/fs/common.mk
index debf7db..d7383d1 100644
--- a/fs/common.mk
+++ b/fs/common.mk
@@ -55,6 +55,12 @@ endif
 	echo "$(HOST_DIR)/usr/bin/makedevs -d $(FULL_DEVICE_TABLE) $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
 endif
 	echo "$(ROOTFS_$(2)_CMD)" >> $(FAKEROOT_SCRIPT)
+	# create initial console if devtmpfs is used
+ifeq ($(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS),y)
+	echo -e 'pushd $(TARGET_DIR)/dev/ > /dev/null 2>&1' >> $(FAKEROOT_SCRIPT)
+	echo -e '/bin/mknod -m 622 console c 5 1' >> $(FAKEROOT_SCRIPT)
+	echo -e 'popd > /dev/null 2>&1' >> $(FAKEROOT_SCRIPT)
+endif
 	chmod a+x $(FAKEROOT_SCRIPT)
 	$(HOST_DIR)/usr/bin/fakeroot -- $(FAKEROOT_SCRIPT)
 	- at rm -f $(FAKEROOT_SCRIPT) $(FULL_DEVICE_TABLE)
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-01  9:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-31  9:53 [Buildroot] [PATCH buildroot] fs/common: Create initial console device Markos Chandras
2012-10-31 22:46 ` Arnout Vandecappelle
2012-11-01  9:22   ` Markos Chandras

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.