Changeset 5591
- Timestamp:
- 01/12/09 17:38:09 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/branches/lm-sensors-3.0.0/prog/detect/sensors-detect
r5590 r5591 5056 5056 my ($driver, $detection, $adap); 5057 5057 my ($isa, $ipmi); 5058 my ($ modprobes, $configfile, %bus_modules, %hwmon_modules);5058 my ($configfile, %bus_modules, %hwmon_modules); 5059 5059 5060 5060 foreach $driver (keys %chips_detected) { … … 5105 5105 next unless loaded_by_us($adap->{driver}); 5106 5106 next if not defined $configfile and not $adap->{used}; 5107 $modprobes .= "# I2C adapter drivers\n" unless defined $modprobes;5108 $modprobes .= "modprobe $adap->{driver}\n"5109 unless exists $bus_modules{$adap->{driver}};5110 5107 $bus_modules{$adap->{driver}}++; 5111 5108 } … … 5114 5111 # and will soon be gone. 5115 5112 if ($isa && !kernel_version_at_least(2, 6, 18)) { 5116 $modprobes .= "modprobe i2c-isa\n";5117 5113 $bus_modules{"i2c-isa"}++; 5118 5114 } 5119 5115 if ($ipmi) { 5120 $modprobes .= "modprobe ipmi-si\n";5121 5116 $bus_modules{"ipmi-si"}++; 5122 5117 } 5123 5118 5124 5119 # Now determine the chip probe lines 5125 $modprobes .= "# Chip drivers\n";5126 5120 foreach $driver (keys %chips_detected) { 5127 5121 next if not @{$chips_detected{$driver}}; … … 5148 5142 "driver availability.\n\n"; 5149 5143 } else { 5150 $modprobes .= "modprobe $driver\n";5151 5144 $hwmon_modules{$driver}++; 5152 5145 } … … 5156 5149 my @bus_modules = sort keys %bus_modules; 5157 5150 my @hwmon_modules = sort keys %hwmon_modules; 5158 return ($ modprobes, $configfile, \@bus_modules, \@hwmon_modules);5151 return ($configfile, \@bus_modules, \@hwmon_modules); 5159 5152 } 5160 5153 5161 5154 sub write_config 5162 5155 { 5163 my ($ modprobes, $configfile, $bus_modules, $hwmon_modules) = @_;5156 my ($configfile, $bus_modules, $hwmon_modules) = @_; 5164 5157 5165 5158 if (defined $configfile) { … … 5246 5239 print "To load everything that is needed, add this to one of the system\n". 5247 5240 "initialization scripts (e.g. /etc/rc.d/rc.local):\n\n"; 5248 print "#----cut here----\n". 5249 $modprobes. 5250 (-e '/usr/bin/sensors' ? 5241 print "#----cut here----\n"; 5242 if (@{$bus_modules}) { 5243 print "# Adapter drivers\n"; 5244 print "modprobe $_\n" foreach (@{$bus_modules}); 5245 } 5246 print "# Chip drivers\n"; 5247 print "modprobe $_\n" foreach (@{$hwmon_modules}); 5248 print((-e '/usr/bin/sensors' ? 5251 5249 "/usr/bin/sensors -s\n" : 5252 5250 "/usr/local/bin/sensors -s\n"). 5253 "#----cut here----\n\n" ;5251 "#----cut here----\n\n"); 5254 5252 5255 5253 print "If you have some drivers built into your kernel, the list above will\n". … … 5409 5407 print "\n"; 5410 5408 5411 my ($ modprobes, $configfile, $bus_modules, $hwmon_modules) = generate_modprobes();5409 my ($configfile, $bus_modules, $hwmon_modules) = generate_modprobes(); 5412 5410 5413 5411 if (@{$hwmon_modules}) { 5414 write_config($ modprobes, $configfile, $bus_modules, $hwmon_modules);5412 write_config($configfile, $bus_modules, $hwmon_modules); 5415 5413 } else { 5416 5414 print "No modules to load, skipping modules configuration.\n\n";
