mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-09 16:21:51 +00:00
Don't hardcode /sys, use $sysfs_root instead.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4137 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
c879e6f5f8
commit
3478493d21
1 file changed
+3
-2
@@ -2795,7 +2795,7 @@ sub scan_adapter
|
||||
# just give up and warn the user.
|
||||
my ($device, $driver);
|
||||
if (defined($sysfs_root)) {
|
||||
$device = sprintf("/sys/bus/i2c/devices/\%d-\%04x",
|
||||
$device = sprintf("$sysfs_root/bus/i2c/devices/\%d-\%04x",
|
||||
$adapter_nr, $addr);
|
||||
$driver = sysfs_device_driver($device);
|
||||
}
|
||||
@@ -5323,7 +5323,8 @@ sub main
|
||||
print "If you have undetectable or unsupported adapters, you can have them\n".
|
||||
"scanned by manually loading the modules before running this script.\n\n";
|
||||
|
||||
if (!exists($modules_list{"i2c-dev"}) && ! -e "/sys/class/i2c-dev") {
|
||||
if (!exists($modules_list{"i2c-dev"})
|
||||
&& !(defined $sysfs_root && -e "$sysfs_root/class/i2c-dev")) {
|
||||
print "To continue, we need module `i2c-dev' to be loaded.\n";
|
||||
print "If it is built-in into your kernel, you can safely skip this.\n"
|
||||
unless kernel_version_at_least(2, 6, 0);
|
||||
|
||||
Reference in new issue
Block a user