diff options
author | Roy Marples <uberlord@gentoo.org> | 2006-12-05 11:38:55 +0000 |
---|---|---|
committer | Roy Marples <uberlord@gentoo.org> | 2006-12-05 11:38:55 +0000 |
commit | f11742760785f0e3c75ce8c5c434d9d829a86118 (patch) | |
tree | aec768257ee60de10f04e54d8de7032401f93466 /app-laptop/hdapsd | |
parent | Fix jdk/jre dep atoms wrt bug #157197. (diff) | |
download | gentoo-2-f11742760785f0e3c75ce8c5c434d9d829a86118.tar.gz gentoo-2-f11742760785f0e3c75ce8c5c434d9d829a86118.tar.bz2 gentoo-2-f11742760785f0e3c75ce8c5c434d9d829a86118.zip |
Bump for a new patchset, works on 2.6.18 and 2.6.19 kernels.
Fixes #142376 and #148423
(Portage version: 2.1.2_rc2-r5)
Diffstat (limited to 'app-laptop/hdapsd')
-rw-r--r-- | app-laptop/hdapsd/ChangeLog | 9 | ||||
-rw-r--r-- | app-laptop/hdapsd/files/digest-hdapsd-20060409-r1 | 6 | ||||
-rw-r--r-- | app-laptop/hdapsd/files/hdapsd.init | 4 | ||||
-rw-r--r-- | app-laptop/hdapsd/hdapsd-20060409-r1.ebuild | 91 |
4 files changed, 107 insertions, 3 deletions
diff --git a/app-laptop/hdapsd/ChangeLog b/app-laptop/hdapsd/ChangeLog index a9d418198f00..854c1d5f88d1 100644 --- a/app-laptop/hdapsd/ChangeLog +++ b/app-laptop/hdapsd/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for app-laptop/hdapsd # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-laptop/hdapsd/ChangeLog,v 1.3 2006/06/28 08:58:14 uberlord Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-laptop/hdapsd/ChangeLog,v 1.4 2006/12/05 11:38:55 uberlord Exp $ + +*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. 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 000000000000..1b290cfaa92c --- /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/hdapsd.init b/app-laptop/hdapsd/files/hdapsd.init index 00609c1cfac9..a4134908fbca 100644 --- a/app-laptop/hdapsd/files/hdapsd.init +++ b/app-laptop/hdapsd/files/hdapsd.init @@ -34,7 +34,7 @@ checkconfig() { start() { checkconfig || return 1 - ebegin "Starting hdapsd" + 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} @@ -42,7 +42,7 @@ start() { } stop() { - ebegin "Stopping hdaps daemon" + 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 000000000000..dddcc53c662f --- /dev/null +++ b/app-laptop/hdapsd/hdapsd-20060409-r1.ebuild @@ -0,0 +1,91 @@ +# Copyright 1999-2006 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.1 2006/12/05 11:38:55 uberlord 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_NET_RADIO="${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" + einfo "The ebuild can attempt to patch your kernel like so" + einfo " emerge --config =${PF}" + fi +} |