ns_run_mount_dev (1034B)
1 #!/command/execlineb -S1 2 3 # /dev 4 if { s6-mount -nwt tmpfs -o nosuid,dev,mode=0755 dev $1 } 5 if { mknod -m 666 ${1}/null c 1 3 } 6 if { mknod -m 666 ${1}/full c 1 7 } 7 if { mknod -m 666 ${1}/ptmx c 5 2 } 8 if { mknod -m 644 ${1}/random c 1 8 } 9 if { mknod -m 644 ${1}/urandom c 1 9 } 10 if { mknod -m 666 ${1}/zero c 1 5 } 11 if { mknod -m 666 ${1}/tty c 5 0 } 12 if { s6-ln -sf /proc/self/fd ${1}/fd } 13 if { s6-ln -sf /proc/self/fd/0 ${1}/stdin } 14 if { s6-ln -sf /proc/self/fd/1 ${1}/stout } 15 if { s6-ln -sf /proc/self/fd/2 ${1}/stderr } 16 if { s6-ln -sf ../run/shm ${1}/shm } 17 18 # dev/shm is handled via /run symlink 19 # pts and mqueue are provided below 20 # also have some convenience dirs in place for optionally bind-mounting them 21 if { 22 mkdir 23 24 ${1}/pts 25 ${1}/mqueue 26 27 ${1}/block 28 ${1}/bus 29 ${1}/bus/usb 30 ${1}/char 31 ${1}/dri 32 ${1}/input 33 ${1}/loop 34 ${1}/net 35 ${1}/snd 36 ${1}/usb 37 38 } 39 if { mount -t devpts devpts ${1}/pts } 40 #if { s6-mount -nwt tmpfs -o nosuid,nodev,mode=1777 shm ${1}/shm } 41 if { s6-mount -nwt mqueue -o nosuid,nodev,noexec mqueue ${1}/mqueue }