[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: GPG burns my notebook!

antongiulio05 wrote:

> Hi Corey,
> I have launched your script in my chroot (after installed 'hwtools'), but I got these errors:
> $ sh temptests.sh all
> Running test: test_idle
> cat: /sys/bus/i2c/devices/0-0290/temp1_input: No such file or directory
> temptests.sh: line 85: / 1000: syntax error: operand expected (error token is "/ 1000")
> Giulio

Well, I'm back from vacation now.

If you want to run my script you need to configure it for your system. I
guess I'll go into more detail.

1. In Linux 2.6 all the lm_sensors drivers create sysfs "files". You
need to find your CPU sensor file. 'cd /sys/bus/i2c/devices' and see
what's there; you should find one or more symlinks to directories. Look
inside each one. The files named temp*_input correspond to the
temperature sensors. Cat each one until you see which corresponds to
your CPU temperature (they're probably scaled by 1000).

2. Open the script in a text editor. Near the top you'll see a
"TWEAKABLE VARIABLES" section. Think of that like a configuration file.
Replace the value being assigned to SENSOR with the path to the sysfs
file you found in the previous step. If necessary, replace the value
being assigned to DIVISOR too.

...at this point some people might be wondering why I don't just parse
the output of the sensors command. Catting a file and letting the shell
divide by 1000 is a lot faster than "sensors | awk '/CPU Temp:/ {print
$3}'", the fastest parse I can think of. Maybe I'm being picky, but I
wanted to avoid extra CPU use.

3. Look at the other values in the "TWEAKABLE VARIABLES" section. Change
them if you want.

4. Keep going down to the "TEST FUNCTIONS" section. Look at the
functions that start with test_. All the commands in those functions
must run on your system or the script will quit in the middle of a run.
You'll notice that I use dchroot for the programs that must run in my
32-bit chroot. All the other programs are in my shell's $PATH. Your
system will likely differ from mine and some of those commands will not
run. You have three options:
Option 1:
Alter the command to work on your system: remove "dchroot" if you need
to, type in an absolute path, etc.
Option 2:
Alter your system so the command works: configure dchroot, download
prime95 and cpuburn-in and put them in your $PATH, etc.
Option 3:
Remove the test if you're not interested in it or you can't make it run.
To do this, don't bother deleting the function -- just disable it by
removing its name from the ALL_TESTS variable up in the "TWEAKABLE
VARIABLES" section.


Reply to: