From 3ef49590d167b0cb4c8aec1d6913a0063101edb1 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Tue, 2 Dec 2008 20:56:45 +0000 Subject: [PATCH] Add an option to skip ISA probes except IPMI. The idea is that only old systems have ISA hardware monitoring chips, while IPMI can be present on recent systems. Additionally, IPMI probing is read-only, so it's safer than other ISA probes. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5502 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + prog/detect/sensors-detect | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index e3bf0469..f96b2427 100644 --- a/CHANGES +++ b/CHANGES @@ -34,6 +34,7 @@ SVN-HEAD Drop alias detection for Super-I/O chips Move alias detection after all chip detections Probe chip types from safest to more risky (#2322) + Add an option to skip ISA probes except IPMI 3.0.3 (2008-09-28) libsensors: Avoid namespace pollution diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 421f2378..909ec320 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -2777,11 +2777,13 @@ sub scan_i2c_adapter sub scan_isa_bus { + my $ipmi_only = shift; my ($chip, $addr, $conf); $| = 1; foreach $chip (@chip_ids) { next if not exists $chip->{isa_addrs} or not exists $chip->{isa_detect}; + next if $ipmi_only && $chip->{name} !~ m/\bIPMI\b/; foreach $addr (@{$chip->{isa_addrs}}) { printf("\%-60s", sprintf("Probing for `\%s'\ at 0x\%x... ", $chip->{name}, $addr)); @@ -4867,6 +4869,8 @@ sub generate_modprobes sub main { + my ($input); + # We won't go very far if not root unless ($> == 0) { print "You need to be root to run this script.\n"; @@ -4922,10 +4926,11 @@ sub main print "Some hardware monitoring chips are accessible through the ISA I/O ports.\n". "We have to write to arbitrary I/O ports to probe them. This is usually\n". "safe though. Yes, you do have ISA I/O ports even if you do not have any\n". - "ISA slots! Do you want to scan the ISA I/O ports? (YES/no): "; - unless ( =~ /^\s*n/i) { + "ISA slots! Do you want to scan the ISA I/O ports? (YES/no/ipmi only): "; + $input = ; + unless ($input =~ /^\s*n/i) { initialize_ioports(); - scan_isa_bus(); + scan_isa_bus($input =~ /^\s*i/i); close_ioports(); } print "\n";