From 3478493d2158f502ba197a62aedcd809f422c150 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 3 Sep 2006 08:07:59 +0000 Subject: [PATCH] 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 --- prog/detect/sensors-detect | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index f6e1b0ff..7ec202e4 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -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);