summaryrefslogtreecommitdiff
path: root/pm
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2008-06-30 19:08:44 -0500
committerVictor Lowther <victor.lowther@gmail.com>2010-06-05 13:38:38 -0500
commit6ff56aa5ec0aa5756162e60b26fd3cbdfb8abcfa (patch)
treef6ffbf09feb62a46ff50bd4f7adef9762a023ba0 /pm
parent2a09b333c3096cfb0d361a983a4c479c4d54ed09 (diff)
Make laptop-mode, readahead, and xfs_buffer only apply
when we are running on something that looks like a laptop. "looks like a laptop" = dmidecode says that chassis type is Portable.
Diffstat (limited to 'pm')
-rw-r--r--pm/power.d/laptop-mode5
-rw-r--r--pm/power.d/readahead1
-rw-r--r--pm/power.d/xfs_buffer1
3 files changed, 4 insertions, 3 deletions
diff --git a/pm/power.d/laptop-mode b/pm/power.d/laptop-mode
index aae2335..62a6af4 100644
--- a/pm/power.d/laptop-mode
+++ b/pm/power.d/laptop-mode
@@ -4,9 +4,8 @@ VM="/proc/sys/vm"
[ -w $VM/laptop_mode -a -w $VM/dirty_ratio ] || exit $NA
-# We might only want to enable laptop mode on actual laptops.
-# It really depends on how green we want to try to make the Linux
-# world.
+# only actually enable on laptops for now.
+[ "$CHASSIS_TYPE" = "Portable" ] || exit $NA
laptop_mode_ac() {
# disable laptop mode, set vm parameters back to sane defaults
diff --git a/pm/power.d/readahead b/pm/power.d/readahead
index 3636909..5cae541 100644
--- a/pm/power.d/readahead
+++ b/pm/power.d/readahead
@@ -1,6 +1,7 @@
#!/bin/sh
[ -x /sbin/blockdev ] || exit $NA
+[ "$CHASSIS_TYPE" = "Portable" ] || exit $NA
# more readahead = (hopefully) less hard drive activity.
# less readahead = less trashing the page cache.
diff --git a/pm/power.d/xfs_buffer b/pm/power.d/xfs_buffer
index 3d32ee4..e3e9ebd 100644
--- a/pm/power.d/xfs_buffer
+++ b/pm/power.d/xfs_buffer
@@ -4,6 +4,7 @@
XFS="/proc/sys/fs/xfs"
[ -f $XFS/age_buffer_centisecs ] || exit $NA
+[ "$CHASSIS_TYPE" = "Portable" ] || exit $NA
# Why does XFS have its own parameters instead of just using the
# VM subsystem ones? Only SGI knows...