summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThilo Bangert <bangert@gentoo.org>2009-10-14 22:03:26 +0000
committerThilo Bangert <bangert@gentoo.org>2009-10-14 22:03:26 +0000
commit26569043791e1d2971782060b0060ce3b2e8c3b3 (patch)
tree064d28e6602b01773ed9667ee221f524ec85a6c3
parentSpring cleaning. One more arch keyword and 1.5.1-r3 can go too. (diff)
downloadgentoo-2-26569043791e1d2971782060b0060ce3b2e8c3b3.tar.gz
gentoo-2-26569043791e1d2971782060b0060ce3b2e8c3b3.tar.bz2
gentoo-2-26569043791e1d2971782060b0060ce3b2e8c3b3.zip
version bump from bug #166166
(Portage version: 2.2_rc42/cvs/Linux i686)
-rw-r--r--app-laptop/hdapsd/ChangeLog8
-rw-r--r--app-laptop/hdapsd/files/hdapsd.init2
-rw-r--r--app-laptop/hdapsd/hdapsd-20090401.ebuild51
3 files changed, 59 insertions, 2 deletions
diff --git a/app-laptop/hdapsd/ChangeLog b/app-laptop/hdapsd/ChangeLog
index 91e8151847f6..815e51916b57 100644
--- a/app-laptop/hdapsd/ChangeLog
+++ b/app-laptop/hdapsd/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-laptop/hdapsd
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-laptop/hdapsd/ChangeLog,v 1.11 2009/08/31 22:02:20 ikelos Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-laptop/hdapsd/ChangeLog,v 1.12 2009/10/14 22:03:26 bangert Exp $
+
+*hdapsd-20090401 (14 Oct 2009)
+
+ 14 Oct 2009; Thilo Bangert <bangert@gentoo.org> +hdapsd-20090401.ebuild,
+ files/hdapsd.init:
+ version bump from bug #166166
31 Aug 2009; Mike Auty <ikelos@gentoo.org> hdapsd-20060409.ebuild,
hdapsd-20060409-r1.ebuild, hdapsd-20060409-r3.ebuild:
diff --git a/app-laptop/hdapsd/files/hdapsd.init b/app-laptop/hdapsd/files/hdapsd.init
index adcd4286564e..ef146ee296a9 100644
--- a/app-laptop/hdapsd/files/hdapsd.init
+++ b/app-laptop/hdapsd/files/hdapsd.init
@@ -12,7 +12,7 @@ checkconfig() {
return 1
fi
- if [[ ! -e /sys/block/${DISK}/queue/protect ]] ; 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
diff --git a/app-laptop/hdapsd/hdapsd-20090401.ebuild b/app-laptop/hdapsd/hdapsd-20090401.ebuild
new file mode 100644
index 000000000000..e3dae3983381
--- /dev/null
+++ b/app-laptop/hdapsd/hdapsd-20090401.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-laptop/hdapsd/hdapsd-20090401.ebuild,v 1.1 2009/10/14 22:03:26 bangert Exp $
+
+EAPI="2"
+
+inherit eutils linux-info toolchain-funcs
+
+DESCRIPTION="IBM ThinkPad Harddrive Active Protection disk head parking daemon"
+HOMEPAGE="http://hdaps.sourceforge.net/"
+SRC_URI="mirror://sourceforge/hdaps/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+
+IUSE=""
+RDEPEND=""
+
+pkg_setup() {
+ # We require the hdaps module which can either come from kernel sources or
+ # from the tp_smapi package.
+ if ! has_version app-laptop/tp_smapi || ! built_with_use app-laptop/tp_smapi hdaps; then
+ CONFIG_CHECK="~SENSORS_HDAPS"
+ ERROR_SENSORS_HDAPS="${P} requires app-laptop/tp_smapi (with hdaps USE enabled) or support for CONFIG_SENSORS_HDAPS enabled"
+ linux-info_pkg_setup
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "Install failed"
+ rm -rf "${D}"/usr/share/doc/hdapsd
+ dodoc ChangeLog README AUTHORS
+ newconfd "${FILESDIR}"/hdapsd.conf hdapsd
+ newinitd "${FILESDIR}"/hdapsd.init hdapsd
+}
+
+pkg_postinst(){
+ [[ -z $(ls "${ROOT}"/sys/block/*/queue/protect 2>/dev/null) ]] && \
+ [[ -z $(ls "${ROOT}"/sys/block/*/device/unload_heads 2>/dev/null) ]] && \
+ ewarn "Your kernel does NOT support shock protection. Kernel 2.6.28 and above is recommended!"
+
+ if ! has_version app-laptop/tp_smapi; then
+ ewarn "Using the hdaps module provided by app-laptop/tp_smapi instead"
+ ewarn "of the in-kernel driver is strongly recommended!"
+ fi
+
+ elog "You can change the default frequency by modifing /sys/devices/platform/hdaps/sampling_rate"
+ elog "You might need to enable shock protection manually by running "
+ elog " echo -1 > /sys/block/DEVICE/device/unload_heads"
+}