summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-laptop/hdapsd')
-rw-r--r--app-laptop/hdapsd/ChangeLog39
-rw-r--r--app-laptop/hdapsd/Manifest45
-rw-r--r--app-laptop/hdapsd/files/digest-hdapsd-200604096
-rw-r--r--app-laptop/hdapsd/files/digest-hdapsd-20060409-r16
-rw-r--r--app-laptop/hdapsd/files/digest-hdapsd-200705243
-rw-r--r--app-laptop/hdapsd/files/hdaps-Z60m.patch10
-rw-r--r--app-laptop/hdapsd/files/hdapsd.conf11
-rw-r--r--app-laptop/hdapsd/files/hdapsd.init49
-rw-r--r--app-laptop/hdapsd/hdapsd-20060409-r1.ebuild91
-rw-r--r--app-laptop/hdapsd/hdapsd-20060409.ebuild91
-rw-r--r--app-laptop/hdapsd/hdapsd-20070524.ebuild52
-rw-r--r--app-laptop/hdapsd/metadata.xml11
12 files changed, 414 insertions, 0 deletions
diff --git a/app-laptop/hdapsd/ChangeLog b/app-laptop/hdapsd/ChangeLog
new file mode 100644
index 0000000..326950c
--- /dev/null
+++ b/app-laptop/hdapsd/ChangeLog
@@ -0,0 +1,39 @@
+# ChangeLog for app-laptop/hdapsd
+# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-laptop/hdapsd/ChangeLog,v 1.7 2007/08/29 18:55:52 genstef Exp $
+
+*hdapsd-20060409-r1.ebuild (29 Aug 2007)
+*hdapsd-20060409.ebuild (29 Aug 2007)
+
+ 29 Aug 2007; Stefan Schweizer <genstef@gentoo.org> hdapsd-20060409.ebuild,
+ hdapsd-20060409-r1.ebuild:
+ Fix config checks, thanks jieryn <jieryn@gmail.com> in bug 190047
+
+ 19 Apr 2007; Tony Vroon <chainsaw@gentoo.org> metadata.xml:
+ Taking maintainership.
+
+ 23 Jan 2007; Marius Mauch <genone@gentoo.org> hdapsd-20060409.ebuild,
+ hdapsd-20060409-r1.ebuild:
+ Replacing einfo with elog
+
+*hdapsd-20060409-r1 (05 Dec 2006)
+
+ 05 Dec 2006; Roy Marples <uberlord@gentoo.org> files/hdapsd.init,
+ +hdapsd-20060409-r1.ebuild:
+ Bump for a new patchset, works on 2.6.18 and 2.6.19 kernels.
+ Fixes #142376 and #148423
+
+ 28 Jun 2006; Roy Marples <uberlord@gentoo.org> hdapsd-20060409.ebuild:
+ Remove syslog stuff as it was invalid for scsi/sata systems.
+ Detect patched kernel via /sys in pkg_postinst as kernel sources may not be
+ installed and the warning may be in error.
+
+ 27 Jun 2006; Roy Marples <uberlord@gentoo.org> +files/hdaps-Z60m.patch,
+ hdapsd-20060409.ebuild:
+ Added a kernel patch so --config can enable hdaps on my Z60m
+
+*hdapsd-20060409 (26 Jun 2006)
+
+ 26 Jun 2006; Roy Marples <uberlord@gentoo.org> +files/hdapsd.conf,
+ +files/hdapsd.init, +metadata.xml, +hdapsd-20060409.ebuild:
+ Initial import based on the work by Michael Gaber and Jeff Grafton, #119845.
diff --git a/app-laptop/hdapsd/Manifest b/app-laptop/hdapsd/Manifest
new file mode 100644
index 0000000..2a68278
--- /dev/null
+++ b/app-laptop/hdapsd/Manifest
@@ -0,0 +1,45 @@
+AUX hdaps-Z60m.patch 352 RMD160 963be45785af235fa3e0d74d68d2e75fad663396 SHA1 317de158fdacdd379a94b0652b54ed48525a71bc SHA256 05b0def085f637bae8561a825d7ff3ffc51bdd33609b1520e2d30aa807f00016
+MD5 d2dc49b9cfea10c6e8b09fc8a3077bc4 files/hdaps-Z60m.patch 352
+RMD160 963be45785af235fa3e0d74d68d2e75fad663396 files/hdaps-Z60m.patch 352
+SHA256 05b0def085f637bae8561a825d7ff3ffc51bdd33609b1520e2d30aa807f00016 files/hdaps-Z60m.patch 352
+AUX hdapsd.conf 321 RMD160 5bb760d34bca3f5a12aeb057b78de7e2a9065bc3 SHA1 ade013dab6278a385b4658aad7e871b743380689 SHA256 22e1acf385427052a12858db005fd73d42d9f6818fb253b032cd326101df2e34
+MD5 ef4095f13d4c1a5363c3ed2e0528bd08 files/hdapsd.conf 321
+RMD160 5bb760d34bca3f5a12aeb057b78de7e2a9065bc3 files/hdapsd.conf 321
+SHA256 22e1acf385427052a12858db005fd73d42d9f6818fb253b032cd326101df2e34 files/hdapsd.conf 321
+AUX hdapsd.init 1267 RMD160 1ae521bcf38ace4904d97d64eedb4d72eaaffa23 SHA1 24bd54b9a322dcfc0c54d82093160a1965a8e118 SHA256 3555618d1613c3d60d5164b9f9e70fd7ac1ccf6f6b1f30d53aac33a901487964
+MD5 5adbdfabe13cf2add3346679d02eb2d2 files/hdapsd.init 1267
+RMD160 1ae521bcf38ace4904d97d64eedb4d72eaaffa23 files/hdapsd.init 1267
+SHA256 3555618d1613c3d60d5164b9f9e70fd7ac1ccf6f6b1f30d53aac33a901487964 files/hdapsd.init 1267
+DIST hdaps_protect-patches-1.tar.bz2 6179 RMD160 5b173034eebbbee598e01d45e5e76e2859c0a829 SHA1 7d79652ddc884b6619944a0d9ed70557e9c56779 SHA256 ab4192fa3a26497fe9fed63bfaedfebc74d288a85e7283b1bc338984be1133dd
+DIST hdaps_protect-patches-2.tar.bz2 10203 RMD160 899a109b58b7aa4949012cd447275d2f3957951e SHA1 67599f3c1a5daaa298f6f1d30168ab0f6c45f407 SHA256 59cfe2535f3d11d1fe54d3c6acb3d2471c461af7770816aeec02411566d38c4b
+DIST hdapsd-20060409.c.bz2 5253 RMD160 0b8d07a2612bd4888014913bd8810de664352bfb SHA1 df6c5bf28d4539e97bb1800a455a36cf690d4779 SHA256 e8e1788d485814cd294c33744b60265423d8971abf5ab50b037f05de2c710a21
+DIST hdapsd-20070524.c.bz2 5617 RMD160 5b5a634f0af6d9fc93c6f72ebeb538fb52ca3f86 SHA1 1cf85c194af1782b7f2154ae257a47f4b5708359 SHA256 096d92702027df7293a17a0d312af44e7c946ab6bc864ef101d0159ed6871186
+EBUILD hdapsd-20060409-r1.ebuild 2337 RMD160 57a84e5ae4a52e5a16b93d150e72e16a2b32d527 SHA1 887efe8ff8fc621b78b03411da046289b2350d3c SHA256 c8f46876dea82c1949afde90b75168929883e23cd8e6ebc8a2736e05e66d66de
+MD5 346e9affa194dafcb5b7107acff2aa0b hdapsd-20060409-r1.ebuild 2337
+RMD160 57a84e5ae4a52e5a16b93d150e72e16a2b32d527 hdapsd-20060409-r1.ebuild 2337
+SHA256 c8f46876dea82c1949afde90b75168929883e23cd8e6ebc8a2736e05e66d66de hdapsd-20060409-r1.ebuild 2337
+EBUILD hdapsd-20060409.ebuild 2331 RMD160 fa88c5443c1a70529aa8864492ff204164f77843 SHA1 202aace98040253e0acbafe2949b58532888f73a SHA256 87169b8630e5b0fac52eea0096086cae1c6e820b41428971da9c4ec3d2d0a184
+MD5 42d28f36bf60df32e9a1f08ca943ffd3 hdapsd-20060409.ebuild 2331
+RMD160 fa88c5443c1a70529aa8864492ff204164f77843 hdapsd-20060409.ebuild 2331
+SHA256 87169b8630e5b0fac52eea0096086cae1c6e820b41428971da9c4ec3d2d0a184 hdapsd-20060409.ebuild 2331
+EBUILD hdapsd-20070524.ebuild 1297 RMD160 7b07e81f03025e4912e671fc6a46f7f3d1afefd2 SHA1 7ccfbdb1164cf75ce5c0e03887e23540595918e9 SHA256 379ef0907bd24eaae73e33d67566c8b1b9dba9f05d55be54fd00cf834ab2f0f5
+MD5 1943bc48454e2c931e025be9df7455d5 hdapsd-20070524.ebuild 1297
+RMD160 7b07e81f03025e4912e671fc6a46f7f3d1afefd2 hdapsd-20070524.ebuild 1297
+SHA256 379ef0907bd24eaae73e33d67566c8b1b9dba9f05d55be54fd00cf834ab2f0f5 hdapsd-20070524.ebuild 1297
+MISC ChangeLog 1572 RMD160 b445fb3578154d8da87d4c7c7f96882248dbc19f SHA1 c720473a0aee835d0f62b6336838b26b495804a8 SHA256 45c81b6f6f8233742db0ba727b06242c7898c9a8d2595ff55eb7f04da2860d0e
+MD5 87743bcc068c8efbe4e5498bd376bfe6 ChangeLog 1572
+RMD160 b445fb3578154d8da87d4c7c7f96882248dbc19f ChangeLog 1572
+SHA256 45c81b6f6f8233742db0ba727b06242c7898c9a8d2595ff55eb7f04da2860d0e ChangeLog 1572
+MISC metadata.xml 355 RMD160 5ca3ed157f7f031a97030b1911fe673ead73b9a5 SHA1 5a27f7151d0cd8f43380b8566f3602e3de423c62 SHA256 44de2fade812b9761d1a27833d5cf9db55dd3838db60788c91cce773ddf1f536
+MD5 3c417f6e4af8066f1ec3381359f78e75 metadata.xml 355
+RMD160 5ca3ed157f7f031a97030b1911fe673ead73b9a5 metadata.xml 355
+SHA256 44de2fade812b9761d1a27833d5cf9db55dd3838db60788c91cce773ddf1f536 metadata.xml 355
+MD5 c92320b8f991d8345345eceafb29d0a9 files/digest-hdapsd-20060409 506
+RMD160 11a06bc2bcb655211ed3fe74d7a8675d98bc0a5b files/digest-hdapsd-20060409 506
+SHA256 816c22ded32067fbf9e200c293b5294d64a128d73eada333aaa68198e8455e09 files/digest-hdapsd-20060409 506
+MD5 ef4ce6b815df724ce87709167198b9a3 files/digest-hdapsd-20060409-r1 509
+RMD160 8ada6c6bd17fff3a7f229fe9f7aa93e563fb01dc files/digest-hdapsd-20060409-r1 509
+SHA256 b2db6a2e79197bc563e8ea76089cbf6a238bee5eaa90cefe3990e0abd4db4b7f files/digest-hdapsd-20060409-r1 509
+MD5 9ea980835445d078df935e97ed35948a files/digest-hdapsd-20070524 238
+RMD160 9c6e7fa8123b306b7b8dfc76232c3a00d16f625e files/digest-hdapsd-20070524 238
+SHA256 a082f08e9178a93893210eb89636d155f661fc977b17e1519511f6da174f4136 files/digest-hdapsd-20070524 238
diff --git a/app-laptop/hdapsd/files/digest-hdapsd-20060409 b/app-laptop/hdapsd/files/digest-hdapsd-20060409
new file mode 100644
index 0000000..2e48b8e
--- /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/digest-hdapsd-20060409-r1 b/app-laptop/hdapsd/files/digest-hdapsd-20060409-r1
new file mode 100644
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/digest-hdapsd-20070524 b/app-laptop/hdapsd/files/digest-hdapsd-20070524
new file mode 100644
index 0000000..e36823c
--- /dev/null
+++ b/app-laptop/hdapsd/files/digest-hdapsd-20070524
@@ -0,0 +1,3 @@
+MD5 3080bea957b3e8eddae44b7163ca94c5 hdapsd-20070524.c.bz2 5617
+RMD160 5b5a634f0af6d9fc93c6f72ebeb538fb52ca3f86 hdapsd-20070524.c.bz2 5617
+SHA256 096d92702027df7293a17a0d312af44e7c946ab6bc864ef101d0159ed6871186 hdapsd-20070524.c.bz2 5617
diff --git a/app-laptop/hdapsd/files/hdaps-Z60m.patch b/app-laptop/hdapsd/files/hdaps-Z60m.patch
new file mode 100644
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 100644
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 100644
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 $?
+}
diff --git a/app-laptop/hdapsd/hdapsd-20060409-r1.ebuild b/app-laptop/hdapsd/hdapsd-20060409-r1.ebuild
new file mode 100644
index 0000000..5715934
--- /dev/null
+++ b/app-laptop/hdapsd/hdapsd-20060409-r1.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-laptop/hdapsd/hdapsd-20060409-r1.ebuild,v 1.3 2007/08/29 18:55:52 genstef Exp $
+
+inherit eutils linux-info
+
+PROTECT_VER="2"
+
+DESCRIPTION="IBM ThinkPad Harddrive Active Protection disk head parking daemon"
+HOMEPAGE="http://hdaps.sourceforge.net/"
+SRC_URI="mirror://gentoo/${P}.c.bz2
+ mirror://gentoo/hdaps_protect-patches-${PROTECT_VER}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+
+IUSE=""
+RDEPEND=""
+
+S="${WORKDIR}"
+
+CONFIG_CHECK="SENSORS_HDAPS"
+ERROR_SENSORS_HDAPS="${P} requires support for HDAPS (CONFIG_SENSORS_HDAPS)"
+
+src_compile() {
+ cd "${WORKDIR}"
+ gcc ${CFLAGS} "${P}".c -o hdapsd || die "failed to compile"
+}
+
+src_install() {
+ dosbin "${WORKDIR}"/hdapsd
+ newconfd "${FILESDIR}"/hdapsd.conf hdapsd
+ newinitd "${FILESDIR}"/hdapsd.init hdapsd
+
+ # Install our kernel patches
+ dodoc *.patch "${FILESDIR}"/hdaps-Z60m.patch
+}
+
+# Yes, this sucks as the source location may change, kernel sources may not be
+# installed, but we try our best anyway
+kernel_patched() {
+ get_version
+
+ if grep -qs "blk_protect_register" "${KERNEL_DIR}"/block/ll_rw_blk.c ; then
+ einfo "Your kernel has already been patched for blk_freeze"
+ return 0
+ fi
+
+ return 1
+}
+
+pkg_config() {
+ kernel_patched && return 0
+
+ local docdir="${ROOT}/usr/share/doc/${PF}/"
+ local p="hdaps_protect-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}.patch.gz"
+
+ # We need to find our FILESDIR as it's now lost
+ if [[ ! -e ${docdir}/${p} ]] ; then
+ eerror "We don't have a patch for kernel ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} yet"
+ return 1
+ fi
+
+ if [[ ! -d ${KERNEL_DIR} ]] ; then
+ eerror "Kernel sources not found!"
+ return 1
+ fi
+
+ cd "${KERNEL_DIR}"
+ epatch "${docdir}/${p}"
+
+ # This is just a nice to have for me as I use a Z60m myself
+ if ! grep -q "Z60m" "${KERNEL_DIR}"/drivers/hwmon/hdaps.c ; then
+ epatch "${docdir}"/hdaps-Z60m.patch.gz
+ fi
+
+ echo
+ einfo "Now you should rebuild your kernel, its modules"
+ einfo "and then install them."
+}
+
+pkg_postinst(){
+ [[ -n $(ls "${ROOT}"/sys/block/*/queue/protect 2>/dev/null) ]] && return 0
+
+ if ! kernel_patched ; then
+ ewarn "Your kernel has NOT been patched for blk_freeze"
+ elog "The ebuild can attempt to patch your kernel like so"
+ elog " emerge --config =${PF}"
+ fi
+}
diff --git a/app-laptop/hdapsd/hdapsd-20060409.ebuild b/app-laptop/hdapsd/hdapsd-20060409.ebuild
new file mode 100644
index 0000000..638412e
--- /dev/null
+++ b/app-laptop/hdapsd/hdapsd-20060409.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-laptop/hdapsd/hdapsd-20060409.ebuild,v 1.5 2007/08/29 18:55:52 genstef Exp $
+
+inherit eutils linux-info
+
+PROTECT_VER="1"
+
+DESCRIPTION="IBM ThinkPad Harddrive Active Protection disk head parking daemon"
+HOMEPAGE="http://hdaps.sourceforge.net/"
+SRC_URI="mirror://gentoo/${P}.c.bz2
+ mirror://gentoo/hdaps_protect-patches-${PROTECT_VER}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+
+IUSE=""
+RDEPEND=""
+
+S="${WORKDIR}"
+
+CONFIG_CHECK="SENSORS_HDAPS"
+ERROR_SENSORS_HDAPS="${P} requires support for HDAPS (CONFIG_SENSORS_HDAPS)"
+
+src_compile() {
+ cd "${WORKDIR}"
+ gcc ${CFLAGS} "${P}".c -o hdapsd || die "failed to compile"
+}
+
+src_install() {
+ dosbin "${WORKDIR}"/hdapsd
+ newconfd "${FILESDIR}"/hdapsd.conf hdapsd
+ newinitd "${FILESDIR}"/hdapsd.init hdapsd
+
+ # Install our kernel patches
+ dodoc *.patch "${FILESDIR}"/hdaps-Z60m.patch
+}
+
+# Yes, this sucks as the source location may change, kernel sources may not be
+# installed, but we try our best anyway
+kernel_patched() {
+ get_version
+
+ if grep -qs "blk_protect_register" "${KERNEL_DIR}"/block/ll_rw_blk.c ; then
+ einfo "Your kernel has already been patched for blk_freeze"
+ return 0
+ fi
+
+ return 1
+}
+
+pkg_config() {
+ kernel_patched && return 0
+
+ local docdir="${ROOT}/usr/share/doc/${PF}/"
+ local p="hdaps_protect-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}.patch.gz"
+
+ # We need to find our FILESDIR as it's now lost
+ if [[ ! -e ${docdir}/${p} ]] ; then
+ eerror "We don't have a patch for kernel ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} yet"
+ return 1
+ fi
+
+ if [[ ! -d ${KERNEL_DIR} ]] ; then
+ eerror "Kernel sources not found!"
+ return 1
+ fi
+
+ cd "${KERNEL_DIR}"
+ epatch "${docdir}/${p}"
+
+ # This is just a nice to have for me as I use a Z60m myself
+ if ! grep "Z60m" "${KERNEL_DIR}"/drivers/hwmon/hdaps.c ; then
+ epatch "${docdir}"/hdaps-Z60m.patch.gz
+ fi
+
+ echo
+ einfo "Now you should rebuild your kernel, its modules"
+ einfo "and then install them."
+}
+
+pkg_postinst(){
+ [[ -n $(ls "${ROOT}"/sys/block/*/queue/protect 2>/dev/null) ]] && return 0
+
+ if ! kernel_patched ; then
+ ewarn "Your kernel has NOT been patched for blk_freeze"
+ elog "The ebuild can attempt to patch your kernel like so"
+ elog " emerge --config =${PF}"
+ fi
+}
diff --git a/app-laptop/hdapsd/hdapsd-20070524.ebuild b/app-laptop/hdapsd/hdapsd-20070524.ebuild
new file mode 100644
index 0000000..b93d80f
--- /dev/null
+++ b/app-laptop/hdapsd/hdapsd-20070524.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-laptop/hdapsd/hdapsd-20060409-r1.ebuild,v 1.3 2007/08/29 18:55:52 genstef Exp $
+
+inherit eutils linux-info
+
+PROTECT_VER="2"
+
+DESCRIPTION="IBM ThinkPad Harddrive Active Protection disk head parking daemon"
+HOMEPAGE="http://hdaps.sourceforge.net/"
+SRC_URI="http://dev.gentooexperimental.org/~welp/gentoo/hdapsd/${P}.c.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+
+IUSE=""
+RDEPEND="app-laptop/tp_smapi"
+
+S="${WORKDIR}"
+
+src_compile() {
+ cd "${WORKDIR}"
+ gcc ${CFLAGS} "${P}".c -o hdapsd || die "failed to compile"
+}
+
+src_install() {
+ dosbin "${WORKDIR}"/hdapsd
+ newconfd "${FILESDIR}"/hdapsd.conf hdapsd
+ newinitd "${FILESDIR}"/hdapsd.init hdapsd
+}
+
+# Yes, this sucks as the source location may change, kernel sources may not be
+# installed, but we try our best anyway
+kernel_patched() {
+ get_version
+
+ if grep -qs "blk_protect_register" "${KERNEL_DIR}"/block/ll_rw_blk.c ; then
+ return 0
+ fi
+
+ return 1
+}
+
+pkg_postinst(){
+ [[ -n $(ls "${ROOT}"/sys/block/*/queue/protect 2>/dev/null) ]] && return 0
+
+ if ! kernel_patched ; then
+ ewarn "Your kernel has NOT been patched for blk_freeze"
+ elog "You should install tp-sources from welp's overlay"
+ fi
+}
diff --git a/app-laptop/hdapsd/metadata.xml b/app-laptop/hdapsd/metadata.xml
new file mode 100644
index 0000000..38eab06
--- /dev/null
+++ b/app-laptop/hdapsd/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>mobile</herd>
+ <maintainer>
+ <email>chainsaw@gentoo.org</email>
+ <name>Tony Vroon</name>
+ </maintainer>
+ <longdescription>IBM ThinkPad Harddrive Active Protection disk head parking
+ daemon</longdescription>
+</pkgmetadata>