File lm_sensors-3.0.3-hint-at-kernel-extra-package.patch of Package sensors

Now that the kernel package is split into 3 parts, it is possible
that not all required hwmon drivers are installed on the system when
sensors-detect is being run. Point the user to the kernel-*-extra
package if drivers are found to be missing.
---
 prog/detect/sensors-detect |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Index: lm_sensors-3.0.3/prog/detect/sensors-detect
===================================================================
--- lm_sensors-3.0.3.orig/prog/detect/sensors-detect
+++ lm_sensors-3.0.3/prog/detect/sensors-detect
@@ -2368,12 +2368,15 @@ sub initialize_conf
 # [2] -> SUBLEVEL
 # [3] -> EXTRAVERSION
 #
-use vars qw(@kernel_version $kernel_arch);
+use vars qw(@kernel_version $kernel_flavor $kernel_arch);
 
 sub initialize_kernel_version
 {
   `uname -r` =~ /(\d+)\.(\d+)\.(\d+)(.*)/;
   @kernel_version = ($1, $2, $3, $4);
+  if ($kernel_version[3] =~ /-([a-z]+)$/) {
+    chomp($kernel_flavor = $1);
+  }
   chomp($kernel_arch = `uname -m`);
 }
 
@@ -5819,6 +5822,11 @@ sub generate_modprobes
                        "# on your system. For status of 2.6 kernel ports check\n".
                        "# http://www.lm-sensors.org/wiki/Devices. If driver is built\n".
                        "# into the kernel, or unavailable, comment out the following line.\n";
+         if ($kernel_flavor) {
+           print "WARNING! The required module $chip->{driver} is not currently installed\n".
+                 "on your system. You may need to install package kernel-$kernel_flavor-extra\n".
+                 "for lm-sensors to work properly.\n\n";
+         }
        }
        $modprobes .= "modprobe $chip->{driver}\n";
     }
openSUSE Build Service is sponsored by