From 5c91adffc25f5c9bb5331d42f57e8ec715601ddd Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 17 May 2009 14:47:43 +0200 Subject: [PATCH] compat-2.6: Fixed module_disable function with old module-init-tools. The behavior of modprobe -l chanched. Old versions are returning the full path and new versions only return the relative path to the modules directory of the kernel. Corrected some typos iwl-enable. Thanks Brett D. Ussher for your help. Signed-off-by: Hauke Mehrtens --- scripts/iwl-enable | 4 ++-- scripts/modlib.sh | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/iwl-enable b/scripts/iwl-enable index 1236debcc4ff..765195b35539 100755 --- a/scripts/iwl-enable +++ b/scripts/iwl-enable @@ -17,7 +17,7 @@ IWL_NEW="iwlagn" IWL_OLD="iwl4965" # Appended to module file at the end when we want to ignore one -USAGE="Usage: $0 [ $IWL | $IWL_OLD ]" +USAGE="Usage: $0 [ $IWL_NEW | $IWL_OLD ]" function enable_iwlagn { module_disable $IWL_OLD @@ -36,7 +36,7 @@ elif [ $# -ne 1 ]; then fi MODULE=$1 -if [ "$MODULE" == "iwl4954" ]; then +if [ "$MODULE" == "iwl4965" ]; then module_disable $IWL_NEW module_enable $IWL_OLD elif [ "$MODULE" == "iwlagn" ]; then diff --git a/scripts/modlib.sh b/scripts/modlib.sh index 514094943398..91e53f130495 100755 --- a/scripts/modlib.sh +++ b/scripts/modlib.sh @@ -28,7 +28,7 @@ function module_disable { ALL_MODULES=`find /lib/modules/$VER/ -name $MODULE_KO` COUNT=1 CHECK=`modprobe -l $MODULE` - while [ ! -z $CHECK ]; do + for i in $ALL_MODULES; do if [[ $MODULE_COUNT -gt 1 ]]; then if [[ $COUNT -eq 1 ]]; then echo -en "$MODULE_COUNT $MODULE modules found " @@ -38,7 +38,7 @@ function module_disable { else echo -en "Disabling $MODULE ..." fi - mv -f /lib/modules/$VER/$CHECK /lib/modules/$VER/${CHECK}${IGNORE_SUFFIX} + mv -f $i ${i}${IGNORE_SUFFIX} depmod -ae CHECK_AGAIN=`modprobe -l $MODULE` if [ "$CHECK" != "$CHECK_AGAIN" ]; then @@ -49,7 +49,6 @@ function module_disable { echo "$CHECK" fi let COUNT=$COUNT+1 - CHECK=$CHECK_AGAIN done } -- 2.30.2