--- /etc/init.d/lm_sensors 2004-08-06 13:01:30.000000000 +0900 +++ lm_sensors 2004-08-30 21:14:25.580920064 +0900 @@ -28,15 +28,25 @@ # in order as normal shell variables with the special names: # MODULE_1, MODULE_2, MODULE_3, etc. +KERNEL_MINOR=`uname -r | sed 's/^..//' | sed 's/\..*$//'` + +if [ $KERNEL_MINOR -eq 4 ]; then + SENSOR_MODULE=i2c-proc + SENSOR_DEVICE=/proc/sys/dev/sensors +elif [ $KERNEL_MINOR -eq 6 ]; then + SENSOR_MODULE=i2c-sensor + SENSOR_DEVICE=/sys/bus/i2c +fi + # If sensors isn't supported by the kernel, try loading the module... -[ -e /proc/sys/dev/sensors ] || /sbin/modprobe i2c-proc &>/dev/null +[ -e $SENSOR_DEVICE ] || /sbin/modprobe $SENSOR_MODULE &>/dev/null # Don't bother if /proc/sensors still doesn't exist, kernel doesn't have # support for sensors. -[ -e /proc/sys/dev/sensors ] || exit 0 +[ -e $SENSOR_DEVICE ] || exit 0 # If sensors was not already running, unload the module... -[ -e /var/lock/subsys/sensors ] || /sbin/modprobe -r i2c-proc &>/dev/null +[ -e /var/lock/subsys/sensors ] || /sbin/modprobe -r $SENSOR_MODULE &>/dev/null CONFIG=/etc/sysconfig/lm_sensors PSENSORS=/usr/bin/sensors @@ -81,7 +91,7 @@ /sbin/modprobe -r $module &>/dev/null i=`expr $i - 1` done - /sbin/modprobe -r i2c-proc &>/dev/null + /sbin/modprobe -r $SENSOR_MODULE &>/dev/null RETVAL=$? if [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sensors ; then