From d9ec8413744faaba3543bff9773bdad9786260ab Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Wed, 16 Apr 2008 18:25:51 +0200 Subject: Added stuff from laptop --- app-laptop/hdapsd/files/digest-hdapsd-20060409-r1 | 6 +++ app-laptop/hdapsd/files/hdaps-Z60m.patch | 10 +++++ app-laptop/hdapsd/files/hdapsd.conf | 11 +++++ app-laptop/hdapsd/files/hdapsd.init | 49 +++++++++++++++++++++++ 4 files changed, 76 insertions(+) create mode 100755 app-laptop/hdapsd/files/digest-hdapsd-20060409-r1 create mode 100755 app-laptop/hdapsd/files/hdaps-Z60m.patch create mode 100755 app-laptop/hdapsd/files/hdapsd.conf create mode 100755 app-laptop/hdapsd/files/hdapsd.init (limited to 'app-laptop/hdapsd/files') diff --git a/app-laptop/hdapsd/files/digest-hdapsd-20060409-r1 b/app-laptop/hdapsd/files/digest-hdapsd-20060409-r1 new file mode 100755 index 0000000..1b290cf --- /dev/null +++ b/app-laptop/hdapsd/files/digest-hdapsd-20060409-r1 @@ -0,0 +1,6 @@ +MD5 b7503b856a64783b8920a7c8d48eb3a3 hdaps_protect-patches-2.tar.bz2 10203 +RMD160 899a109b58b7aa4949012cd447275d2f3957951e hdaps_protect-patches-2.tar.bz2 10203 +SHA256 59cfe2535f3d11d1fe54d3c6acb3d2471c461af7770816aeec02411566d38c4b hdaps_protect-patches-2.tar.bz2 10203 +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/hdaps-Z60m.patch b/app-laptop/hdapsd/files/hdaps-Z60m.patch new file mode 100755 index 0000000..57c723c --- /dev/null +++ b/app-laptop/hdapsd/files/hdaps-Z60m.patch @@ -0,0 +1,10 @@ +--- drivers/hwmon/hdaps.c 2006-06-26 09:37:31.131424200 +0100 ++++ drivers/hwmon/hdaps.c 2006-06-26 09:39:49.000000000 +0100 +@@ -539,6 +539,7 @@ + HDAPS_DMI_MATCH_NORMAL("ThinkPad X41 Tablet"), + HDAPS_DMI_MATCH_NORMAL("ThinkPad X41"), + HDAPS_DMI_MATCH_LENOVO("ThinkPad X60"), ++ HDAPS_DMI_MATCH_NORMAL("ThinkPad Z60m"), + { .ident = NULL } + }; + diff --git a/app-laptop/hdapsd/files/hdapsd.conf b/app-laptop/hdapsd/files/hdapsd.conf new file mode 100755 index 0000000..6221909 --- /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 100755 index 0000000..a413490 --- /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 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 $? +} -- cgit v1.2.3-70-g09d2