diff --git a/rc.sysinit b/rc.sysinit index c4ebd77..3daad5a 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -67,6 +67,37 @@ if [ -n "$HWCLOCK_PARAMS" ]; then fi fi +# Build module blacklist +BLACKLIST="${MOD_BLACKLIST[@]}" + +if [ -f /proc/cmdline ]; then + for cmd in $(cat /proc/cmdline); do + case $cmd in + disablemodules=*) eval $cmd ;; + esac + done + #parse cmdline entries of the form "disablemodules=x,y,z" + if [ -n "$disablemodules" ]; then + BLACKLIST="$BLACKLIST $(echo $disablemodules | sed 's|,| |g')" + fi + unset disablemodules +fi + +#MODULES entries in rc.conf that begin with ! are blacklisted +for mod in ${MODULES[@]}; do + if [ "${mod}" != "${mod#!}" ]; then + BLACKLIST="$BLACKLIST ${mod#!}" + fi +done + +touch /dev/.blacklist.sys.conf +# /dev/.blacklist.sys.conf = /etc/modprobe.d/blacklist.sys.conf (symlink) +for d in ${BLACKLIST}; do + echo "install ${d} /bin/false" >>/dev/.blacklist.sys.conf +done + +unset BLACKLIST + echo > /proc/sys/kernel/hotplug stat_busy "Starting UDev Daemon"