slitaz-boot-scripts 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 4ac520b89d9b
children 314ff70acfdf
files etc/init.d/hwconf.sh etc/rcS.conf
line diff
     1.1 --- a/etc/init.d/hwconf.sh	Wed May 21 14:40:33 2008 +0000
     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
     2.1 --- a/etc/rcS.conf	Wed May 21 14:40:33 2008 +0000
     2.2 +++ b/etc/rcS.conf	Wed May 28 14:23:50 2008 +0200
     2.3 @@ -24,6 +24,9 @@
     2.4  #
     2.5  LOAD_MODULES="vfat nls_utf8 ohci_hcd"
     2.6  
     2.7 +# Kernel modules that we never want to load.
     2.8 +BLACKLIST_MODULES=""
     2.9 +
    2.10  # Initialisation scripts to run at boot time. Boot order is important,
    2.11  # bootopts.sh (boot options) must start first, then you free to choose. Note
    2.12  # that the local.sh script exist to let you quick add some local startup