diff options
Diffstat (limited to 'beagle/debian-rfs/etc/init.d/mountdevsubfs.sh')
| -rwxr-xr-x | beagle/debian-rfs/etc/init.d/mountdevsubfs.sh | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/beagle/debian-rfs/etc/init.d/mountdevsubfs.sh b/beagle/debian-rfs/etc/init.d/mountdevsubfs.sh new file mode 100755 index 0000000..1b61621 --- /dev/null +++ b/beagle/debian-rfs/etc/init.d/mountdevsubfs.sh @@ -0,0 +1,76 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: mountdevsubfs +# Required-Start: mountkernfs +# Required-Stop: +# Should-Start: udev +# Default-Start: S +# Default-Stop: +# Short-Description: Mount special file systems under /dev. +# Description: Mount the virtual filesystems the kernel provides +# that ordinarily live under the /dev filesystem. +### END INIT INFO +# +# This script gets called multiple times during boot +# + +PATH=/sbin:/bin +TTYGRP=5 +TTYMODE=620 +[ -f /etc/default/devpts ] && . /etc/default/devpts + +TMPFS_SIZE= +[ -f /etc/default/tmpfs ] && . /etc/default/tmpfs + +KERNEL="$(uname -s)" + +. /lib/lsb/init-functions +. /lib/init/mount-functions.sh + +do_start () { + # + # Mount a tmpfs on /dev/shm + # + if [ ! -d /dev/shm ] + then + mkdir --mode=755 /dev/shm + [ -x /sbin/restorecon ] && /sbin/restorecon /dev/shm + fi + SHM_OPT= + [ "${SHM_SIZE:=$TMPFS_SIZE}" ] && SHM_OPT=",size=$SHM_SIZE" + domount tmpfs shmfs /dev/shm tmpfs -onosuid,nodev$SHM_OPT + + # + # Mount /dev/pts + # + if [ "$KERNEL" = Linux ] + then + if [ ! -d /dev/pts ] + then + mkdir --mode=755 /dev/pts + [ -x /sbin/restorecon ] && /sbin/restorecon /dev/pts + fi + domount devpts "" /dev/pts devpts -onoexec,nosuid,gid=$TTYGRP,mode=$TTYMODE + fi +} + +case "$1" in + "") + echo "Warning: mountdevsubfs should be called with the 'start' argument." >&2 + do_start + ;; + start) + do_start + ;; + restart|reload|force-reload) + echo "Error: argument '$1' not supported" >&2 + exit 3 + ;; + stop) + # No-op + ;; + *) + echo "Usage: mountdevsubfs [start|stop]" >&2 + exit 3 + ;; +esac |
