3 # Provides: mountdevsubfs
4 # Required-Start: mountkernfs
9 # Short-Description: Mount special file systems under /dev.
10 # Description: Mount the virtual filesystems the kernel provides
11 # that ordinarily live under the /dev filesystem.
14 # This script gets called multiple times during boot
20 [ -f /etc/default/devpts ] && . /etc/default/devpts
23 [ -f /etc/default/tmpfs ] && . /etc/default/tmpfs
27 . /lib/lsb/init-functions
28 . /lib/init/mount-functions.sh
32 # Mount a tmpfs on /dev/shm
35 [ "${SHM_SIZE:=$TMPFS_SIZE}" ] && SHM_OPT=",size=$SHM_SIZE"
36 domount tmpfs shmfs /dev/shm tmpfs -onosuid,nodev$SHM_OPT
39 # Mount /dev/pts. Create master ptmx node if needed.
41 # As of 2.5.68, devpts is not automounted when using devfs. So we
42 # mount devpts if it is compiled in (older devfs didn't require it
43 # to be compiled in at all).
45 if [ "$KERNEL" = Linux ]
48 # Since kernel 2.5.something, devfs doesn't include
49 # a standard /dev/pts directory anymore. So if devfs
50 # is mounted on /dev we need to create that directory
55 if grep -qs '/dev devfs' /proc/mounts
57 mkdir --mode=755 /dev/pts
58 [ -x /sbin/restorecon ] && /sbin/restorecon /dev/pts
65 mknod --mode=666 /dev/ptmx c 5 2
69 log_warning_msg "Failed making node /dev/ptmx with error code ${ES}."
71 [ -x /sbin/restorecon ] && /sbin/restorecon /dev/ptmx
73 domount devpts "" /dev/pts devpts -onoexec,nosuid,gid=$TTYGRP,mode=$TTYMODE
80 echo "Warning: mountdevsubfs should be called with the 'start' argument." >&2
86 restart|reload|force-reload)
87 echo "Error: argument '$1' not supported" >&2
94 echo "Usage: mountdevsubfs [start|stop]" >&2