Am Mit, den 11.02.2004 schrieb Harald Dunkel um 20:17:
PS.: Here is another patch to support kernel 2.6.x:
Thanks for your patch. I will include it in the next test release. Additionally I forwarded it to [EMAIL PROTECTED]
Below you can find a (hopefully) better patch. It might be a little bit rude, but IMHO it is the job of modprobe to detect whether a module has already been loaded.
Regards
Harri
--- discover-modprobe.orig 2004-02-10 17:52:57.000000000 +0100 +++ discover-modprobe 2004-02-20 13:24:30.000000000 +0100 @@ -50,16 +50,6 @@ EOF } -# Determine if the module is already loaded -is_loaded() { - module="$1" - if cut -d" " -f1 /proc/modules | grep -q "^${module}\$" ; then - true - else - false - fi -} - ############################################################################### nop= @@ -109,17 +99,13 @@ continue fi - if ! (modprobe -l ${module_name}.o | grep -q ${module_name}.o); then + x="${module_name//-/_}" + if ! (modprobe -l ${module_name} | sed -e 's/-/_/g' | grep -q -E "/${x}\\.o\$|/${x}\\.ko\$"); then ${verbose} && echo "Skipping ${module_name}; assuming it is compiled into the kernel." continue fi - if is_loaded ${module_name} ; then - echo "Skipping Module ${module_name}. It's already loaded." >&2 - continue - fi - - ${verbose} && echo "Loading ${module_info}:" + ${verbose} && echo "Loading ${module_info}" # Note the module being loaded in "${crashfile}". If loading the # module crashes the machine, this file will exist at the next