If a driver is built into the kernel, it doesn't show up in

/proc/modules so we will try to load it, even though it's already
available. It will succeed, however later attempts to remove the
driver will fail and such failures are reported at the end of the
script, which can be confusing.

So, use /sys/module instead of /proc/modules where available, as
built-in drivers are listed there too so we no longer attempt to load
already available drivers. As a consequence we also no longer attempt
to remove the drivers in question, thus clearing the error message.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6114 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2013-01-16 17:33:38 +00:00
1 parent 1971bc6ff1
commit 319f9b8f68
2 files changed
+12 -1

No files matched your search

+1
View File
@@ -6,6 +6,7 @@ SVN HEAD
sensors: Clarify what option -u is good for
sensors-detect: Add detection of AMD family 16h power sensors
Map IT8771E, IT8772E, IT8782F and IT8783F to it87
Use /sys/module instead of /proc/modules where available
3.3.3 "Happy Birthday Sophie" (2012-11-06)
documentation: Update fan-divisors, fan divisors are optional
+11 -1
View File
@@ -2773,9 +2773,19 @@ sub initialize_modules_list
{
local $_;
# /sys/module contains built-in drivers too, but doesn't exist on
# older kernels (added in kernel 2.6.7)
if (opendir(local *MODULES, "$sysfs_root/module")) {
while (defined($_ = readdir(MODULES))) {
next if m/^\./;
$modules_list{$1} = 1 if m/^(\S*)/;
}
return;
}
# Fall back to /proc/modules as it is always available
open(local *INPUTFILE, "/proc/modules") or return;
while (<INPUTFILE>) {
tr/-/_/; # Probably not needed
$modules_list{$1} = 1 if m/^(\S*)/;
}
}