From patchwork Wed Apr 4 18:09:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=B6rg_Krause?= X-Patchwork-Id: 895098 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=embedded.rocks Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40GYsK6QxTz9s0R for ; Thu, 5 Apr 2018 04:10:13 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id B285288C81; Wed, 4 Apr 2018 18:10:10 +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 L3uXpyyp7gFQ; Wed, 4 Apr 2018 18:10:06 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id A93B488C63; Wed, 4 Apr 2018 18:10:06 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 614C61CF102 for ; Wed, 4 Apr 2018 18:09:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 5CD6389FD2 for ; Wed, 4 Apr 2018 18:09:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J534Ck4sEfgh for ; Wed, 4 Apr 2018 18:09:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.141]) by hemlock.osuosl.org (Postfix) with ESMTPS id 481D68A14A for ; Wed, 4 Apr 2018 18:09:46 +0000 (UTC) Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 9DC32211ED for ; Wed, 4 Apr 2018 20:09:43 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 40GYrh5Rfjz9rxS; Wed, 4 Apr 2018 20:09:40 +0200 (CEST) Received: from mail.embedded.rocks ([127.0.0.1]) by localhost (mail.embedded.rocks [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id LX0-2zx0It9R; Wed, 4 Apr 2018 20:09:39 +0200 (CEST) Received: from nzxt.fritz.box (port-92-195-105-32.dynamic.qsc.de [92.195.105.32]) (Authenticated sender: joerg.krause@embedded.rocks) by mail.embedded.rocks (Postfix) with ESMTPSA; Wed, 4 Apr 2018 20:09:39 +0200 (CEST) From: =?utf-8?q?J=C3=B6rg_Krause?= To: buildroot@buildroot.org Date: Wed, 4 Apr 2018 20:09:34 +0200 Message-Id: <20180404180935.15185-2-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180404180935.15185-1-joerg.krause@embedded.rocks> References: <20180404180935.15185-1-joerg.krause@embedded.rocks> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/2] busybox: add /dev/std{in, out, err} symlinks to inittab X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 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" Some applications, e.g. bashs process subsitution feature, rely on the convention of `/dev/fd` being a symbolic link to `/proc/self/fd`. This symbolic link and his companions `/dev/std*` are created by (e)udev [1], but not by mdev, resulting in the following error when using the following expression: ``` bash: /dev/fd/62: No such file or directory ``` For the sake of simplicity, lets fix this by creating the symlinks in inittab. It is only really needed if eudev isn't used, but it doesn't really hurt to create them even if eudev will recreate them afterwards. Note, that we do not create the symlink `/dev/core` as `/proc/kcore` is not available on all platforms, e.g. ARM, and the feature is not much appreciated [2]. [1] https://github.com/gentoo/eudev/blob/8943501993322c59a6eb5be456b0d716aafff21e/src/shared/dev-setup.c#L35-L40 [2] https://lwn.net/Articles/45315/ Signed-off-by: Jörg Krause --- package/busybox/inittab | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/busybox/inittab b/package/busybox/inittab index 3f49f6bd7a..0f6b8cbe37 100644 --- a/package/busybox/inittab +++ b/package/busybox/inittab @@ -19,6 +19,10 @@ ::sysinit:/bin/mkdir -p /dev/pts ::sysinit:/bin/mkdir -p /dev/shm ::sysinit:/bin/mount -a +::sysinit:/bin/ln -sf /proc/self/fd /dev/fd +::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin +::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout +::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr ::sysinit:/bin/hostname -F /etc/hostname # now run any rc scripts ::sysinit:/etc/init.d/rcS