summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-laptop/hdapsd/files')
-rw-r--r--app-laptop/hdapsd/files/hdapsd.conf11
-rw-r--r--app-laptop/hdapsd/files/hdapsd.init55
-rw-r--r--app-laptop/hdapsd/files/hdapsd.init.312
3 files changed, 6 insertions, 72 deletions
diff --git a/app-laptop/hdapsd/files/hdapsd.conf b/app-laptop/hdapsd/files/hdapsd.conf
deleted file mode 100644
index 622190954c74..000000000000
--- a/app-laptop/hdapsd/files/hdapsd.conf
+++ /dev/null
@@ -1,11 +0,0 @@
-# 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
deleted file mode 100644
index a1b777ea73c2..000000000000
--- a/app-laptop/hdapsd/files/hdapsd.init
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/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 [ ! -b /dev/${DISK} ]; then
- eerror "Could not find disk /dev/${DISK}!"
- eerror "Adjust the DISK setting in /etc/conf.d/hdapsd"
- return 1
- fi
-
- if [[ ! -e /sys/block/${DISK}/queue/protect ]] && [[ ! -e /sys/block/${DISK}/device/unload_heads ]] ; 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/platform/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 Hard Drive Active Protection System daemon"
- start-stop-daemon --start --exec /usr/sbin/hdapsd \
- --pidfile /var/run/hdapsd.pid \
- -- -b -p -d "${DISK}" -s "${THRESHOLD}" ${OPTIONS}
- eend $?
-}
-
-stop() {
- ebegin "Stopping Hard Drive Active Protection System daemon"
- start-stop-daemon --stop --exec /usr/sbin/hdapsd \
- --pidfile /var/run/hdapsd.pid
- eend $?
-}
diff --git a/app-laptop/hdapsd/files/hdapsd.init.3 b/app-laptop/hdapsd/files/hdapsd.init.3
index ef27368f7b5d..d2405232e246 100644
--- a/app-laptop/hdapsd/files/hdapsd.init.3
+++ b/app-laptop/hdapsd/files/hdapsd.init.3
@@ -1,5 +1,5 @@
#!/sbin/runscript
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2
depend() {
@@ -7,12 +7,12 @@ depend() {
}
checkconfig() {
- if [[ -n ${DISK} ]]; then
+ if [ -n "${DISK}" ]; then
ewarn "Please migrate DISK to DISKLIST in /etc/conf.d/hdapsd."
DISKLIST=${DISK}
fi
- if [[ -z ${THRESHOLD} ]] ; then
+ if [ -z "${THRESHOLD}" ] ; then
eerror "You should setup THRESHOLD in /etc/conf.d/hdapsd."
return 1
fi
@@ -25,7 +25,7 @@ checkconfig() {
return 1
fi
- if [[ ! -e /sys/block/${DISK}/queue/protect ]] && [[ ! -e /sys/block/${DISK}/device/unload_heads ]] ; then
+ if [ ! -e /sys/block/${DISK}/queue/protect ] && [ ! -e /sys/block/${DISK}/device/unload_heads ] ; then
eerror "No protect entry for ${DISK}!"
eerror "Make sure your kernel is patched with the blk_freeze patch"
return 1
@@ -34,11 +34,11 @@ checkconfig() {
# Load the tp_smapi module first
# This is not a requirement, but it helps hdapsd adaptive mode
- if [[ ! -e /sys/devices/platform/smapi ]] ; then
+ if [ ! -e /sys/devices/platform/smapi ] ; then
modprobe tp_smapi 2>/dev/null
fi
- if [[ ! -d /sys/devices/platform/hdaps ]]; then
+ if [ ! -d /sys/devices/platform/hdaps ]; then
ebegin "Loading hdaps module"
modprobe hdaps
eend $? || return 1