mbox series

[0/2] Add /dev/std{in, out, err} symlinks to inittabs

Message ID 20180404180935.15185-1-joerg.krause@embedded.rocks
Headers show
Series Add /dev/std{in, out, err} symlinks to inittabs | expand

Message

Jörg Krause April 4, 2018, 6:09 p.m. UTC
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 busybox'
and sysvinits inittab file. 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/

Jörg Krause (2):
  busybox: add /dev/std{in,out,err} symlinks to inittab
  sysvinit: add /dev/std{in,out,err} symlinks to inittab

 package/busybox/inittab  | 4 ++++
 package/sysvinit/inittab | 6 +++++-
 2 files changed, 9 insertions(+), 1 deletion(-)