Laptop Mode Tools README
------------------------

Author:  Bart Samwel (bart@samwel.tk, http://www.xs4all.nl/~bsamwel)


Installation
------------

To install, run ./install.sh. That's all there's to it. This will install
laptop mode, which will be enabled automatically when your laptop works
on batteries.  Debian users, please install the Debian package that can
be found on the home page and in the unstable repository!


Notes
-----

* To configure the laptop mode scripts, edit /etc/laptop-mode/laptop-mode.conf.

* The original laptop mode documentation that was distributed with the Linux
  kernel is included in this package as Documentation/laptop-mode.txt. It
  contains additional documentation, tips and tricks.


History
-------

 0.90   24 July 2004   * Initial release
 
 0.91   25 July 2004   * Add experimental APM support
 
 0.92   25 July 2004   * Add support for doing hdparm on multiple hard drives
                       * Various other fixes (thanks to Peter Ross)
		       
 0.93   28 July 2004   * Various small fixes.
                       * Enable laptop mode when booting on battery. (Tested only
		         on Debian, feedback on other distributions wanted!)
			 
 0.94   29 July 2004   * Added Debian packaging support. If you use Debian, please
                         use the package provided on the laptop-mode-tools
		         website.
                       * Moved laptop_mode script to /usr/sbin/laptop_mode, because
		         it uses programs in /usr.
		       *  Moved Debian-style config file to /etc/laptop-mode/laptop-mode.conf
		         (/etc/default/laptop-mode is intended only for init-scripts.)
		       * Wrote manual pages (not installed in non-Debian for now.)

 0.95   31 July 2004   * Moved Debian support into a separate patch.
                       * Fixed bashism in /etc/init.d/laptop-mode
		       * Move all config files to /etc/laptop-mode/laptop-mode.conf
		       * Add support for "always-on", using LAPTOP_MODE_ALWAYS_ON=1 in config file.

 0.96   05 Aug 2004    * Installer was broken in 0.95.
                       * APM scripts now support LAPTOP_MODE_ALWAYS_ON as well (i.e. they didn't before :) )
		       * chkconfig support in the init script

 0.97   12 Aug 2004    * Fixed bug in APM script -- it was backwards. :)
                       * Fixed default setting for HD.

 0.98   18 Aug 2004    * Fixed bug in ACPI battery script -- missing discharge rate would lead to
                         division by zero.
		       * Added "auto" option to /usr/sbin/laptop_mode script. This autodetects
		         the AC state and enables/disables laptop mode accordingly, using either
			 on_ac_power (if available) or using the /proc/acpi and /proc/apm
			 values.
		       * Modified the APM and ACPI event scripts to simply call "laptop_mode auto".

 0.99   18 Aug 2004    * Fixed bug that broke DO_CPU in the config file.

 1.00    3 Sep 2004    * Use update-rc.d to install init scripts. Init scripts
			 are now installed in the default runlevels, not in
			 the bootup/sysinit scripts.
		       * Reduced dependence on location of certain binaries,
		         depend more on PATH.
		       * Optimize away double actions -- if laptop mode is
		         already in the requested state, the laptop_mode
			 script now does nothing instead of re-initializing
			 laptop mode to the state it was already in.
		       * Laptop mode is now enabled using the "master switch"
		         /etc/init.d/laptop-mode. If it has not been called
			 with parameter "start", then "laptop_mode start"
			 will not start laptop mode. (The file that is used
			 to control this is /var/run/laptop-mode-enabled.)
		       * Reduced default value for LM_SECONDS_BEFORE_SYNC to 
		         2 (was 5, but this saves more power).
		       * Reduced default value for MINIMUM_BATTERY_MINUTES to
		         7 (was 10).
		       * Reduced default value for BATT_HD to 1 (5 seconds),
		         was 4 (20 seconds).
		       * Reduced default value for DIRTY_BACKGROUND_RATIO to
		         1 (was 5).
		       * Increased default value for DIRTY_RATIO to 60 (was
		         40 previously).
		       * Default value for HD changed to "/dev/hda /dev/hdb /dev/hdc /dev/hdd".
		       * Corrected documentation to state that READAHEAD is in
		         kilobytes, not in 512-byte sectors.
		       * Added option ACPI_WITHOUT_AC_EVENTS. Use this if your
		         ACPI doesn't generate AC events but does generate
			 battery events.
		       

1.01    3 Oct 2004     * Updated commented-out default values for configuration
                         parameters in config file, which were not all updated
			 correctly in the previous version.
		       * Updated the version number 0.100 in the release notes
		         to 1.00. Just goes to show how long I doubted on whether
			 to call it 1.00. :)
		       * Changed the way the config file is read. Formerly used
		         the construct ${VAR:-'value'} to set defaults, now I
			 simply set the values and then source the config file.
			 The immediate effect of this is that the surrounding
			 environment cannot influence the laptop mode anymore,
			 moving the app closer to being safe to use suid. Note
			 that it is NOT SAFE to run laptop_mode suid at this
			 moment, I haven't taken all necessary security
			 measures!
		       * The "hdparm -B" values are now configurable using the
		         (AC|BATT)_HDPARM_POWERMGMT options. The option
			 DO_HD_POWERMGMT can be set to 0 to disable the -B
			 behaviour altogether.
		       * The "hdparm -B" calls are now done BEFORE the -S
		         calls. This is because some HDs change the -S setting
			 as an effect of using the -B option.
		       * Use "chkconfig" when it is available to install the
		         rc.d-to-init.d links. (Until now only update-rc.d was
			 supported.)
		       * AC_HD is split into AC_HD_WITH_LM and AC_HD_WITHOUT_LM.
		         The former value is used when AC power is present but
			 laptop mode is still enabled (e.g. when the option
			 LAPTOP_MODE_ALWAYS_ON is enabled). The latter value
			 is used when AC power is present and laptop mode is
			 disabled. The AC_HDPARM_POWERMGMT option has been split
			 in the same way. The old option AC_HD is still supported,
			 if the config file specifies it then it overrides both
			 new config values.
		       * Ripped usage of on_ac_power out of the script and included
		         native support for pmud. This is because on_ac_power is
			 part of apmd, and doesn't support pmud natively (except
			 for the Debian version, which does support pmud). I don't
			 want to depend on having apmd installed or on running on
			 a Debian distro.

1.02    3 Oct 2004     * Bugfix release. The calls to chkconfig in the installer
		         didn't work because the installer wrongfully detected
			 the presence of update-rc.d.

1.03   27 Oct 2004     * Add LM_WHEN_LID_CLOSED, to enable laptop mode when the
		         laptop's lid is closed. Only works on ACPI.
		       * Fixed incorrect default in a comment in the config file.
		       * Fixed a bug in 1.01 which meant that laptop mode was never
		         enabled when using APM.

1.04    9 Nov 2004     * SEE ALSO sections in manpages updated to respect common
                         conventions.
		       * Mention path of laptop_mode script in manual page.
		       * Make AC detection work again on PMU (i.e. Mac) systems.
		       * Removed config file defaults. Simply define them in the
		         config file. They were a pain to maintain, and I had
			 to repeat them in several places (manual page, all
			 files in which the config was used), which was too
			 error-prone.
		       * Added support for syslog configuration switching
		         based on laptop mode and power state. See the new
			 config file and the accompanying manual page.
		       * Added support for forcing laptop mode start/stop
		         using second "force" option to /usr/sbin/laptop_mode.
		       * Added support for "/" in mount options. It was used
		         as a delimiter for the sed "s" command, and that
			 went wrong with loopback devices.
		       * Dropped the DocBook SGML sources for the manpages,
		         started working with pure nroff sources. The output
			 of docbook-to-man was crap recently, so I decided
			 to cut it out of the loop.

1.05	12 Apr 2005    * Detection of init.d or rc.d locations. Should make
			 things work better on Slackware.
		       * Make things work if /proc/acpi/ac_adapter contains
		         no AC adapters.
		       * Signal acpid to re-read its configuration after
		         installing.
		       * Restore config file defaults, so that old config
		         files will keep working.
		       * Made syslog daemon name configurable, so that you
		         can make it signal alternative syslog daemons.
			 (The signal to be sent still needs to be SIGHUP
			 though.)
		       * Remove error output from "which" in the
		         install script. The result was handled gracefully
			 anyway, so why print the output?
		       * New configuration setting REMOUNT_PARTITIONS.
		         Default is "", which means all partitions on the
			 drives listed in the HD option.
		       * New configuration settings MINIMUM_BATTERY_CHARGE_MAH
		         and MINIMUM_BATTERY_CHARGE_MWH to specify the
			 minimum remaining charge in the battery for
			 laptop mode to remain enabled (in mAh and mWh,
			 respectively). This is intended
			 as a replacement for MINIMUM_BATTERY_MINUTES
			 for systems that don't specify a discharge rate.
		       * When booting up on AC, laptop mode did not
		         set the correct syslog.conf, because it thought
			 "laptop mode is already disabled so I don't
			 need to do anything".
		       * Added a manual page for lm-syslog-setup.
		       * Attempt at support for pbbuttonsd and pmud. The
		         APM support files are no longer installed when
			 /proc/pmu exists (i.e. your system has PMU
			 support), because those interfere with the
			 native PMU support.
		       * Lowered READAHEAD default from 8MB to 3MB. The
		         high readahead caused the system cache to be
			 flushed by too-large readaheads on other files.

References
----------

The laptop mode website.

  http://www.xs4all.nl/~bsamwel/laptop_mode

The laptop mode tools website.

  http://www.xs4all.nl/~bsamwel/laptop_mode/tools

