2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-31 14:25:39 +00:00

Prevent unknown/disabled adapters from appearing more than

once in modprobe list.
        Hide unknown/disabled adapters algorithm (useless, and doesn't
        work in 2.6 anyway).


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2560 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2004-05-23 07:18:42 +00:00
parent 369ee3e59c
commit 8baa707534

View File

@@ -4385,6 +4385,7 @@ sub generate_modprobes
not exists $adapters[$detection->{i2c_devnr}]->{nr_later} and
not (exists $detection->{isa_addr} and $prefer_isa)) {
foreach $adap (@adapters) {
next unless exists $adap->{driver};
$adap->{nr_later} = $nr++ if $adap->{driver} eq $detection->{i2c_driver};
}
}
@@ -4397,15 +4398,18 @@ sub generate_modprobes
for ($i = 0; $i < $nr; $i++) {
foreach $adap (@adapters) {
next unless exists $adap->{nr_later} and $adap->{nr_later} == $i;
if ($adap->{driver} eq "UNKNOWN") {
$modprobes .= "# modprobe unknown adapter ".$adap->{adapname}." using ". $adap->{algoname}."\n";
$modprobes .= "# modprobe unknown adapter ".$adap->{adapname}."\n";
} elsif ($adap->{driver} eq "DISABLED") {
$modprobes .= "# modprobe disabled adapter ".$adap->{adapname}." using ". $adap->{algoname}."\n";
$modprobes .= "# modprobe disabled adapter ".$adap->{adapname}."\n";
} elsif ($adap->{driver} eq "to-be-written") {
$modprobes .= "# no driver available for adapter ".$adap->{adapname}." using ". $adap->{algoname}."\n";
$modprobes .= "# no driver available for adapter ".$adap->{adapname}."\n";
} else {
$modprobes .= "modprobe $adap->{driver}\n" if (defined($adap->{nr_later}) and $adap->{nr_later} == $i) and not $modprobes =~ /modprobe $adap->{driver}\n/;
$modprobes .= "modprobe $adap->{driver}\n"
unless $modprobes =~ /modprobe $adap->{driver}\n/;
}
last;
}
}
$modprobes .= "modprobe i2c-isa\n" if ($isa);