slitaz-boot-scripts diff etc/init.d/hwconf.sh @ rev 93

Allow to blacklist modules
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Wed May 28 14:23:50 2008 +0200 (2008-05-28)
parents f1f2677d464a
children 58cc6775e0f0
line diff
     1.1 --- a/etc/init.d/hwconf.sh	Fri May 16 01:08:50 2008 +0200
     1.2 +++ b/etc/init.d/hwconf.sh	Wed May 28 14:23:50 2008 +0200
     1.3 @@ -13,11 +13,14 @@
     1.4  # Detect PCI devices and load kernel module only at first boot
     1.5  # or in LiveCD mode.
     1.6  if [ ! -s /var/lib/detected-modules ]; then
     1.7 +
     1.8 +	. /etc/rcS.conf
     1.9 +	
    1.10  	echo "Detecting PCI devices..."
    1.11  	MODULES_LIST=`lspci -k | grep "modules" | cut -d ":" -f 2 | sed s/-/_/g`
    1.12  	for mod in $MODULES_LIST
    1.13  	do
    1.14 -		if ! `lsmod | grep -q "$mod"`; then
    1.15 +		if ! `lsmod | grep -q "$mod"` && ! `echo  $BLACKLIST_MODULES | grep -q "$mod"`; then
    1.16  			modname=`echo "$mod" | sed s/_/-/g`
    1.17  			echo "Loading Kernel modules: $modname"
    1.18  			detect="$detect $modname"
    1.19 @@ -32,7 +35,7 @@
    1.20  	fi
    1.21  	echo "$detect" > /var/lib/detected-modules
    1.22  	# Now add modules to rcS.conf
    1.23 -	. /etc/rcS.conf
    1.24 +	
    1.25  	load=`echo "$LOAD_MODULES $detect" | sed s/"  "/" "/g`
    1.26  	sed -i s/"LOAD_MODULES=\"$LOAD_MODULES\""/"LOAD_MODULES=\"$load\""/ \
    1.27  		/etc/rcS.conf