浏览代码

skeleton: add /dev/fd, /dev/std{in, out, err} symlinks for static /dev on readonly rootfs

Some applications, e.g. bashs process subsitution feature, rely on the
convention of `/dev/fd` being a symbolic link to `/proc/self/fd`.

When a static /dev is used on a readonly rootfs then the runtime ln
invocations in the inittab will fail, so we need to add the symlinks at
build time.  Makedevs doesn't support creating symlinks, so instead add the
symlinks to the default skeleton.

For non-static /dev setups, the kernel will mount devtmpfs which shadows the
/dev of the rootfs, but then the runtime ln invocations in inittab will
create the symlinks.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Peter Korsgaard 7 年之前
父节点
当前提交
2b21ba2fac
共有 4 个文件被更改,包括 4 次插入0 次删除
  1. 1 0
      system/skeleton/dev/fd
  2. 1 0
      system/skeleton/dev/stderr
  3. 1 0
      system/skeleton/dev/stdin
  4. 1 0
      system/skeleton/dev/stdout

+ 1 - 0
system/skeleton/dev/fd

@@ -0,0 +1 @@
+../proc/self/fd

+ 1 - 0
system/skeleton/dev/stderr

@@ -0,0 +1 @@
+../proc/self/fd/2

+ 1 - 0
system/skeleton/dev/stdin

@@ -0,0 +1 @@
+../proc/self/fd/0

+ 1 - 0
system/skeleton/dev/stdout

@@ -0,0 +1 @@
+../proc/self/fd/1