From 49774766cb2f9a8313b10133d66ab87703de72d1 Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Mon, 1 Jun 2020 17:57:12 +0300 Subject: init: use link function to link IO devices --- rc.boot | 7 +++++++ rc.lib | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/rc.boot b/rc.boot index ac5b40e..8412326 100755 --- a/rc.boot +++ b/rc.boot @@ -22,6 +22,13 @@ out "Mounting pseudo filesystems..."; { mnt mode=0620,gid=5,nosuid,noexec devpts devpts /dev/pts mnt mode=1777,nosuid,nodev tmpfs shm /dev/shm + + { + link /proc/self/fs /dev/fd + link fd/0 /dev/stdin + link fd/1 /dev/stdout + link fd/2 /dev/stderr + } 2>/dev/null } out "Parsing kernel commandline..."; { diff --git a/rc.lib b/rc.lib index 1df98ff..b096ec7 100644 --- a/rc.lib +++ b/rc.lib @@ -75,6 +75,11 @@ device_helper() { esac } +link() { + ln -sf "$1" "$2" + printf '%s ==> %s\n' "$2" "$1" +} + mounted() { [ -e "$1" ] && [ -f /proc/mounts ] && -- cgit v1.2.3