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/ChangeLog | 29 +++++++ app-laptop/hdapsd/Manifest | 29 +++++++ 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 ++++++++++++ app-laptop/hdapsd/hdapsd-20060409-r1.ebuild | 92 +++++++++++++++++++++++ app-laptop/hdapsd/metadata.xml | 11 +++ 8 files changed, 237 insertions(+) create mode 100755 app-laptop/hdapsd/ChangeLog create mode 100755 app-laptop/hdapsd/Manifest 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 create mode 100644 app-laptop/hdapsd/hdapsd-20060409-r1.ebuild create mode 100755 app-laptop/hdapsd/metadata.xml (limited to 'app-laptop') diff --git a/app-laptop/hdapsd/ChangeLog b/app-laptop/hdapsd/ChangeLog new file mode 100755 index 0000000..47bf0ce --- /dev/null +++ b/app-laptop/hdapsd/ChangeLog @@ -0,0 +1,29 @@ +# 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.5 2007/01/23 16:14:46 genone Exp $ + + 23 Jan 2007; Marius Mauch hdapsd-20060409.ebuild, + hdapsd-20060409-r1.ebuild: + Replacing einfo with elog + +*hdapsd-20060409-r1 (05 Dec 2006) + + 05 Dec 2006; Roy Marples 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 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 +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 +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 100755 index 0000000..c9e8792 --- /dev/null +++ b/app-laptop/hdapsd/Manifest @@ -0,0 +1,29 @@ +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-2.tar.bz2 10203 RMD160 899a109b58b7aa4949012cd447275d2f3957951e SHA1 67599f3c1a5daaa298f6f1d30168ab0f6c45f407 SHA256 59cfe2535f3d11d1fe54d3c6acb3d2471c461af7770816aeec02411566d38c4b +DIST hdapsd-20060409.c.bz2 5253 RMD160 0b8d07a2612bd4888014913bd8810de664352bfb SHA1 df6c5bf28d4539e97bb1800a455a36cf690d4779 SHA256 e8e1788d485814cd294c33744b60265423d8971abf5ab50b037f05de2c710a21 +EBUILD hdapsd-20060409-r1.ebuild 2346 RMD160 082b819b06c560cb6393102c608f3bdeb2c62c3b SHA1 4d8981d73678fdf7524408961430b09471292ed0 SHA256 90cb5d89f8cdc61d786244c4c83791f42a98bfa7f14ce216a428b9d6127e5a12 +MD5 cb1184ac53181a0a28a34be45f0063df hdapsd-20060409-r1.ebuild 2346 +RMD160 082b819b06c560cb6393102c608f3bdeb2c62c3b hdapsd-20060409-r1.ebuild 2346 +SHA256 90cb5d89f8cdc61d786244c4c83791f42a98bfa7f14ce216a428b9d6127e5a12 hdapsd-20060409-r1.ebuild 2346 +MISC ChangeLog 1228 RMD160 1ccd7fa047355d0bc0e492aa27fdb3a13286812a SHA1 329c8e3f86a94175c06960ebaa27e018305d9c61 SHA256 e75359660a99badb2975508d229ed0fb070daac5aab868eea80a88feef635d57 +MD5 883890bdb1436d42c8ee52e6b6332d83 ChangeLog 1228 +RMD160 1ccd7fa047355d0bc0e492aa27fdb3a13286812a ChangeLog 1228 +SHA256 e75359660a99badb2975508d229ed0fb070daac5aab868eea80a88feef635d57 ChangeLog 1228 +MISC metadata.xml 356 RMD160 140232e3535cb4f3eecb376611b3419519b4b260 SHA1 2563060180594d039fa175a73a8437bc13af5660 SHA256 29a57a39b3a1fdf3091c4012b4161c27b043da505743cf665860527545a9a1fa +MD5 29203234d07d55e82b92c297ab988473 metadata.xml 356 +RMD160 140232e3535cb4f3eecb376611b3419519b4b260 metadata.xml 356 +SHA256 29a57a39b3a1fdf3091c4012b4161c27b043da505743cf665860527545a9a1fa metadata.xml 356 +MD5 ef4ce6b815df724ce87709167198b9a3 files/digest-hdapsd-20060409-r1 509 +RMD160 8ada6c6bd17fff3a7f229fe9f7aa93e563fb01dc files/digest-hdapsd-20060409-r1 509 +SHA256 b2db6a2e79197bc563e8ea76089cbf6a238bee5eaa90cefe3990e0abd4db4b7f files/digest-hdapsd-20060409-r1 509 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 $? +} diff --git a/app-laptop/hdapsd/hdapsd-20060409-r1.ebuild b/app-laptop/hdapsd/hdapsd-20060409-r1.ebuild new file mode 100644 index 0000000..481a53b --- /dev/null +++ b/app-laptop/hdapsd/hdapsd-20060409-r1.ebuild @@ -0,0 +1,92 @@ +# 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 + insinto /usr/share/${PN} + doins *.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 dir="${ROOT}/usr/share/${PN}" + 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 ${dir}/${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 "${dir}/${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 "${dir}"/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/metadata.xml b/app-laptop/hdapsd/metadata.xml new file mode 100755 index 0000000..ed8a225 --- /dev/null +++ b/app-laptop/hdapsd/metadata.xml @@ -0,0 +1,11 @@ + + + + mobile + + uberlord@gentoo.org + Roy Marples + + IBM ThinkPad Harddrive Active Protection disk head parking + daemon + -- cgit v1.2.3-70-g09d2