Gaudenz Steinlin wrote:
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 discover-workers@lists.progeny.com. Gaudenz
Below is a better patch. It also fixes the following problem: Kernel 2.6 mixes up "-" and "_" in module names. module-init-tools tries to work around this, but using 'cat /proc/modules' and 'modprobe -l' have become very unreliable with 2.6. This patch would introduce /usr/bin/tr in discover-modprobe . Is that a problem? Regards Harri --------------------------------------------------------------------- --- discover-modprobe.orig 2004-02-10 17:52:57.000000000 +0100 +++ discover-modprobe 2004-02-14 08:23:26.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,13 +99,15 @@ continue fi - if ! (modprobe -l ${module_name}.o | grep -q ${module_name}.o); then + x="${module_name//-/_}" + if ! (modprobe -l ${module_name} | tr -- - _ | 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 + # Determine if the module is already loaded + if cut -d" " -f1 /proc/modules | tr -- - _ | grep -q "^${x}\$" ; then + echo "Skipping Module ${module_name}. It's already loaded." continue fi