diff --git a/CHANGES b/CHANGES index da3d6d68..77dd437f 100644 --- a/CHANGES +++ b/CHANGES @@ -28,7 +28,9 @@ SVN-HEAD Add SMSC LPC47B367-NC detection (no sensors) Reduce w83781d/lm78 I2C address probing range Drop PCA9540 detection - Add Intel Celeron 4xx and Penryn (CPU on 45nm) detection + Add Intel Celeron 4xx and Penryn (CPU on 45nm) + detection + Improve sysconfig and modprobe.d integration 2.10.5 (20071024) File i2c-dev.h: Rename I2C_FUNC_SMBUS_HWPEC_CALC to I2C_FUNC_SMBUS_PEC diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index d7449150..f9529551 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -5834,35 +5834,34 @@ sub main } print "\n"; - print "I will now generate the commands needed to load the required modules.\n". - "Just press ENTER to continue: "; - ; - - print "\n"; my ($modprobes, $configfile) = generate_modprobes 1; # 1 == prefer ISA + if (defined $configfile) { - print "To make the sensors modules behave correctly, add these lines to\n". - "$modules_conf:\n\n"; - print "#----cut here----\n". - $configfile. - "#----cut here----\n\n"; + my $have_modprobe_d = -d '/etc/modprobe.d'; + printf "Do you want to \%s /etc/modprobe.d/lm_sensors? (\%s): ", + (-e '/etc/modprobe.d/lm_sensors' ? 'overwrite' : 'generate'), + ($have_modprobe_d ? 'YES/no' : 'yes/NO'); + $_ = ; + if (($have_modprobe_d and not m/^\s*n/i) or m/^\s*y/i) { + unless ($have_modprobe_d) { + mkdir '/etc/modprobe.d', 0777 + or die "Sorry, can't create /etc/modprobe.d ($!)"; + } + open(local *MODPROBE_D, ">/etc/modprobe.d/lm_sensors") + or die "Sorry, can't create /etc/modprobe.d/lm_sensors ($!)"; + print MODPROBE_D + "# Generated by sensors-detect on " . scalar localtime() . "\n"; + print MODPROBE_D $configfile; + close(MODPROBE_D); + } else { + print "To make the sensors modules behave correctly, add these lines to\n". + "$modules_conf:\n\n"; + print "#----cut here----\n". + $configfile. + "#----cut here----\n\n"; + } } - print "To load everything that is needed, add this to some /etc/rc* file:\n\n"; - print "#----cut here----\n". - $modprobes. - "# sleep 2 # optional\n". - (-e '/usr/bin/sensors' ? - "/usr/bin/sensors -s # recommended\n" : - "/usr/local/bin/sensors -s # recommended\n") . - "#----cut here----\n\n"; - - print "If you have some drivers built into your kernel, the list above will\n". - "contain too many modules. Skip the appropriate ones! You really\n". - "should try these commands right now to make sure everything is\n". - "working properly. Monitoring programs won't work until the needed\n". - "modules are loaded.\n\n"; - my $have_sysconfig = -d '/etc/sysconfig'; printf "Do you want to \%s /etc/sysconfig/lm_sensors? (\%s): ", (-e '/etc/sysconfig/lm_sensors' ? 'overwrite' : 'generate'), @@ -5919,10 +5918,29 @@ EOT $i++; } print SYSCONFIG $sysconfig; + close(SYSCONFIG); print "Copy prog/init/lm_sensors.init to /etc/init.d/lm_sensors\n". "for initialization at boot time.\n" unless -f "/etc/init.d/lm_sensors"; + + print "You should now start the lm_sensors service to load the required\n". + "kernel modules.\n\n"; + } else { + print "To load everything that is needed, add this to e.g. /etc/rc.d/rc.local:\n\n"; + print "#----cut here----\n". + $modprobes. + "# sleep 2 # optional\n". + (-e '/usr/bin/sensors' ? + "/usr/bin/sensors -s # recommended\n" : + "/usr/local/bin/sensors -s # recommended\n") . + "#----cut here----\n\n"; + + print "If you have some drivers built into your kernel, the list above will\n". + "contain too many modules. Skip the appropriate ones! You really\n". + "should try these commands right now to make sure everything is\n". + "working properly. Monitoring programs won't work until the needed\n". + "modules are loaded.\n\n"; } }