LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-18-2006, 08:27 PM   #1
dale77
LQ Newbie
 
Registered: Jun 2006
Posts: 4

Rep: Reputation: 0
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
 
Old 06-19-2006, 05:49 AM   #2
dale77
LQ Newbie
 
Registered: Jun 2006
Posts: 4

Original Poster
Rep: Reputation: 0
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
 
Old 06-19-2006, 06:19 AM   #3
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Welcome to LQ!

Do you have lm_sensors started? In my Gentoo system: "/etc/init.d/lm_sensors start"
 
Old 06-20-2006, 05:35 AM   #4
dale77
LQ Newbie
 
Registered: Jun 2006
Posts: 4

Original Poster
Rep: Reputation: 0
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
 
Old 06-20-2006, 06:08 AM   #5
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
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
}
 
Old 06-21-2006, 04:08 AM   #6
dale77
LQ Newbie
 
Registered: Jun 2006
Posts: 4

Original Poster
Rep: Reputation: 0
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel 2.6.6 / Gkrellm / lmsensors / Pain in head Evilone Linux - Software 19 06-17-2004 04:45 PM
Using Rivatv with Lmsensors powadha Linux - Software 0 05-16-2004 04:33 AM
-mm4 kernel patch and lmsensors & i2c joel112 Linux - Software 1 03-23-2004 08:33 AM
problem with lmsensors celeron2002 Linux - Software 2 02-26-2004 03:31 PM
lmsensors celeron2002 Linux - Hardware 0 02-18-2004 10:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration