Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
nForce2 Hardware Monitoring Guide :) ( lm_sensor nforce )
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
ccrunner84
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jul 2003
Posts: 77

PostPosted: Thu Aug 07, 2003 6:01 am    Post subject: nForce2 Hardware Monitoring Guide :) ( lm_sensor nforce ) Reply with quote

m using Kernel 2.4.20 on Gentoo.. so your results might vary! BUT, here it is

OK first.. make sure and REMOVE, yes remove I2C in your kernel.. don't worry we will be installing it later on.. then recompile it..

Google and find these two files i2c-2.8.0.tar.gz lm_sensors-2.8.0.tar.gz

extract both of them...

now go into the i2c dir and run 'make all' then run 'make install'

Next,

go into the lm_sensors dir and run 'make all' 'make install'

Easy wasn't it? :P

Next, you need to go to cd /usr/local/sbin

then run

./detect-sensors

Go throught he config, I usually hit enter to all of it :0

You'll come to where it says CUT HERE

then list some modules

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

#----cut here----
# I2C adapter drivers
modprobe i2c-nforce2
# I2C chip drivers
modprobe eeprom
modprobe w83781d
modprobe to-be-written
# sleep 2 # optional
/usr/local/bin/sensors -s # recommended
#----cut here----

===============================================================

Now for Gentoo all I did was put this into my modules.autoload file..

i2c-nforce2
eeprom
w83781

I did not include to-be-written <- wasn't sure what it was :P


if your using an rc scripts then you need to add this to some file

modprobe i2c-nforce2
modprobe eeprom
modprobe w83781

Answer the last config question yes.. EDIT: If you answer yet it'll just install to /etc/sysconfig/lm_sensors.. then you need to copy it to /etc/init.d !

Now here is my init.d script...


Quote:

#!/sbin/runscript

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

. /etc/conf.d/lm_sensors

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

ebegin "Loading lm_sensors modules"
eend $?
if ! [ -e /proc/sys/dev/sensors ] ; then
ebegin " Loading i2c-proc"
modprobe i2c-proc &>/dev/null
eend $?
fi
[ -e /proc/sys/dev/sensors ] || return 1

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

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

. /etc/conf.d/lm_sensors

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

ebegin "Removing lm_sensors modules"
eend $?

# 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 " Removing ${module}"
rmmod ${module} &>/dev/null
eend $?
done

# should we actually remove i2c-proc???
ebegin " Removing i2c-proc"
rmmod i2c-proc &>/dev/null
eend $?

return 0
}


then I went to console and ran this..

rc-update add lm_sensors default


after this I rebooted and installed gkrellm2 and setup my sensors config :P

You should be able to go the command prompt and type sensors after reboot to make sure its working also...


Last edited by ccrunner84 on Fri Aug 08, 2003 3:45 am; edited 1 time in total
Back to top
View user's profile Send private message
Unlucky_Alf
Tux's lil' helper
Tux's lil' helper


Joined: 02 Feb 2003
Posts: 92

PostPosted: Thu Aug 07, 2003 10:55 am    Post subject: Reply with quote

You can download i2c and lm_sensors here: http://www2.lm-sensors.nu/~lm78/download.html
Back to top
View user's profile Send private message
firaX
Apprentice
Apprentice


Joined: 23 Apr 2003
Posts: 175
Location: Munich, Germany

PostPosted: Thu Aug 07, 2003 11:08 am    Post subject: Reply with quote

hm i m wondering why isnt there an ebuild for 1.2.8 yet? Its been out for ages now and the ebuild is still at 1.2.7 (which doesnt support nforce?)
Is there an unofficual ebuild for it?
Back to top
View user's profile Send private message
Nylle
Guru
Guru


Joined: 05 May 2002
Posts: 308
Location: Uppsala, Sweden

PostPosted: Thu Aug 07, 2003 11:22 am    Post subject: Reply with quote

firaX wrote:
hm i m wondering why isnt there an ebuild for 1.2.8 yet? Its been out for ages now and the ebuild is still at 1.2.7 (which doesnt support nforce?)
Is there an unofficual ebuild for it?


Hmm, I don't think 20 days qualifies as "ages". It will be released when it's ready, the gentoo devs have probably been very busy recently with the release of 1.4. Considering it's tight coupling with the kernel, lm-sensors probably is a pretty difficult ebuild to test, so it's natural it takes a while to get it working.

I haven't heard about any inoffical ebuilds, but if you're anxious to use it, feel free to go ahead and make an ebuild yourself! ;)
_________________
"Do you hear that sound your Highness?"
"Those are the shrieking eels, they always grow louder when they are about to feed on human flesh."
Back to top
View user's profile Send private message
firaX
Apprentice
Apprentice


Joined: 23 Apr 2003
Posts: 175
Location: Munich, Germany

PostPosted: Thu Aug 07, 2003 5:08 pm    Post subject: Reply with quote

well i installed it by hand now but the init script doesnt work....it doesnt install conf.d/lm_sensors either (i did run sensor-detect)
Back to top
View user's profile Send private message
m00re
n00b
n00b


Joined: 17 Jun 2002
Posts: 65
Location: Germany

PostPosted: Thu Aug 07, 2003 5:22 pm    Post subject: Reply with quote

For me, even i2c 2.7.0 and lm-sensors-2.7.0 worked. I just loaded the modules w83781d and i2c-isa. It works for fans, voltage information and temperatures.
_________________
"Fall seven times, stand up eight."
Back to top
View user's profile Send private message
firaX
Apprentice
Apprentice


Joined: 23 Apr 2003
Posts: 175
Location: Munich, Germany

PostPosted: Thu Aug 07, 2003 5:40 pm    Post subject: Reply with quote

fixed it...i said yes to "install etc/sysconfig/lm_sensors" then copied that file to conf.d/ and inserted the modules i need :)
works like a charm now :) i can load and unload all modules w/ the init script :)

gkrellm2 works fine with it too :)))

can someone tell me what temp1/2/3 is actually?

temp1=51C
temp2=17C
temp3=63C

whats cpu/mobo tho?i guess temp1 is my cpu cause my bios shows similar temps, not sure wtf is causing 63C tho! lol
Back to top
View user's profile Send private message
Nylle
Guru
Guru


Joined: 05 May 2002
Posts: 308
Location: Uppsala, Sweden

PostPosted: Thu Aug 07, 2003 6:00 pm    Post subject: Reply with quote

firaX wrote:

can someone tell me what temp1/2/3 is actually?

temp1=51C
temp2=17C
temp3=63C


You can discount temp2 directly, as you can't have temps lower then room temperature (I'm assuming you're on a air cooled system and your room temperature is over 17C).

A good indication on which is CPU temp is to start something CPU intensive, like a compilation or playing q3, and monitor the different sensors. The CPU temp should increase, and if some sensors remains constant it probably isn't anything on that sensor.

Also note that temp sensors in computer are notoriously bad at displaying correct temperatures, so the values should be taken with a grain of salt. However, they are a good indication on the changes in temp that occurs.
_________________
"Do you hear that sound your Highness?"
"Those are the shrieking eels, they always grow louder when they are about to feed on human flesh."
Back to top
View user's profile Send private message
firaX
Apprentice
Apprentice


Joined: 23 Apr 2003
Posts: 175
Location: Munich, Germany

PostPosted: Thu Aug 07, 2003 8:38 pm    Post subject: Reply with quote

was actually gkrellm2s fault, the sensors commandline app reports temp2 to be 32C ,which i assume is the mobo ,
Weird thing is, temp3 is 126C!!!
i guess thats a mistake? What could be 126C ?
Back to top
View user's profile Send private message
Nylle
Guru
Guru


Joined: 05 May 2002
Posts: 308
Location: Uppsala, Sweden

PostPosted: Thu Aug 07, 2003 10:35 pm    Post subject: Reply with quote

Usually the sensors will return some bogus value if there isn't actually a sensor there. I used to have a sensor that always showed -126C, obviously I was a bit sceptical... ;)

32C sounds reasonable for the motherboard, and most likely you've only got a CPU sensor and a motherboard sensor, so temp3 is likely bogus.
_________________
"Do you hear that sound your Highness?"
"Those are the shrieking eels, they always grow louder when they are about to feed on human flesh."
Back to top
View user's profile Send private message
ccrunner84
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jul 2003
Posts: 77

PostPosted: Fri Aug 08, 2003 3:46 am    Post subject: Reply with quote

updated the thread with the /etc/sysconfig/lm_sensors fix for anyone else that runs into it :P
Back to top
View user's profile Send private message
m00re
n00b
n00b


Joined: 17 Jun 2002
Posts: 65
Location: Germany

PostPosted: Fri Aug 08, 2003 6:29 am    Post subject: Reply with quote

firaX wrote:
was actually gkrellm2s fault, the sensors commandline app reports temp2 to be 32C ,which i assume is the mobo ,
Weird thing is, temp3 is 126C!!!
i guess thats a mistake? What could be 126C ?


it's an option in gkrellm2 which leads to the 17 degrees. in the sensors setup, there is a factor option for each sensor. looks like you have a factor of 0.5 for temp2. change it to 1.0, and you'll get the correct value.
_________________
"Fall seven times, stand up eight."
Back to top
View user's profile Send private message
deurk
Apprentice
Apprentice


Joined: 11 Mar 2003
Posts: 190
Location: Earth 1.3

PostPosted: Fri Aug 08, 2003 7:27 am    Post subject: Reply with quote

Hey, that's cool!
I was looking for that since a few days...

Thanks guys!
Back to top
View user's profile Send private message
adrenalin
Tux's lil' helper
Tux's lil' helper


Joined: 29 Dec 2002
Posts: 129

PostPosted: Fri Aug 08, 2003 10:12 am    Post subject: Reply with quote

firaX wrote:
hm i m wondering why isnt there an ebuild for 1.2.8 yet? Its been out for ages now and the ebuild is still at 1.2.7 (which doesnt support nforce?)
Is there an unofficual ebuild for it?


i2c-cvs is here:

Code:

# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /home/cvsroot/gentoo-x86/sys-apps/i2c/i2c-2.7.0.ebuild,v 1.4 2003/03/02 19:31:05 lostlogic Exp $

DESCRIPTION="I2C Bus support"
HOMEPAGE="http://www2.lm-sensors.nu/~lm78"

SLOT="0"
KEYWORDS="x86 ~ppc"
LICENSE="GPL-2"

RDEPEND="!sys-apps/i2c"

DEPEND="virtual/linux-sources"

inherit cvs debug flag-o-matic

strip-flags

ECVS_USER="anon"
ECVS_PASS="anonymous"
ECVS_SERVER="cvs.lm-sensors.nu:/home/cvs"
#ECVS_SERVER="offline"
ECVS_MODULE="i2c"
ECVS_BRANCH="V2-8-0"
ECVS_TOP_DIR="${DISTDIR}/cvs-src/${PN}"
S=${WORKDIR}/${ECVS_MODULE}

# LINUX=/usr/src/linux
EMAKE_LINUX_INCLUDE_DIR=/usr/include/i2c/linux
EMAKE_MODDIR=/lib/modules/${KV}
EMAKE_LINUX=${EMAKE_MODDIR}/build
EMAKE_PREFIX=/usr
EMAKE_MANDIR=/usr/share/man

src_compile ()  {

   if [ ${ECVS_SERVER} == "offline" ]
   then
      ewarn "*****************************************************************"
      ewarn
      ewarn "Working offline"
      ewarn
      ewarn "If you want to update the source tree before building then edit"
      ewarn "the ECVS_SERVER variable in"
      ewarn
      ewarn "${EBUILD}"
      ewarn
      ewarn "to point to the cvs server you want to update from"
      ewarn
      ewarn "*****************************************************************"
   fi

   emake clean || die
   emake LINUX=${EMAKE_LINUX} LINUX_INCLUDE_DIR=${EMAKE_LINUX_INCLUDE_DIR} all || \
   die "i2c requires the source of a compatible kernel\nversion installed in /usr/src/linux\nand kernel i2c *disabled* or *enabled as a module*"

}

src_install () {

   einstall LINUX=${EMAKE_LINUX} \
      LINUX_INCLUDE_DIR=${EMAKE_LINUX_INCLUDE_DIR} \
      MODDIR=${EMAKE_MODDIR} \
      DESTDIR=${D} \
      PREFIX=${EMAKE_PREFIX} \
      MANDIR=${EMAKE_MAN_DIR} || die
   dodoc CHANGES INSTALL README || die

}

pkg_postinst() {

   [ -x /usr/sbin/update-modules ] && /usr/sbin/update-modules

   einfo "*****************************************************************"
   einfo
   einfo "i2c package installed ..."
   einfo
   einfo "IMPORTANT ... if you are installing this package you need to either"
   einfo "IMPORTANT ... *disable* kernel i2c support or *enable it as a module*"
   einfo
   einfo "*****************************************************************"

}



lm_sensors is here

Code:

# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-x86/sys-apps/lm_sensors/lm_sensors-2.8.0.ebuild,v 1.9 2003/03/03 05:01:23 lostlogic Exp $

DESCRIPTION="Hardware Sensors Monitoring by lm_sensors"
HOMEPAGE="http://www2.lm-sensors.nu/~lm78"
SLOT="0"
LICENSE="GPL-2"
KEYWORDS="x86 -ppc -sparc"

# gentoo-sources-2.4.20-r1 and xfs-sources-2.4.20-r1 will
# have support for this package, do not change these to ~
# until your arch has i2c-2.8.0 in it's kernel.

RDEPEND="!sys-apps/lm_sensors"

DEPEND="|| (
        >=sys-apps/i2c-cvs-2.8.0
        >=sys-kernel/gentoo-sources-2.4.20-r1
        >=sys-kernel/lolo-sources-2.4.20.1
        >=sys-kernel/xfs-sources-2.4.20_pre4
      )"

inherit cvs debug flag-o-matic

strip-flags

ECVS_USER="anon"
ECVS_PASS="anonymous"
ECVS_SERVER="cvs.lm-sensors.nu:/home/cvs"
#ECVS_SERVER="offline"
ECVS_MODULE="lm_sensors2"
ECVS_BRANCH="V2-8-0"
ECVS_TOP_DIR="${DISTDIR}/cvs-src/${PN}"
S=${WORKDIR}/${ECVS_MODULE}

EMAKE_I2C_HEADERS=/usr/include/i2c
EMAKE_MODDIR=/lib/modules/${KV}
EMAKE_LINUX=${EMAKE_MODDIR}/build
EMAKE_PREFIX=/usr
EMAKE_MANDIR=/usr/share/man

src_unpack() {

   cvs_src_unpack
   cd ${S} || die
    patch -p1 <${FILESDIR}/sensors-detect-gentoo.diff || die

}

src_compile()  {

   check_KV

   if [ ${ECVS_SERVER} == "offline" ]
   then
      ewarn "*****************************************************************"
      ewarn
      ewarn "Working offline"
      ewarn
      ewarn "If you want to update the source tree before building then edit"
      ewarn "the ECVS_SERVER variable in"
      ewarn
      ewarn "${EBUILD}"
      ewarn
      ewarn "to point to the cvs server you want to update from"
      ewarn
      ewarn "*****************************************************************"
   fi

   filter-flags -fPIC
   cd ${S}

   emake clean || die
   emake LINUX=${EMAKE_LINUX} I2C_HEADERS=${EMAKE_I2C_HEADERS} all || die "lm_sensors requires the source of a compatible kernel\nversion installed in /usr/src/linux and >=i2c-2.8.0 support built as a modules this support is included in gentoo-sources as of 2.4.20-r1"

}

src_install() {

   einstall LINUX=${EMAKE_LINUX} \
      I2C_HEADERS=${EMAKE_I2C_HEADERS} \
      MODDIR=${EMAKE_MODDIR} \
      DESTDIR=${D} \
      PREFIX=${EMAKE_PREFIX} \
      MANDIR=${EMAKE_MANDIR} || die "Install failed"
   dodoc CHANGES INSTALL README || die
   exeinto /etc/init.d || die
   newexe ${FILESDIR}/rc lm_sensors || die

}

pkg_postinst() {

   [ -x /usr/sbin/update-modules ] && /usr/sbin/update-modules

   einfo
   einfo "The lm_sensors hardware sensors package has been installed."
   einfo
   einfo "It is recommended that you read the lm_sensors documentation."
   einfo "To enable lm_sensors you will need to compile i2c support in"
   einfo "your kernel as a module and run /usr/sbin/sensors-detect to"
   einfo "detect the hardware in your system."
   einfo
   einfo "Be warned, the probing of hardware in your system performed by"
   einfo "sensors-detect could freeze your system.  Also do not use"
   einfo "lm_sensors on certain laptop models from IBM.  See the lm_sensors"
   einfo "documentation and website for more information."
   einfo
   einfo "IMPORTANT: When you merge this package it installs kernel modules"
   einfo "that can only be used with the specific kernel version whose"
   einfo "source is located in /usr/src/linux.  If you upgrade to a new"
   einfo "kernel, you will need to remerge the lm_sensors package to build"
   einfo "new kernel modules."
   einfo

}


dont have much time to check back, so i hope they work for you :D
Back to top
View user's profile Send private message
deurk
Apprentice
Apprentice


Joined: 11 Mar 2003
Posts: 190
Location: Earth 1.3

PostPosted: Fri Aug 08, 2003 1:33 pm    Post subject: Reply with quote

Is it emergeable now?
Back to top
View user's profile Send private message
adrenalin
Tux's lil' helper
Tux's lil' helper


Joined: 29 Dec 2002
Posts: 129

PostPosted: Fri Aug 08, 2003 3:01 pm    Post subject: Reply with quote

deurk wrote:
Is it emergeable now?


after you did set up PORTAGE_OVERLAY in make.conf to i.e /usr/local/portage and copy them to /usr/local/portage/sys-apps/i2c-cvs and /usr/local/portage/sys-apps/lm_sensors-cvs you should be able to emerge them. oh and search the board for how to use custom ebuilds if the ebuilds wont be found.
Back to top
View user's profile Send private message
neuron
Advocate
Advocate


Joined: 28 May 2002
Posts: 2371

PostPosted: Fri Aug 08, 2003 5:51 pm    Post subject: Reply with quote

patch -p1 <${FILESDIR}/sensors-detect-gentoo.diff || die

fails in that ebuild (lm_sensors)
Back to top
View user's profile Send private message
adrenalin
Tux's lil' helper
Tux's lil' helper


Joined: 29 Dec 2002
Posts: 129

PostPosted: Fri Aug 08, 2003 6:11 pm    Post subject: Reply with quote

neuron wrote:
patch -p1 <${FILESDIR}/sensors-detect-gentoo.diff || die

fails in that ebuild (lm_sensors)


uh yes, because its probably not there :D save it as /usr/local/portage/sys-apps/lm_sensors-cvs/files/sensors-detect-gentoo.diff

Code:
--- lm_sensors2/prog/detect/sensors-detect.orig   2003-06-30 14:18:48.000000000 +0200
+++ lm_sensors2/prog/detect/sensors-detect   2003-06-30 14:30:39.000000000 +0200
@@ -25,6 +25,14 @@
 # each be put in a separate file, using modules and packages. That is beyond
 # me.
 
+# Changelog
+#  02/Mar/2003, Rudo Thomas <thomr9am@ss1000.ms.mff.cuni.cz>
+#    * a few small changes in config file output to reflect Gentoo Linux layout
+#      - /etc/sysconfig -> /etc/conf.d
+#      - /etc/rc.d/init.d -> /etc/init.d
+#      - added a warning to the generated config file
+#      - small change when asking about writing the new config file
+
 require 5.004;
 
 use strict;
@@ -3633,36 +3641,38 @@
   my ($modprobes,$configfile) = generate_modprobes $use_isa;
   print "\nWARNING! If you have some things built into your kernel, the \n",
         "below list will contain too many modules. Skip the appropriate ones!";
-  print "\nTo load everything that is needed, add this to some /etc/rc* ",
-        "file:\n\n";
+  print "\nTo load everything that is needed, execute these commands:\n\n";
   print "#----cut here----\n";
   print $modprobes;
-  print "# Next 2 lines are optional\n",
-        "sleep 3\n",
-        "/usr/local/bin/sensors -s\n";
   print "#----cut here----\n";
-  print "\nTo make the sensors modules behave correctly, add these lines to ",
-        "either\n",
-        "/etc/modules.conf or /etc/conf.modules:\n\n";
+  print "\nIf you want to load the modules at startup, generate a config",
+     " file\n",
+   "below and make sure lm_sensors get started ",
+   "(eg. rc-update add lm_sensors default).\n";
+  print "\nTo make the sensors modules behave correctly, add these lines to\n",
+        "/etc/modules.conf:\n\n";
   print "#----cut here----\n";
   print $configfile;
   print "#----cut here----\n";
   
-  my $have_sysconfig = -d '/etc/sysconfig';
-  print "\nDo you want to generate /etc/sysconfig/lm_sensors? (".
-    ($have_sysconfig?"YES/no":"yes/NO")."): ";
-  if ($> != 0) {
-    print "\nAs you are not root, we shall skip this step.\n";
-  } else {
-    if (($have_sysconfig and not <STDIN> =~ /^\s*[Nn]/) or <STDIN> =~ /^\s*[Yy]/) {
-      unless ($have_sysconfig) {
-        mkdir '/etc/sysconfig', 0777
-          or die "Sorry, can't create /etc/sysconfig ($!)?!?";
-      }
-      open(SYSCONFIG, ">/etc/sysconfig/lm_sensors")
-        or die "Sorry, can't create /etc/sysconfig/lm_sensors ($!)?!?";
+  my $have_config = -f '/etc/conf.d/lm_sensors';
+  print "\nDo you want to ".($have_config?"overwrite":"generate").
+     " /etc/conf.d/lm_sensors? Enter s to specify other file name?\n",
+   "  (".($have_config?"yes/NO":"YES/no")."/s): ";
+  my $reply = <STDIN>;
+
+  if (($have_config and $reply =~ /^\s*[Yy]/) or
+      (not $have_config and not $reply =~ /^\s*[Nn]/) or
+      $reply =~ /^\s*[Ss]/) {
+    my $filename = "/etc/conf.d/lm_sensors";
+    if ($reply =~ /^\s*[Ss]/) {
+      print "Specify the file to store the configuration to: ";
+      $filename = <STDIN>;
+    }
+    open(SYSCONFIG, ">".$filename)
+      or die "Sorry, can't create $filename ($!).";
       print SYSCONFIG <<'EOT';
-#    /etc/sysconfig/sensors - Defines modules loaded by /etc/rc.d/init.d/lm_sensors
+#    /etc/conf.d/sensors - Defines modules loaded by /etc/init.d/lm_sensors
 #    Copyright (c) 1998 - 2001  Frodo Looijaard <frodol@dds.nl>
 #
 #    This program is free software; you can redistribute it and/or modify
@@ -3683,13 +3693,17 @@
 # See also the lm_sensors homepage at:
 #     http://www2.lm-sensors.nu/~lm78/index.html
 #
-# This file is used by /etc/rc.d/init.d/lm_sensors and defines the modules to
-# be loaded/unloaded. This file is sourced into /etc/rc.d/init.d/lm_sensors.
+# This file is used by /etc/init.d/lm_sensors and defines the modules to
+# be loaded/unloaded. This file is sourced into /etc/init.d/lm_sensors.
 #
 # The format of this file is a shell script that simply defines the modules
 # in order as normal variables with the special names:
 #    MODULE_0, MODULE_1, MODULE_2, etc.
 #
+# Please note that the numbers in MODULE_X must start at 0 and increase in
+# steps of 1. Any number that is missing will make the init script skip the
+# rest of the modules.
+#
 # List the modules that are to be loaded for your system
 #
 EOT
@@ -3705,9 +3719,7 @@
       }
       print SYSCONFIG $sysconfig;
       close(SYSCONFIG);
-      print "Copy prog/init/lm_sensors.init to /etc/rc.d/init.d/lm_sensors\n";
-      print "for initialization at boot time.\n";
-    }
+      print "Done.\n";
   }
 }




and while we are at it, the rc - script is missing too. save it as /usr/local/portage/sys-apps/lm_sensors-cvs/files/rc

Code:
#!/sbin/runscript

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

   . /etc/conf.d/lm_sensors

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

   ebegin "Loading lm_sensors modules"
   eend $?
   if ! [ -e /proc/sys/dev/sensors ] ; then
      ebegin "  Loading i2c-proc"
      modprobe i2c-proc &>/dev/null
      eend $?
   fi
   [ -e /proc/sys/dev/sensors ] || return 1

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

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

   . /etc/conf.d/lm_sensors

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

   ebegin "Removing lm_sensors modules"
   eend $?

   # 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 "  Removing ${module}"
      rmmod ${module} &>/dev/null
      eend $?
   done

   # should we actually remove i2c-proc???
   ebegin "  Removing i2c-proc"
   rmmod i2c-proc &>/dev/null
   eend $?

   return 0
}


and note that the whole thing didnt work with my recent 2.6 mm-sources
Back to top
View user's profile Send private message
neuron
Advocate
Advocate


Joined: 28 May 2002
Posts: 2371

PostPosted: Fri Aug 08, 2003 7:13 pm    Post subject: Reply with quote

cp'ed the rc from /usr/portage and removed the patch, it worked, but crashed gkrellm2 very often, so I removed it again :/
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Fri Aug 08, 2003 9:17 pm    Post subject: Reply with quote

Moving from Desktop to Documentation, Tips & Tricks...

Erik
_________________
'Yes, Firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.'
Back to top
View user's profile Send private message
Stolz
Moderator
Moderator


Joined: 19 Oct 2003
Posts: 3007
Location: Hong Kong

PostPosted: Sun Nov 02, 2003 11:11 pm    Post subject: Reply with quote

Hi all.
Can someone send me a /etc/init.d/lm_sensors script, please?

After running "sensors-detect", when using the ccrunner84's one I get the message:
Code:

#root@localhost lm_sensors-2.8.1 # cp /etc/sysconfig/lm_sensors /etc/conf.d/
#root@localhost lm_sensors-2.8.1 # /etc/init.d/lm_sensors start
 * ERROR:  "/etc/init.d/lm_sensors" has syntax errors in it; not executing...


I have also tried with the lmsensors original script:
Code:
root@azul lm_sensors-2.8.1 # cp prog/init/lm_sensors.init /etc/init.d/lm_sensors
root@localhost lm_sensors-2.8.1 # /etc/init.d/lm_sensors start
/etc/init.d/lm_sensors: line 45: /etc/init.d/functions: File or directory not found


Can someone help me?

Thanks in advice and sorry for my poor english.
Back to top
View user's profile Send private message
whosrodney
n00b
n00b


Joined: 05 Oct 2003
Posts: 27

PostPosted: Wed Nov 12, 2003 7:21 am    Post subject: Reply with quote

I followed your how-to and it worked beautifully. However, later I discovered that there is an ebuild for 2.7, which I wouldn't mind trying to get work, since I would like Portage to know about the package. How would I go about uninstalling i2c and lm_sensors which were installed according to your how-to?
Back to top
View user's profile Send private message
eWoud
n00b
n00b


Joined: 06 Jul 2002
Posts: 20

PostPosted: Wed Nov 12, 2003 8:20 pm    Post subject: Reply with quote

Here's how I do it:

- make sure there's no i2c in your kernel (or only compiled as a module)
- emerge /usr/portage/sys-apps/i2c/i2c-2.8.0.ebuild
- emerge /usr/portage/sys-apps/lm-sensors/lm-sensors-2.8.0.ebuild
- sensors-detect (just press <enter> on all the questions, and answer Yes if it asks to write /etc/conf.d/lm_sensors)
- remove "modprobe to-be-written" from /etc/conf.d/lm_sensors
- rc-update add lm_sensors default
- /etc/init.d/lm_sensors start

done!

you should be able to read the sensors with 'sensors' or a grafical tool like GKrellM
Back to top
View user's profile Send private message
DArtagnan
l33t
l33t


Joined: 30 Apr 2002
Posts: 942
Location: Israel, Jerusalem

PostPosted: Tue Nov 18, 2003 5:27 pm    Post subject: Reply with quote

eWoud wrote:
Here's how I do it:

- make sure there's no i2c in your kernel (or only compiled as a module)
- emerge /usr/portage/sys-apps/i2c/i2c-2.8.0.ebuild
- emerge /usr/portage/sys-apps/lm-sensors/lm-sensors-2.8.0.ebuild
- sensors-detect (just press <enter> on all the questions, and answer Yes if it asks to write /etc/conf.d/lm_sensors)
- remove "modprobe to-be-written" from /etc/conf.d/lm_sensors
- rc-update add lm_sensors default
- /etc/init.d/lm_sensors start

done!

you should be able to read the sensors with 'sensors' or a grafical tool like GKrellM


And how about if I have kernel 2.6-test9 ?
Regards
_________________
All for one and one for All
--

MACPRO machine...
Back to top
View user's profile Send private message
DArtagnan
l33t
l33t


Joined: 30 Apr 2002
Posts: 942
Location: Israel, Jerusalem

PostPosted: Tue Nov 18, 2003 5:29 pm    Post subject: Reply with quote

eWoud wrote:
Here's how I do it:

- make sure there's no i2c in your kernel (or only compiled as a module)
- emerge /usr/portage/sys-apps/i2c/i2c-2.8.0.ebuild
- emerge /usr/portage/sys-apps/lm-sensors/lm-sensors-2.8.0.ebuild
- sensors-detect (just press <enter> on all the questions, and answer Yes if it asks to write /etc/conf.d/lm_sensors)
- remove "modprobe to-be-written" from /etc/conf.d/lm_sensors
- rc-update add lm_sensors default
- /etc/init.d/lm_sensors start

done!

you should be able to read the sensors with 'sensors' or a grafical tool like GKrellM


And how about if I have kernel 2.6-test9 ?
Regards
_________________
All for one and one for All
--

MACPRO machine...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum