| 1 |
#!/sbin/runscript
|
| 2 |
# Copyright 1999-2005 Gentoo Foundation
|
| 3 |
# Distributed under the terms of the GNU General Public License v2
|
| 4 |
|
| 5 |
depend() {
|
| 6 |
need checkfs
|
| 7 |
}
|
| 8 |
|
| 9 |
start() {
|
| 10 |
# Mount local filesystems in /etc/fstab.
|
| 11 |
ebegin "Mounting local filesystems"
|
| 12 |
mount -at noproc,noshm,no${NET_FS_LIST// /,no} >/dev/null
|
| 13 |
eend $? "Some local filesystem failed to mount"
|
| 14 |
|
| 15 |
# Make sure we insert usbcore if its a module
|
| 16 |
if [[ -f /proc/modules ]] ; then
|
| 17 |
# >/dev/null to hide errors from non-USB users
|
| 18 |
modprobe usbcore &> /dev/null
|
| 19 |
fi
|
| 20 |
|
| 21 |
# Check what USB fs the kernel support. Currently
|
| 22 |
# 2.5+ kernels, and later 2.4 kernels have 'usbfs',
|
| 23 |
# while older kernels have 'usbdevfs'.
|
| 24 |
local usbfs=$(grep -Fow usbfs /proc/filesystems ||
|
| 25 |
grep -Fow usbdevfs /proc/filesystems)
|
| 26 |
|
| 27 |
if [[ -n ${usbfs} ]] && \
|
| 28 |
[[ -e /proc/bus/usb && ! -e /proc/bus/usb/devices ]]
|
| 29 |
then
|
| 30 |
ebegin "Mounting USB device filesystem (${usbfs})"
|
| 31 |
# # Fetch usb gid from /etc/group; fixes bug 35860
|
| 32 |
# usbgid=$(awk -F: '/^usb:/{print $3; exit}' /etc/group)
|
| 33 |
# mount -t ${usbfs} ${usbgid:+-o devmode=0664,devgid=$usbgid}
|
| 34 |
mount -t ${usbfs} usbfs /proc/bus/usb &>/dev/null
|
| 35 |
eend $? "Failed to mount USB device filesystem"
|
| 36 |
fi
|
| 37 |
|
| 38 |
# Swap on loopback devices, and other weirdnesses
|
| 39 |
ebegin "Activating (possibly) more swap"
|
| 40 |
/sbin/swapon -a
|
| 41 |
eend $?
|
| 42 |
|
| 43 |
# Start dm-crypt mappings, if any
|
| 44 |
start_addon dm-crypt
|
| 45 |
}
|
| 46 |
|
| 47 |
|
| 48 |
# vim:ts=4
|