Commit Graph
68 Commits
Author SHA1 Message Date
Jean Delvare 8d00528cd3 Detect improperly formatted FCTEMPS value (#2293).
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5102 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-01-09 10:59:48 +00:00
Jean Delvare e6c94c66ed Bash doesn't do lazy evaluation on test-like expressions, so don't
assume it does (#2292).


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5100 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-01-08 20:10:52 +00:00
Jean Delvare 936c5f66c2 Switch to SVN revision numbering, so that the version is always up-to-date.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5099 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-01-08 19:12:44 +00:00
Jean Delvare 7963e7cf13 Repeat available configuration options before prompt (#2289).
The code isn't very clean but that's the best I could come up with.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5098 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-01-08 19:02:40 +00:00
Jean Delvare 9bf2d8c187 Warn about outputs found in automatic mode.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5063 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-12-04 10:21:16 +00:00
Jean Delvare 972e5e2f01 Really hide errors on sysfs writes.
Deal gracefully with read-only pwm_enable files.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5061 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-12-04 09:27:49 +00:00
Jean Delvare c0637bebe0 pwmconfig: Give the fans some time to spin up.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5025 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-11-18 16:16:41 +00:00
Jean Delvare a95f194cef pwmconfig: Better diagnostics in pwmdisable.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5023 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-11-18 16:01:04 +00:00
Jean Delvare 855b1aa6ef The lm-sensors team has no legal existence and thus can't hold a copyright.
I tried to assign the copyright back to the original author where possible.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4900 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-29 19:08:30 +00:00
Jean Delvare 0c24a60643 Drop the CONFORMING TO sections from the man pages. lm-sensors is in no way
an official standard so it doesn't make much sense. Instead, use the 4th
field of .TH to mention that these tools are part of lm-sensors.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4699 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-23 08:14:48 +00:00
Jean Delvare fe165fea49 Fix error message.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4692 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-21 09:08:52 +00:00
Jean Delvare 982afbce24 Only write integer values to pwm files.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4591 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-08 11:17:26 +00:00
Jean Delvare cd0b8c3489 Delete fancontrol.pl. The reason given when it was added was that the
bash implementation was spawning too many child processes, and that
was true, but this has been addressed since. And I don't particularly
enjoy maintaining two scripts doing exactly the same thing.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4590 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-08 10:13:11 +00:00
Jean Delvare 759098c8f8 Use linear interpolation instead of quadratic to choose PWM values.
This is simpler and will work better in most cases. For example this
should address at least part of ticket #2224. It seems that quadratic
was used to lower the average noise level, but I don't think this is a
valid reason. The new MINPWM and MAXPWM parameters will also let the
user control the noise level if really needed.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4589 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-08 10:04:48 +00:00
Jean Delvare 835f9b492c fancontrol: Better integration with init scripts (picked from Suse)
* Do not return with an error when receiving SIGTERM.
* Handle signals while sleeping.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4443 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-12 11:37:59 +00:00
Jean Delvare 57044be111 fancontrol:
* Check for configuration file validity
fancontrol and pwmconfig:
* Support optional min and max PWM values
Documentation updated accordingly.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4442 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-12 11:37:19 +00:00
Jean Delvare 59a0831fa6 More cleanups to fancontrol:
* No longer depend on grep. We already depend on egrep so let's use it
everywhere.
* Don't depend on awk to compute the target PWM value. Bash has an arithmetic
expression evaluation engine which does the job just fine.
* Use read instead of cat to read the sensor values. read is built-in, so
it's cheaper.
* When sysfs is used (2.6 kernel), do not postproces the sensor value reads
with cut, as it is not needed.
* Update the dependency list. 


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4441 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-12 11:36:15 +00:00
Jean Delvare e56e0039ef Cleanups to fancontrol:
* Use let for arithmetic evaluation. Patch taken from the Suse package.
* Kill old commented-out code.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4440 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-12 11:34:19 +00:00
Jean Delvare d10c5f218b pwmconfig: Use smaller steps for low PWM values. Inspired from a patch
from the openSuse sensors package. This is a good idea because the
PWM/speed relation isn't linear, and it is frequent that the speed
changes are concentrated in the low PWM range.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4381 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-04-27 13:41:32 +00:00
Mark M. Hoffman c5ffa7b635 Merge from trunk (4303:4355) out to 3.0.0 branch.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4357 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-04-03 12:55:30 +00:00
Jean Delvare 63228c12b3 Strip unneeded whitespace on configuration load.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4296 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-01-14 15:42:33 +00:00
Jean Delvare 0662aaa299 fancontrol.pl:
* Disable debugging by default
* Add support for non-i2c drivers
* More tolerant config file parsing (for some reason pwmconfig
  adds unneeded spaces, it should probably be fixed but it's always
  better to be tolrant nevertheless)


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4295 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-01-14 15:20:06 +00:00
Jean Delvare 2387b4cd73 Drop commented out code.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4288 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-01-09 07:58:52 +00:00
Jean Delvare b162d642a9 pwmconfig, fancontrol: Add support for non-i2c drivers. So far the
scripts were assuming that all drivers were i2c-based. As we want to
get rid of i2c-isa in Linux 2.6 soon, it's important to ensure that
platform drivers are handled properly.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4286 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-01-07 22:10:02 +00:00
Jean Delvare 55e8649c0d pwmconfig, fancontrol: Gracefully handle errors when writing to
sysfs files, as bash 3.1 otherwise displays them and this tends to
frighten the user.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4280 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-01-05 16:34:32 +00:00
Jean Delvare 5ff0a6b0e7 Use mktemp instead of tempfile to create the temporary config file.
We are already using mktemp elsewhere in the script, and it seems to be
more widely available than tempfile.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4153 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-09-07 15:56:11 +00:00
Rudolf Marek 74a7992f19 Transion to new website, part2 - move more links, fix the CVS->SVN
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4064 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-07-02 20:15:09 +00:00
Jean Delvare 28f8be1038 Drop all references to the old mailing list.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3075 7894878c-1315-0410-8ee3-d5d059ff63e0
2005-09-08 16:29:41 +00:00
Rudolf Marek 8894546f1f Fix potentional security issue. Thanks to Javier Fernández-Sanguino Peña <jfs@computer.org>
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3060 7894878c-1315-0410-8ee3-d5d059ff63e0
2005-08-20 19:45:53 +00:00
Jean Delvare 200758f450 Strip useless whitespace before new line at end of string.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3025 7894878c-1315-0410-8ee3-d5d059ff63e0
2005-06-23 21:07:10 +00:00
Mark D. Studebaker f7230a198e fix compile errors; patch from
Sergey Vlasov <vsu@altlinux.ru>


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2988 7894878c-1315-0410-8ee3-d5d059ff63e0
2005-05-04 21:12:08 +00:00
Mark D. Studebaker 57782cede2 fix handling of alternate config file name
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2930 7894878c-1315-0410-8ee3-d5d059ff63e0
2005-03-15 19:24:25 +00:00
Mark D. Studebaker 78f5390e51 allow readonly pwmx_enable files (lm85 kernel 2.6)
tickets 1874, 1879


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2883 7894878c-1315-0410-8ee3-d5d059ff63e0
2005-01-29 23:04:25 +00:00
Jean Delvare 220d136e06 New manual pages for fancontrol and pwmconfig, courtesy of
Aurelien Jarno.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2873 7894878c-1315-0410-8ee3-d5d059ff63e0
2005-01-27 21:03:01 +00:00
Jean Delvare a0a471c8c5 *** SECURITY FIX ***
Secure the creation of temporary files. Problem found by Javier
Fernandez-Sanguino Pena, patch by Aurelien Jarno.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2871 7894878c-1315-0410-8ee3-d5d059ff63e0
2005-01-26 21:12:50 +00:00
Jean Delvare cb64b74141 Handle both pwm files naming scheme for 2.6 kernels (ticket
#1844).


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2798 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-12-20 22:00:10 +00:00
Jean Delvare 8d3f9bebd9 Sync with Dean.
"Appended to this message is the current version of the
fancontrol script that I am happily using.  It uses POSIX::_exit()
to avoid the double-call to the END block, plus it logs STDOUT and
STDERR to different logfiles."


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2606 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-06-23 18:34:24 +00:00
Jean Delvare 35f4d9595c Make sure restorefans is called only once. Suggested by James
Olin Oden.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2605 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-06-22 18:51:08 +00:00
Jean Delvare e7e4c799da Implement "make user_uninstall". Original patch contributed by
Rudolf Marek.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2604 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-06-20 14:18:28 +00:00
Mark D. Studebaker 6927c8e1c5 (mds)
From: Dean Takemori <deant@hawaii.rr.com>
Add END {} block to restore fans on many kinds of errors/interrupts.
Remove arugment from restorefans


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2602 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-06-19 19:56:12 +00:00
Mark D. Studebaker 77dd1086a8 add fancontrol.pl
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2572 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-31 04:23:24 +00:00
Mark D. Studebaker c86fb14b69 from Dean Takemori <deant@hawaii.rr.com>:
Still technically beta quality, but in my local testing it works equivalently to the /bin/sh
script provided in lm_sensors-2.7.6/prog/pwm but with the bonuses that
a) it doesn't need to spawn outside programs (sleep, grep etc)
b) it can daemonize itself, so it works better as a /etc/init.d script


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2571 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-31 04:19:24 +00:00
Marius Reiner 852268883d (mariusr) typo which caused problems with old sed versions
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2553 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-20 17:25:29 +00:00
Marius Reiner 93dfb6fa12 (mariusr) restorefans on TERM and KILL (submitted by Stephen Kitt)
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2549 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-18 19:12:43 +00:00
Marius Reiner 654982ccf3 (mariusr) check the other mandatory settings, make FCFANS optional
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2546 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-18 13:59:59 +00:00
Jean Delvare 08091f09b2 Fix typo. Reported by Rutger Nijlunsing.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2520 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-09 17:27:55 +00:00
Jean Delvare 12e4bc4853 Follow new sysfs naming scheme.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2514 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-08 19:38:20 +00:00
Jean Delvare f032b85a9d Use new sysfs file name conventions. Suggested by Rutger
Nijlunsing.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2510 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-08 11:33:47 +00:00
Mark D. Studebaker 64aeb747a4 remove -o and -g args to install
Date: Thu, 18 Dec 2003 22:42:36 +0100
From: Haakon Riiser <haakon.riiser@fys.uio.no>
To: sensors@Stimpy.netroedge.com
Subject: lm_sensors 2.8.2 / DESTDIR / root

The reason for this email is that I always try to avoid running
Makefiles as root, even during 'make install'.  Therefore, I
always use the DESTDIR feature, when it's available.  Until today,
I always built i2c and lm_sensors by doing

  $ make
  $ make -i install DESTDIR=/foo
  $ cd /foo && su root && fix permissions/ownership && install

The -i flag to make install is a kludge to avoid having to be root
while installing to the DESTDIR, and it's only required because
the files are installed with "-o root -g root".  Using the -i
flag is of course not a good idea, since more fatal errors can
easily fly by undetected.

Today, I upgraded to Linux 2.6.0, and tried a similar install
procedure for lm_sensors, except that the make target is now "user"
and the install target is "user_install".  I now noticed that the
DESTDIR variable is not used everywhere in "user_install", so I
couldn't use the -i kludge anymore.  Instead, I wrote a patch that
removes the "-o root -g root" arguments to install everywhere, and
I also tried to add DESTDIR to all files/directories installed.
(The patch only applies to lm_sensors, not i2c, since only
lm_sensors is required in Linux 2.6.0.)

There's really no reason to say -o root -g root anyway, since if you
do install directly with make install, you have to be logged in as
root, and then the files will get the right ownership by default.
Much of the point of installing to a temporary DESTDIR is that you
don't have to be root, and that you can prepare the installation
by hand.  Fixing the ownership is trivial:

  chown -R root.root $DESTDIR


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2189 7894878c-1315-0410-8ee3-d5d059ff63e0
2003-12-23 23:13:38 +00:00
Mark D. Studebaker 8de677db34 pwmconfig: write fan dependency to config file
fancontrol: monitor fan speed;
		trap signal and restore fans on trap;
		check read/write results and abort if fail;
		support 2.6 kernels;
		remove DEBUG=1


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2188 7894878c-1315-0410-8ee3-d5d059ff63e0
2003-12-20 22:35:23 +00:00