#!/sbin/runscript
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /var/cvsroot/gentoo-x86/sys-apps/evms/files/evms-init,v 1.2 2003/02/14 23:25:31 vapier Exp $

start() {
	test -x /sbin/evms_rediscover || eend 1

	# Only run if EVMS modules have been loaded.  If no modules are
	# loaded, evms modules have been compiled in, in which case discovery
	# has already been done by the kernel, or there is no evms support,
	# and thus nothing for us to do.

	if ! lsmod | egrep -q '^(ldev_mgr|dos_part|lvm_vge|evms.*|md_core|md_linear|md_raid0|md_raid1|AIXlvm_vge|os2lvm_vge|snapshot) '
	then
		ewarn
		ewarn "Nothing to do; evms support is either statically compiled into"
		ewarn "your kernel or you forgot to load the modules!"
		ewarn
		eend 0
	fi

	ebegin "Starting evms"
	evms_rediscover
	evms_devnode_fixup
	eend 0
}

stop() {
	# nothing to do..
	# this initscript should probably be moved into bootmisc or something..
	eend 0
}
