_pass if $modules=~/^lufs\b/m;
_pass if !_system "/sbin/modprobe lufs 2>/dev/null";
-print STDERR "Preparing LUFS kernel module - this may take several minutes...\n"; # if !$quiet;
+print STDERR "Preparing LUFS kernel module... Run $basedir/prepmod if problems occur.\n"; # if !$quiet;
my $proc_version=_readfile "/proc/version";
my $uname_r=($proc_version=~/^Linux version (\S+)/)[0] || _readfile "uname -r|";
print STDERR "Destination module directory: $moduledir\n" if !$quiet;
my @kernel_paths=(
- "/lib/modules/$uname_r/build",
+ "/lib/modules/$uname_r$uname_smp/build",
"/usr/src/kernel-headers-$uname_r",
"/usr/src/linux-$uname_r",
"/usr/src/linux-$uname_r_base",
if (build($kernel,$uname_r,$_)) {
do { cluck "Failed to symlink $_"; next; }
if _system "/bin/rm -rf $moduledir; /bin/mkdir -p $moduledir; /bin/ln -s $_ $moduledir/$lufs_o";
+ # Check if the compiled module matches the currently running kernel.
+ # We may found some unspecific sources ('/usr/src/linux/'?) not matching the current kernel.
+ # It still may be worth to try precompiled modules and/or give suggestive error messages.
+ # Do not: /sbin/insmod -o lufs -p $_ 2>/dev/null
+ # as 2.6 insmod has no options at all.
+ next if _system "/sbin/rmmod lufs 2>/dev/null; /sbin/insmod $moduledir/$lufs_o 2>/dev/null";
_pass 1;
}
}
.($kernel ? "Detected Linux kernel sources \"$kernel\" do not appear to be valid.\n"
: "No Linux kernel sources for your running kernel were found.\n")
."Please install kernel-source-x.y.z.i386.rpm or kernel-headers_x.y.z_i386.deb.\n"
- ."The following directory paths were search (first existing directory used):\n"
+ ."The following directory paths were searched (first existing directory used):\n"
.join("",map("\t\t$_\n",@kernel_paths));