2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-29 21:38:17 +00:00

Print warnings about missing modules on screen, rather than telling

the user to add them to the configuration files. When using the
sysconfig integration mode, the warnings would never be seen.
Also don't include missing modules in the configuration files,
as they may cause the lm_sensors service to fail.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5590 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare 2009-01-12 16:17:51 +00:00
parent d93dcb468e
commit b1df5b6536
2 changed files with 16 additions and 9 deletions

View File

@ -54,6 +54,7 @@ SVN-HEAD
Add Winbond/Nuvoton W83667HG support Add Winbond/Nuvoton W83667HG support
Add Intel Core I7 support Add Intel Core I7 support
Generate new format for /etc/sysconfig/lm_sensors Generate new format for /etc/sysconfig/lm_sensors
Print warnings about missing modules on screen
sensors-detect-stat.pl: Delete (functionality merged into sensors-detect) sensors-detect-stat.pl: Delete (functionality merged into sensors-detect)
3.0.3 (2008-09-28) 3.0.3 (2008-09-28)

View File

@ -5117,7 +5117,6 @@ sub generate_modprobes
$bus_modules{"i2c-isa"}++; $bus_modules{"i2c-isa"}++;
} }
if ($ipmi) { if ($ipmi) {
$modprobes .= "# You must also install and load the IPMI modules\n";
$modprobes .= "modprobe ipmi-si\n"; $modprobes .= "modprobe ipmi-si\n";
$bus_modules{"ipmi-si"}++; $bus_modules{"ipmi-si"}++;
} }
@ -5127,7 +5126,8 @@ sub generate_modprobes
foreach $driver (keys %chips_detected) { foreach $driver (keys %chips_detected) {
next if not @{$chips_detected{$driver}}; next if not @{$chips_detected{$driver}};
if ($driver eq "to-be-written") { if ($driver eq "to-be-written") {
$modprobes .= "# no driver for ${$chips_detected{$driver}}[0]{chipname} yet\n"; print "Note: there is no driver for ${$chips_detected{$driver}}[0]{chipname} yet.\n".
"Check http://www.lm-sensors.org/wiki/Devices for updates.\n\n";
} else { } else {
open(local *INPUTFILE, "modprobe -l $driver 2>/dev/null |"); open(local *INPUTFILE, "modprobe -l $driver 2>/dev/null |");
local $_; local $_;
@ -5142,13 +5142,14 @@ sub generate_modprobes
# Check return value from modprobe in case modprobe -l # Check return value from modprobe in case modprobe -l
# isn't supported # isn't supported
if ((($? >> 8) == 0) && ! $modulefound) { if ((($? >> 8) == 0) && ! $modulefound) {
$modprobes .= "# Warning: the required module $driver is not currently installed\n". print "Warning: the required module $driver is not currently installed\n".
"# on your system. For status of 2.6 kernel ports check\n". "on your system. If it is built into the kernel then it's OK.\n".
"# http://www.lm-sensors.org/wiki/Devices. If driver is built\n". "Otherwise, check http://www.lm-sensors.org/wiki/Devices for\n".
"# into the kernel, or unavailable, comment out the following line.\n"; "driver availability.\n\n";
} else {
$modprobes .= "modprobe $driver\n";
$hwmon_modules{$driver}++;
} }
$modprobes .= "modprobe $driver\n";
$hwmon_modules{$driver}++;
} }
} }
@ -5408,7 +5409,12 @@ sub main
print "\n"; print "\n";
my ($modprobes, $configfile, $bus_modules, $hwmon_modules) = generate_modprobes(); my ($modprobes, $configfile, $bus_modules, $hwmon_modules) = generate_modprobes();
write_config($modprobes, $configfile, $bus_modules, $hwmon_modules);
if (@{$hwmon_modules}) {
write_config($modprobes, $configfile, $bus_modules, $hwmon_modules);
} else {
print "No modules to load, skipping modules configuration.\n\n";
}
unload_modules(); unload_modules();
} }