Changeset 2372
- Timestamp:
- 03/20/04 10:29:50 (9 years ago)
- Files:
-
- 1 modified
-
lm-sensors/trunk/prog/detect/sensors-detect (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/prog/detect/sensors-detect
r2367 r2372 3 3 # 4 4 # sensors-detect - Detect PCI bus and chips 5 # Copyright (c) 1998 - 2002 Frodo Looijaard <frodol@dds.nl> 5 # Copyright (C) 1998 - 2002 Frodo Looijaard <frodol@dds.nl> 6 # Copyright (C) 2000 - 2004 The lm_sensors team 6 7 # 7 8 # This program is free software; you can redistribute it and/or modify … … 45 46 ######################### 46 47 47 use vars qw(@pci_adapters @chip_ids @superio_ids @undetectable_adapters); 48 49 @undetectable_adapters = ( 'i2c-elektor', 'i2c-elv', 'i2c-philips-par', 50 'i2c-velleman' ); 48 use vars qw(@pci_adapters @chip_ids @superio_ids); 51 49 52 50 # This is the list of SMBus or I2C adapters we recognize by their PCI … … 4307 4305 sub main 4308 4306 { 4309 my (@adapters,$res,$did_adapter_detection,$ detect_others,$adapter);4307 my (@adapters,$res,$did_adapter_detection,$adapter); 4310 4308 4311 4309 initialize_conf; … … 4344 4342 4345 4343 if (not $did_adapter_detection) { 4346 print " As you skipped adapter detection, we will only scan already ", 4347 "loaded adapter\n", 4348 " modules. You can still be prompted for non-detectable adapters.\n", 4349 " Do you want to? (yes/NO): "; 4350 $detect_others = <STDIN> =~ /^\s*[Yy]/; 4344 print "As you skipped adapter detection, we will only scan already loaded\n". 4345 "adapter modules.\n"; 4351 4346 } elsif ($> != 0) { 4352 print " As you are not root, we can't load adapter modules. We will only ", 4353 "scan\n", 4354 " already loaded adapters.\n"; 4355 $detect_others = 0; 4347 print "As you are not root, we can't load adapter modules. We will only scan\n". 4348 "already loaded adapters.\n"; 4356 4349 } else { 4357 print " We will now try to load each adapter module in turn.\n";4350 print "We will now try to load each adapter module in turn.\n"; 4358 4351 foreach $adapter (@adapters) { 4359 4352 next if $adapter eq "DISABLED"; … … 4374 4367 } 4375 4368 } 4376 print " Do you now want to be prompted for non-detectable adapters? ", 4377 "(yes/NO): "; 4378 $detect_others = <STDIN> =~ /^\s*[Yy]/ ; 4379 } 4380 4381 if ($detect_others) { 4382 foreach $adapter (@undetectable_adapters) { 4383 print "Load `$adapter' (say NO if built into your kernel)? (YES/no): "; 4384 unless (<STDIN> =~ /^\s*[Nn]/) { 4385 if (system ("modprobe", $adapter)) { 4386 print "Loading failed... skipping.\n"; 4387 } else { 4388 print "Module loaded succesfully.\n"; 4389 } 4390 } 4391 } 4392 } 4369 } 4370 4371 print "If you have undetectable or unsupported adapters, you can have them\n". 4372 "scanned by manually loading the modules before running this script.\n\n"; 4393 4373 4394 4374 print " To continue, we need module `i2c-dev' to be loaded.\n";
