diff options
Diffstat (limited to 'sys-fs/multipath-tools/files/multipath-start.sh')
-rw-r--r-- | sys-fs/multipath-tools/files/multipath-start.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sys-fs/multipath-tools/files/multipath-start.sh b/sys-fs/multipath-tools/files/multipath-start.sh new file mode 100644 index 000000000000..b31e4902487e --- /dev/null +++ b/sys-fs/multipath-tools/files/multipath-start.sh @@ -0,0 +1,28 @@ +# /lib/rcscripts/addons/multipath-start.sh: Setup multipath devices at boot +# $Header: /var/cvsroot/gentoo-x86/sys-fs/multipath-tools/files/multipath-start.sh,v 1.1 2008/06/20 23:57:19 robbat2 Exp $ + +dm_in_proc() { + local retval=0 + for x in devices misc ; do + grep -qs 'device-mapper' /proc/${x} + retval=$((${retval} + $?)) + done + return ${retval} +} + +# NOTE: Add needed modules for RAID, Multipath etc +# to /etc/modules.autoload if needed +if [ -z "${CDBOOT}" -a -x /sbin/multipath ] ; then + if [ -e /proc/modules ] && ! dm_in_proc ; then + modprobe dm-mod 2>/dev/null + fi + + if dm_in_proc ; then + ebegin "Activating Multipath devices" + /sbin/multipath -v0 >/dev/null + retval=$? + eend ${retval} "Failed to activate multipath devices" + fi +fi + +# vim:ts=4 |