summaryrefslogtreecommitdiff
path: root/scripts/devfs.sh.in
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-04-06 18:40:09 +0200
committerDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-04-07 01:33:58 +0200
commit4f4a377d7acb555193566db3ee459adc19e2e6a5 (patch)
treea5b334c458c48864b469dcd60ae9a4aa35ea3739 /scripts/devfs.sh.in
parent212d3022e7dc9117351c09d9154d2360fe1eb91f (diff)
Add VFS setup scripts
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Diffstat (limited to 'scripts/devfs.sh.in')
-rw-r--r--scripts/devfs.sh.in21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/devfs.sh.in b/scripts/devfs.sh.in
new file mode 100644
index 0000000..a39d3ea
--- /dev/null
+++ b/scripts/devfs.sh.in
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+@SBINPATH@/mount -t devtmpfs none /dev
+
+[ -c /dev/console ] || @SBINPATH@/mknod -m 600 /dev/console c 5 1
+[ -c /dev/tty ] || @SBINPATH@/mknod -m 666 /dev/tty c 5 0
+[ -c /dev/null ] || @SBINPATH@/mknod -m 666 /dev/null c 1 3
+[ -c /dev/kmsg ] || @SBINPATH@/mknod -m 660 /dev/kmsg c 1 11
+[ -e /dev/fd ] || @BINPATH@/ln -snf /proc/self/fd /dev/fd
+[ -e /dev/stdin ] || @BINPATH@/ln -snf /proc/self/fd/0 /dev/stdin
+[ -e /dev/stdout ] || @BINPATH@/ln -snf /proc/self/fd/1 /dev/stdout
+[ -e /dev/stderr ] || @BINPATH@/ln -snf /proc/self/fd/2 /dev/stderr
+[ -e /proc/kcore ] && @BINPATH@/ln -snf /proc/kcore /dev/core
+
+@BINPATH@/mkdir -p /dev/mqueue -m 1777
+@BINPATH@/mkdir -p /dev/pts -m 0755
+@BINPATH@/mkdir -p /dev/shm -m 1777
+
+@SCRIPTDIR@/trymount.sh "/dev/mqueue" "mqueue" "noexec,nosuid,nodev"
+@SCRIPTDIR@/trymount.sh "/dev/pts" "devpts" "noexec,nosuid,gid=5,mode=0620"
+@SCRIPTDIR@/trymount.sh "/dev/shm" "tmpfs" "noexec,nosuid,nodev,mode=1777"