From patchwork Wed Oct 31 09:53:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markos Chandras X-Patchwork-Id: 195805 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id B9A4D2C00A7 for ; Wed, 31 Oct 2012 20:54:08 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id BA87A10B8C4; Wed, 31 Oct 2012 09:54:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Hdanp4M71vGQ; Wed, 31 Oct 2012 09:53:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id BF54410B8B4; Wed, 31 Oct 2012 09:53:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id F1AC18F74A for ; Wed, 31 Oct 2012 09:54:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 488918D154 for ; Wed, 31 Oct 2012 09:54:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7m82TR0cyMAv for ; Wed, 31 Oct 2012 09:54:00 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from multi.imgtec.com (multi.imgtec.com [194.200.65.239]) by whitealder.osuosl.org (Postfix) with ESMTPS id 438798D160 for ; Wed, 31 Oct 2012 09:54:00 +0000 (UTC) From: Markos Chandras To: Date: Wed, 31 Oct 2012 09:53:52 +0000 Message-ID: <1351677232-14959-1-git-send-email-markos.chandras@gmail.com> X-Mailer: git-send-email 1.7.1 X-OriginalArrivalTime: 31 Oct 2012 09:53:56.0846 (UTC) FILETIME=[A4C6A8E0:01CDB74D] MIME-Version: 1.0 X-SEF-Processed: 7_3_0_01181__2012_10_31_09_53_58 Subject: [Buildroot] [PATCH buildroot] fs/common: Create initial console device X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net From: Markos Chandras 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 --- 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) -@rm -f $(FAKEROOT_SCRIPT) $(FULL_DEVICE_TABLE)