diff options
author | Roy Marples <uberlord@gentoo.org> | 2006-06-26 20:07:24 +0000 |
---|---|---|
committer | Roy Marples <uberlord@gentoo.org> | 2006-06-26 20:07:24 +0000 |
commit | 22c3213965d01bf3004025f206fff8b90e2738c8 (patch) | |
tree | 8d09772737ff178fe547fe495a699694f3e53567 /app-laptop/hdapsd/files | |
parent | Keyworded ~sparc wrt #135520 (diff) | |
download | gentoo-2-22c3213965d01bf3004025f206fff8b90e2738c8.tar.gz gentoo-2-22c3213965d01bf3004025f206fff8b90e2738c8.tar.bz2 gentoo-2-22c3213965d01bf3004025f206fff8b90e2738c8.zip |
Initial import based on the work by Michael Gaber and Jeff Grafton, #119845.
(Portage version: 2.1.1_pre1-r2)
Diffstat (limited to 'app-laptop/hdapsd/files')
-rw-r--r-- | app-laptop/hdapsd/files/digest-hdapsd-20060409 | 6 | ||||
-rw-r--r-- | app-laptop/hdapsd/files/hdapsd.conf | 11 | ||||
-rw-r--r-- | app-laptop/hdapsd/files/hdapsd.init | 49 |
3 files changed, 66 insertions, 0 deletions
diff --git a/app-laptop/hdapsd/files/digest-hdapsd-20060409 b/app-laptop/hdapsd/files/digest-hdapsd-20060409 new file mode 100644 index 000000000000..2e48b8e201e9 --- /dev/null +++ b/app-laptop/hdapsd/files/digest-hdapsd-20060409 @@ -0,0 +1,6 @@ +MD5 7ccac69e3c1a6134117f6cdb3e5deeef hdaps_protect-patches-1.tar.bz2 6179 +RMD160 5b173034eebbbee598e01d45e5e76e2859c0a829 hdaps_protect-patches-1.tar.bz2 6179 +SHA256 ab4192fa3a26497fe9fed63bfaedfebc74d288a85e7283b1bc338984be1133dd hdaps_protect-patches-1.tar.bz2 6179 +MD5 ef8bf36c67e2aee8914be178012b3861 hdapsd-20060409.c.bz2 5253 +RMD160 0b8d07a2612bd4888014913bd8810de664352bfb hdapsd-20060409.c.bz2 5253 +SHA256 e8e1788d485814cd294c33744b60265423d8971abf5ab50b037f05de2c710a21 hdapsd-20060409.c.bz2 5253 diff --git a/app-laptop/hdapsd/files/hdapsd.conf b/app-laptop/hdapsd/files/hdapsd.conf new file mode 100644 index 000000000000..622190954c74 --- /dev/null +++ b/app-laptop/hdapsd/files/hdapsd.conf @@ -0,0 +1,11 @@ +# The name of the disk device that hdapsd should monitor. +# Usually this is 'hda' or 'sda' the primary master. +DISK="sda" + +# hdapsd sensitivity +# The lower the threshold is the earlier +# the heads are parked when the laptop is shaked +THRESHOLD="10" + +# Set any extra options here, like -a for Adaptive mode +OPTIONS="-a" diff --git a/app-laptop/hdapsd/files/hdapsd.init b/app-laptop/hdapsd/files/hdapsd.init new file mode 100644 index 000000000000..00609c1cfac9 --- /dev/null +++ b/app-laptop/hdapsd/files/hdapsd.init @@ -0,0 +1,49 @@ +#!/sbin/runscript +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 + +depend() { + need localmount +} + +checkconfig() { + if [[ -z ${DISK} || -z ${THRESHOLD} ]] ; then + eerror "You should setup DISK and THRESHOLD in /etc/conf.d/hdapsd." + return 1 + fi + + if [[ ! -e /sys/block/${DISK}/queue/protect ]] ; then + eerror "No protect entry for ${DISK}!" + eerror "Make sure your kernel is patched with the blk_freeze patch" + return 1 + fi + + # Load the tp_smapi module first + # This is not a requirement, but it helps hdapsd adaptive mode + if [[ ! -e /sys/devices/platorm/smapi ]] ; then + modprobe tp_smapi 2>/dev/null + fi + + if [[ ! -d /sys/devices/platform/hdaps ]]; then + ebegin "Loading hdaps module" + modprobe hdaps + eend $? || return 1 + fi +} + +start() { + checkconfig || return 1 + + ebegin "Starting hdapsd" + start-stop-daemon --start --exec /usr/sbin/hdapsd \ + --pidfile /var/run/hdapsd.pid \ + -- -b -p -d "${DISK}" -s "${THRESHOLD}" ${OPTIONS} + eend $? +} + +stop() { + ebegin "Stopping hdaps daemon" + start-stop-daemon --stop --exec /usr/sbin/hdapsd \ + --pidfile /var/run/hdapsd.pid + eend $? +} |