busybox: add /dev/std{in, out, err} symlinks to inittab
authorJörg Krause <joerg.krause@embedded.rocks>
Wed, 4 Apr 2018 18:09:34 +0000 (20:09 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Tue, 1 May 2018 19:53:45 +0000 (21:53 +0200)
commit456ea9871ea015fe2c5a7eb79c4762787286fa56
tree8e32ac7b989fceff284375f61f7044c040220aec
parentd5097bc00e340c83ef5124c06a8c6599d1876c27
busybox: add /dev/std{in, out, err} symlinks to inittab

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/

[Peter: redirect output (errors) to /dev/null for ro rootfs]
Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/busybox/inittab