#! /bin/sh

# modules: loadable code initialization script

. init-script-lib

case $1 in 
	start)
	    if [ ! -e /etc/modules.conf ]; then
		say making empty modules.conf
		fatal need filesystems
		echo -n > /etc/modules.conf
	    fi
	    if [ /etc/modules.conf -nt "/lib/modules/$(uname -r)/modules.dep" ]; then
		say building kernel module symbol dependency information
		fatal need filesystems
		fatal need ldconfig
    		fatal depmod -a
	    fi
	    ;;
	stop)
	    say cleaning kernel modules
	    fatal rmmod --stacks --all
	    ;;
esac