Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/etc/powerd/scripts Remove the sony(4) and piixpcib(4) based ...
details: https://anonhg.NetBSD.org/src/rev/38e338dac96a
branches: trunk
changeset: 760218:38e338dac96a
user: jruoho <jruoho%NetBSD.org@localhost>
date: Fri Dec 31 09:29:43 2010 +0000
description:
Remove the sony(4) and piixpcib(4) based actions; all powerd(8) scripts
should either be machine-independent or provide hints for the user. Also
clean the script a little.
diffstat:
etc/powerd/scripts/acadapter | 66 ++++++++++++++++++++-----------------------
1 files changed, 31 insertions(+), 35 deletions(-)
diffs (110 lines):
diff -r b4306e3aeec9 -r 38e338dac96a etc/powerd/scripts/acadapter
--- a/etc/powerd/scripts/acadapter Fri Dec 31 09:19:43 2010 +0000
+++ b/etc/powerd/scripts/acadapter Fri Dec 31 09:29:43 2010 +0000
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $NetBSD: acadapter,v 1.3 2008/08/22 11:18:21 pgoyette Exp $
+# $NetBSD: acadapter,v 1.4 2010/12/31 09:29:43 jruoho Exp $
#
# Generic script for acadapter events.
#
@@ -11,46 +11,40 @@
case "${2}" in
pressed)
logger -p info "${0}: Full performance mode" >&1
- # The following turns up brightness on a Sony Vaio laptop
- /sbin/sysctl -w hw.sony0.brt=8 >/dev/null 2>&1
- # Enable full performance mode for speedstep CPUs
- /sbin/sysctl -w machdep.speedstep_state=1 2>&1
- # Disable power saving mode on all network interfaces
+
+ # Disable power saving mode on all network interfaces.
+ #
for intf in $(/sbin/ifconfig -l); do
/sbin/ifconfig $intf -powersave >/dev/null 2>&1
done
+ # If you want to keep your hard disk idle while running
+ # on battery, the following commands will help.
#
- # If you want to keep your hard disk idle while running on
- # battery, the following commands will help.
- #
+ # /sbin/atactl wd0 setidle 300
+ # /sbin/atactl wd0 setstandby 600
- # Disk idle timeouts
- #/sbin/atactl wd0 setidle 300
- #/sbin/atactl wd0 setstandby 600
- # Make sure syslogd is running
- #pkill syslogd
- #/etc/rc.d/syslogd start
- # Startup cron daemon when running on power
- #/etc/rc.d/cron start
+ # Make sure syslogd is running.
+ #
+ # pkill syslogd
+ # /etc/rc.d/syslogd start
- # All finished
+ # Start cron daemon when running on power.
+ #
+ # /etc/rc.d/cron start
+
exit 0
;;
released)
logger -p info "${0}: Power saving mode" >&1
- # The following turns down brightness on a Sony Vaio laptop
- /sbin/sysctl -w hw.sony0.brt=0 >/dev/null 2>&1
- # Enable power saving mode for speedstep CPUs
- /sbin/sysctl -w machdep.speedstep_state=0 >/dev/null 2>&1
- # Enable power saving mode on all network interfaces
+ # Enable power saving mode on all network interfaces.
+ #
for intf in $(/sbin/ifconfig -l); do
/sbin/ifconfig $intf powersave >/dev/null 2>&1
done
- #
# When running on battery, we want to keep the disk idle for as long
# as possible. Unfortunately, things like cron and syslog make this
# very difficult. If you can live without cron or persistent logging,
@@ -58,21 +52,23 @@
#
# If you still want to see syslog messages, you can create a custom
# /etc/syslog.conf.battery that writes messages to /dev/console or
- # possibly a free wsdisplay screen.
+ # possibly a free wsdisplay screen. Alternatively, /var/log could
+ # be mounted as tmpfs.
+
+ # Disk idle timeouts.
#
+ # /sbin/atactl wd0 setidle 30
+ # /sbin/atactl wd0 setstandby 120
- # Disk idle timeouts
- #/sbin/atactl wd0 setidle 30
- #/sbin/atactl wd0 setstandby 120
-
- # Stop the cron daemon
- #/etc/rc.d/cron stop
+ # Stop the cron daemon.
+ #
+ # /etc/rc.d/cron stop
- # Restart syslogd using a diskless configuration
- #pkill syslogd
- #/usr/sbin/syslogd -s -f /etc/syslog.conf.battery
+ # Restart syslogd using a diskless configuration.
+ #
+ # pkill syslogd
+ # /usr/sbin/syslogd -s -f /etc/syslog.conf.battery
- # All finished
exit 0
;;
Home |
Main Index |
Thread Index |
Old Index