diff --git a/Makefile b/Makefile index 1cc719c7..cc39ee93 100644 --- a/Makefile +++ b/Makefile @@ -70,11 +70,14 @@ ETCDIR := /etc LIBDIR := $(PREFIX)/lib # You should not need to change this. It is the directory into which the -# executable program files will be installed. +# executable program files will be installed. BINDIR for programs that are +# also useful for normal users, SBINDIR for programs that can only be run +# by the superuser. # Note that not all programs in this package are really installed; # some are just examples. You can always install them by hand, of # course. BINDIR := $(PREFIX)/bin +SBINDIR := $(PREFIX)/sbin # You should not need to change this. It is the basic directory into which # include files will be installed. The actual directory will be diff --git a/prog/detect/Module.mk b/prog/detect/Module.mk index 7d9a4e05..29c6dbd3 100644 --- a/prog/detect/Module.mk +++ b/prog/detect/Module.mk @@ -24,6 +24,7 @@ MODULE_DIR := prog/detect # defined value verbatim into the command-list of rules... PROGDETECTTARGETS := $(MODULE_DIR)/i2cdetect PROGDETECTSOURCES := $(MODULE_DIR)/i2cdetect.c +PROGDETECTSBININSTALL := $(MODULE_DIR)/sensors-detect # Include all dependency files. We use '.rd' to indicate this will create # executables. @@ -32,6 +33,11 @@ INCLUDEFILES += $(PROGDETECTSOURCES:.c=.rd) all-prog-detect: $(PROGDETECTTARGETS) all :: all-prog-detect +install-prog-detect: all-prog-detect + mkdir -p $(SBINDIR) + $(INSTALL) -o root -g root -m 755 $(PROGDETECTSBININSTALL) $(SBINDIR) +install :: install-prog-detect + clean-prog-detect: $(RM) $(PROGDETECTSOURCES:.c=.rd) $(PROGDETECTSOURCES:.c=.ro) \ $(PROGDETECTTARGETS) diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 7f0027b8..0cf46f77 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -158,9 +158,6 @@ use subs qw(lm78_detect lm78_isa_detect lm78_alias_detect lm75_detect driver => "w83781d", i2c_addrs => [0x00..0x7f], i2c_detect => sub { w83781d_detect 1, @_}, - isa_addrs => [0x290], - isa_detect => sub { w83781d_isa_detect 1, @_ }, - alias_detect => sub { w83781d_alias_detect 1, @_ }, } , { name => "Winbond W83783S", @@ -1149,8 +1146,8 @@ sub w83781d_detect return unless (($reg1 & 0x80) == 0x00 and $reg2 == 0xa3) or (($reg1 & 0x80) == 0x80 and $reg2 == 0x5c); return unless ($reg1 & 0x07) == 0x00; - $reg1 = i2c_smbus_read_byte_data($file,0x58); - return if $chip == 0 and ($reg1 & 0xfe) != 0x10; + $reg1 = i2c_smbus_read_byte_data($file,0x58) &0xfe; + return if $chip == 0 and $reg1 != 0x10; return if $chip == 1 and $reg1 != 0x30; return if $chip == 2 and $reg1 != 0x40; $reg1 = i2c_smbus_read_byte_data($file,0x4a);