LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   lmsensors and kernel 2.6.16.19 (https://www.linuxquestions.org/questions/linux-software-2/lmsensors-and-kernel-2-6-16-19-a-456064/)

dale77 06-18-2006 08:27 PM

lmsensors and kernel 2.6.16.19
 
Hello all,

I'm trying to get lmsensors to work with my home-built (LinuxFromScratch) system. I'm using the latest lmsensors and sysfs utils, but "sensors" errors out saying it can't access procfs/sysfs.

mount shows sysfs mounted on /sys....

I've compiled I2C and hardware monitoring into the kernel, the sensor on my mobo (MSI K8TNeo K8T800) is a winbond whose exact model number escapes me at the moment. I started out compiling everything into the kernel, but have just tried everything as modules with no success.

sensors-detect shows up the sensor OK... but sensors still can't find sysfs.

Is there a problem with running lmsensors on this fresh kernel? Or am I missing some other critical piece?

Thanks

Dale

dale77 06-19-2006 05:49 AM

Command output...

root@gordon:~# sensors
Can't access procfs/sysfs file
Unable to find i2c bus information;
For 2.6 kernels, make sure you have mounted sysfs and libsensors
was compiled with sysfs support!
For older kernels, make sure you have done 'modprobe i2c-proc'!

root@gordon:~# sensors-detect

...
I will now generate the commands needed to load the I2C modules.

To make the sensors modules behave correctly, add these lines to
/etc/modules.conf:

#----cut here----
# I2C module options
alias char-major-89 i2c-dev
#----cut here----

To load everything that is needed, add this to some /etc/rc* file:

#----cut here----
# I2C adapter drivers
# modprobe unknown adapter NVIDIA I2C Device
# modprobe unknown adapter NVIDIA I2C Device
# modprobe unknown adapter NVIDIA I2C Device
modprobe i2c-viapro
modprobe i2c-isa
# I2C chip drivers
# Warning: the required module eeprom is not currently installed on your system.
# For status of 2.6 kernel ports see <snip>
# If driver is built-in to the kernel, or unavailable, comment out the following line.
modprobe eeprom
# Warning: the required module w83627hf is not currently installed on your system.
# For status of 2.6 kernel ports see <snip>
# If driver is built-in to the kernel, or unavailable, comment out the following line.
modprobe w83627hf
# sleep 2 # optional
/usr/local/bin/sensors -s # recommended

root@gordon:~# grep I2C /home/dale/lfs-sources/linux-2.6.16.19/.config
# I2C support
CONFIG_I2C=y
CONFIG_I2C_CHARDEV=m
# I2C Algorithms
CONFIG_I2C_ALGOBIT=m
CONFIG_I2C_ALGOPCF=m
CONFIG_I2C_ALGOPCA=m
# I2C Hardware Bus support
CONFIG_I2C_ALI1535=m
CONFIG_I2C_ALI15X3=m
CONFIG_I2C_AMD756=m
CONFIG_I2C_AMD8111=m
# CONFIG_I2C_ELEKTOR is not set
CONFIG_I2C_I801=m
CONFIG_I2C_I810=m
CONFIG_I2C_PIIX4=m
CONFIG_I2C_ISA=m
CONFIG_I2C_NFORCE2=m
CONFIG_I2C_PARPORT=m
CONFIG_I2C_PARPORT_LIGHT=m
CONFIG_I2C_PROSAVAGE=m
CONFIG_I2C_SIS5595=m
CONFIG_I2C_SIS630=m
CONFIG_I2C_SIS96X=m
CONFIG_I2C_VIAPRO=m
CONFIG_I2C_VOODOO3=m
CONFIG_I2C_PCA_ISA=m
# Miscellaneous I2C Chip support
# CONFIG_I2C_DEBUG_CORE is not set
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
# CONFIG_I2C_DEBUG_CHIP is not set

root@gordon:~# grep SENSORS /home/dale/lfs-sources/linux-2.6.16.19/.config

#
# Hardware Monitoring support
#
CONFIG_HWMON=m
CONFIG_HWMON_VID=m
CONFIG_SENSORS_ADM1021=m
CONFIG_SENSORS_GL518SM=m
CONFIG_SENSORS_IT87=m
CONFIG_SENSORS_LM75=m
CONFIG_SENSORS_LM83=m
CONFIG_SENSORS_LM90=m
CONFIG_SENSORS_VIA686A=m
CONFIG_SENSORS_W83781D=m
CONFIG_SENSORS_HDAPS=m
# CONFIG_HWMON_DEBUG_CHIP is not set

Emerson 06-19-2006 06:19 AM

Welcome to LQ!

Do you have lm_sensors started? In my Gentoo system: "/etc/init.d/lm_sensors start"

dale77 06-20-2006 05:35 AM

No I don't have anything in init.d to do with lm_sensors. I had a look at the init script provided with the lm_sensors source and as far as I could see all it does is load up the lm_sensors modules. Initially I had everything (or some subset perhaps ;-) compiled into the kernel, and it didn't work. For my last try I tried to manually modprobe the modules listed by sensors detect with no joy. The module for my sensors looks like it is in "experimental" so it is not available in my kernel at the moment. I chose "No" to development and experimental code in my kernel compile. My next move is to go back and compile that in (although the sensor module I chose is supposed to work with my sensor).

Perhaps you could post your gentoo init script for me to peruse?

Thanks

Dale

Emerson 06-20-2006 06:08 AM

Never had a closer look at it, looks like it does load modules. :)

Code:

#!/sbin/runscript
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-apps/lm_sensors/files/lm_sensors-2.10.0-lm_sensors-init.d,v 1.1 2006/02/15 18:40:21 brix Exp $

checkconfig() {
        if [ ! -f /etc/conf.d/lm_sensors ]; then
                eerror "/etc/conf.d/lm_sensors does not exist, try running sensors-detect"
                return 1
        fi

        if [ "${LOADMODULES}" = "yes" -a -f /proc/modules ]; then
                if [ -z "${MODULE_0}" ]; then
                        eerror "MODULE_0 is not set in /etc/conf.d/lm_sensors, try running sensors-detect"
                        return 1
                fi
        fi
}

start() {
        checkconfig || return 1

        if [ "${LOADMODULES}" = "yes" -a -f /proc/modules ]; then
                einfo "Loading lm_sensors modules..."

                mount | grep sysfs &> /dev/null
                if [ ${?} == 0 ]; then
                        if ! ( [ -e /sys/i2c ] || [ -e /sys/bus/i2c ] ); then
                                ebegin "  Loading i2c-core"
                                modprobe i2c-core &> /dev/null
                                if [ ${?} != 0 ]; then
                                        eerror "    Could not load i2c-core!"
                                        eend 1
                                fi
                                ( [ -e /sys/i2c ] || [ -e /sys/bus/i2c ] ) || return 1
                                eend 0
                        fi
                elif ! [ -e /proc/sys/dev/sensors ]; then
                        ebegin "  Loading i2c-proc"
                        modprobe i2c-proc &> /dev/null
                        if [ ${?} != 0 ]; then
                                eerror "    Could not load i2c-proc!"
                                eend 1
                        fi
                        [ -e /proc/sys/dev/sensors ] || return 1
                        eend 0
                fi

                i=0
                while true; do
                        module=`eval echo '$'MODULE_${i}`
                        module_args=`eval echo '$'MODULE_${i}_ARGS`
                        if [ -z "${module}" ]; then
                                break
                        fi
                        ebegin "  Loading ${module}"
                        modprobe ${module} ${module_args} &> /dev/null
                        eend $?
                        i=$((i+1))
                done
        fi

        if [ "${INITSENSORS}" = "yes" ]; then
                if ! [ -f /etc/sensors.conf ]; then
                        eerror "/etc/sensors.conf does not exist!"
                        return 1
                fi

                ebegin "Initializing sensors"
                /usr/bin/sensors -s &> /dev/null
                eend ${?}
        fi
}

stop() {
        checkconfig || return 1

        if [ "${LOADMODULES}" = "yes" -a -f /proc/modules ]; then
                einfo "Unloading lm_sensors modules..."

                # find the highest possible MODULE_ number
                i=0
                while true; do
                        module=`eval echo '$'MODULE_${i}`
                        if [ -z "${module}" ] ; then
                                break
                        fi
                        i=$((i+1))
                done

                while [ ${i} -gt 0 ]; do
                        i=$((i-1))
                        module=`eval echo '$'MODULE_${i}`
                        ebegin "  Unloading ${module}"
                        rmmod ${module} &> /dev/null
                        eend $?
                done

                if [ -e /proc/sys/dev/sensors ] ; then
                        ebegin "  Unloading i2c-proc"
                        rmmod i2c-proc &> /dev/null
                        eend $?
                fi
        fi
}


dale77 06-21-2006 04:08 AM

Hello,

I got it running. What I did was the following:

Code:

CONFIG_I2C=m
CONFIG_I2C_CHARDEV=m

CONFIG_I2C_ALGOBIT=m
CONFIG_I2C_ALGOPCF=m
CONFIG_I2C_ALGOPCA=m

CONFIG_I2C_ISA=m
CONFIG_I2C_VIAPRO=m

CONFIG_HWMON=y
CONFIG_HWMON_VID=m

CONFIG_SENSORS_W83627HF=m

And I added the following lines to LFS /etc/sysconfig/modules for loading at startup.

Code:

i2c-core
i2c-dev
i2c-viapro
i2c-isa
w83627hf

I wonder which link in the chain was missing before? Never mind all good now, although my sensors values are a bit strange:

Code:

w83697hf-isa-0290
Adapter: ISA adapter
VCore:    +1.47 V  (min =  +1.71 V, max =  +1.89 V)      ALARM
+3.3V:    +3.25 V  (min =  +3.14 V, max =  +3.47 V)
+5V:      +4.95 V  (min =  +4.76 V, max =  +5.24 V)
+12V:    +11.73 V  (min = +10.82 V, max = +13.19 V)
-12V:    -12.28 V  (min = -13.18 V, max = -10.80 V)
-5V:      -5.00 V  (min =  -5.25 V, max =  -4.75 V)
V5SB:      +5.46 V  (min =  +4.76 V, max =  +5.24 V)      ALARM
VBat:      +3.54 V  (min =  +2.40 V, max =  +3.60 V)
fan1:    3308 RPM  (min = 42187 RPM, div = 2)              ALARM
fan2:        0 RPM  (min = 675000 RPM, div = 2)              ALARM
temp1:      +30°C  (high =    +0°C, hyst =  +22°C)  sensor = thermistor  ALARM
temp2:    +23.0°C  (high =  +80°C, hyst =  +75°C)  sensor = diode
alarms:
beep_enable:
          Sound alarm enabled

Probably I need to do some tweaking with lm_sensors itself.

Dale


All times are GMT -5. The time now is 04:54 AM.