2008-10-10 14:07:21 +05:30
|
|
|
#!@PREFIX@/sbin/runscript
|
2009-05-01 19:41:40 +05:30
|
|
|
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
|
2011-06-30 05:16:31 +05:30
|
|
|
# Released under the 2-clause BSD license.
|
2008-10-10 14:07:21 +05:30
|
|
|
|
|
|
|
description="Mount system critical filesystems in /dev."
|
|
|
|
|
|
|
|
depend() {
|
|
|
|
use dev
|
2012-01-25 23:12:32 +05:30
|
|
|
keyword -vserver
|
2008-10-10 14:07:21 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
start() {
|
|
|
|
# Mount required stuff as user may not have then in /etc/fstab
|
|
|
|
for x in \
|
|
|
|
"devpts /dev/pts 0755 ,gid=5,mode=0620 devpts" \
|
|
|
|
"tmpfs /dev/shm 1777 ,nodev shm" \
|
|
|
|
; do
|
2009-04-27 13:21:18 +05:30
|
|
|
set -- $x
|
2008-10-10 14:07:21 +05:30
|
|
|
grep -Eq "[[:space:]]+$1$" /proc/filesystems || continue
|
2009-04-27 13:21:18 +05:30
|
|
|
mountinfo -q $2 && continue
|
2008-10-10 14:07:21 +05:30
|
|
|
|
2009-04-27 13:21:18 +05:30
|
|
|
if [ ! -d $2 ]; then
|
|
|
|
mkdir -m $3 -p $2 >/dev/null 2>&1 || \
|
2008-10-10 14:07:21 +05:30
|
|
|
ewarn "Could not create $2!"
|
|
|
|
fi
|
|
|
|
|
2009-04-27 13:21:18 +05:30
|
|
|
if [ -d $2 ]; then
|
2008-10-10 14:07:21 +05:30
|
|
|
ebegin "Mounting $2"
|
2009-04-27 13:21:18 +05:30
|
|
|
if ! fstabinfo --mount $2; then
|
|
|
|
mount -n -t $1 -o noexec,nosuid$4 $5 $2
|
2008-10-10 14:07:21 +05:30
|
|
|
fi
|
|
|
|
eend $?
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
return 0
|
|
|
|
}
|