From patchwork Wed Apr 4 18:09:35 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: 895099 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.133; helo=hemlock.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 hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40GYsL5lnqz9s0p for ; Thu, 5 Apr 2018 04:10:14 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 589E58AB33; Wed, 4 Apr 2018 18:10:07 +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 W9hxV+qW-a4Y; Wed, 4 Apr 2018 18:10:05 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 7B4088A4BC; Wed, 4 Apr 2018 18:10:05 +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 455021C2258 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 4237E8A1AB 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 9f+OnNJCktuO 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 44D5889FD2 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 7661320E5C 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 40GYrj2Z83z9rxW; 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 bwOze-wqgMT5; 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:35 +0200 Message-Id: <20180404180935.15185-3-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 2/2] sysvinit: 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/sysvinit/inittab | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package/sysvinit/inittab b/package/sysvinit/inittab index fad91eae8b..608aabce07 100644 --- a/package/sysvinit/inittab +++ b/package/sysvinit/inittab @@ -9,7 +9,11 @@ si1::sysinit:/bin/mount -o remount,rw / si2::sysinit:/bin/mkdir -p /dev/pts si3::sysinit:/bin/mkdir -p /dev/shm si4::sysinit:/bin/mount -a -si5::sysinit:/bin/hostname -F /etc/hostname +si5::sysinit:/bin/ln -sf /proc/self/fd /dev/fd +si6::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin +si7::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout +si8::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr +si9::sysinit:/bin/hostname -F /etc/hostname rcS:12345:wait:/etc/init.d/rcS # S0:1:respawn:/sbin/getty -L ttyS0 115200 vt100 # GENERIC_SERIAL