summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /app-laptop/hdapsd
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'app-laptop/hdapsd')
-rw-r--r--app-laptop/hdapsd/Manifest2
-rw-r--r--app-laptop/hdapsd/files/hdapsd.conf-2014102424
-rw-r--r--app-laptop/hdapsd/files/hdapsd.conf.312
-rw-r--r--app-laptop/hdapsd/files/hdapsd.init-2014102476
-rw-r--r--app-laptop/hdapsd/files/hdapsd.init.369
-rw-r--r--app-laptop/hdapsd/hdapsd-20090401-r2.ebuild51
-rw-r--r--app-laptop/hdapsd/hdapsd-20141203.ebuild73
-rw-r--r--app-laptop/hdapsd/metadata.xml21
8 files changed, 328 insertions, 0 deletions
diff --git a/app-laptop/hdapsd/Manifest b/app-laptop/hdapsd/Manifest
new file mode 100644
index 000000000000..0e9092b1e14b
--- /dev/null
+++ b/app-laptop/hdapsd/Manifest
@@ -0,0 +1,2 @@
+DIST hdapsd-20090401.tar.gz 95058 SHA256 32979d58de4c54a7cc5671e7e7b4f0b653b659104faa9610433f8bb5dd4cef7a SHA512 4984a6c636d3447051ca5629fec89f08eee3773750f9623b80d7c0d4af65dcf9868392f2e93f5d13ac329d311ec2ebcdddf3e438007d1f851a920137c6903c96 WHIRLPOOL 9c3822acb39ff1f10e47604725bf6e42546b95ba9db26ebd751b69c4162e3df4f33d177a2a0b7a764c5e0f2478f470595cda304221a0ec165b07ef183b6ea9be
+DIST hdapsd-20141203.tar.gz 128818 SHA256 6650db6b2251b9774bdfba34dd58f712de4c761e6c78eb61ea3b82b694cbef5e SHA512 19c1a8b362f15864b71f4fb221c0993b43b3b2d965d5826af06fb9f6b0e345e5da99181493e13e230c7fe77060ae5b373027e8ec90a511566a6ccaef43998178 WHIRLPOOL befbcbbdcfc5ae9a844f0a96703a7c9a7d43bf4c5d6d9735412efc136d9e20aff6a4dc3e5755cfa9837122b4f7890b00be53a21237838b078271ba7c9650589c
diff --git a/app-laptop/hdapsd/files/hdapsd.conf-20141024 b/app-laptop/hdapsd/files/hdapsd.conf-20141024
new file mode 100644
index 000000000000..a83d8bb181ac
--- /dev/null
+++ b/app-laptop/hdapsd/files/hdapsd.conf-20141024
@@ -0,0 +1,24 @@
+# Configuration for the HDAPS daemon (hdapsd). All settings here are
+# optional and will override those set in /etc/hdapsd.conf (if hdapsd
+# was built with libconfig support).
+
+# The list of the disk devices that hdapsd should monitor. Usually
+# this is "hda", "sda", or "hda sda". The hdaps daemon will attempt to
+# auto-detect your drive if this is left empty. Empty by default.
+#
+#DISKLIST="sda"
+
+# Hdapsd sensitivity. The lower the threshold, the earlier the heads
+# are parked when movement is detected. The default is determined by
+# hdapsd, and is currently 15.
+#
+#THRESHOLD="10"
+
+# Log to syslog? Disabled by default.
+#
+#SYSLOG="true"
+
+# Set any extra options here, like -a for "adaptive mode". Empty by
+# default.
+#
+#OPTIONS="-a"
diff --git a/app-laptop/hdapsd/files/hdapsd.conf.3 b/app-laptop/hdapsd/files/hdapsd.conf.3
new file mode 100644
index 000000000000..509d3afa2013
--- /dev/null
+++ b/app-laptop/hdapsd/files/hdapsd.conf.3
@@ -0,0 +1,12 @@
+# The list of the disk devices that hdapsd should monitor.
+# Usually this is 'hda', 'sda' or 'hda sda'.
+# hdaps will auto-devices if empty
+#DISKLIST="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-20141024 b/app-laptop/hdapsd/files/hdapsd.init-20141024
new file mode 100644
index 000000000000..b4d0eab26b5c
--- /dev/null
+++ b/app-laptop/hdapsd/files/hdapsd.init-20141024
@@ -0,0 +1,76 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2
+
+description="Hard Drive Active Protection System daemon"
+command="/usr/sbin/hdapsd"
+pidfile="/run/hdapsd.pid"
+
+# Always daemonize when started by OpenRC, and don't make the pidfile
+# configurable. Even if the user sets something dumb for the pidfile
+# in /etc/hdapsd.conf, we want it to work! Fortunately the settings
+# passed on the command-line override the config file.
+command_args="--background --pidfile=${pidfile}"
+
+
+depend() {
+ need localmount
+}
+
+checkconfig() {
+ # An empty DISKLIST is allowed because the disk will be
+ # auto-detected.
+ for DISK in ${DISKLIST}; do
+ if [ ! -b /dev/${DISK} ]; then
+ eerror "Could not find disk /dev/${DISK}!"
+ eerror "Adjust the DISK setting in /etc/conf.d/hdapsd"
+ return 1
+ fi
+
+ 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
+ fi
+ done
+
+ # Load the tp_smapi module first. This is not a requirement, but
+ # it helps hdapsd's adaptive mode.
+ if [ ! -e /sys/devices/platform/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
+
+ for DISK in ${DISKLIST}; do
+ command_args="${command_args} -d ${DISK}"
+ done
+
+ # Since all of these settings are now optional, we append them
+ # only if we need to.
+ if [ ! -z "${THRESHOLD}" ] ; then
+ command_args="${command_args} --sensitivity ${THRESHOLD}"
+ fi
+
+ if [ ! -z "${SYSLOG}" ] ; then
+ command_args="${command_args} --syslog"
+ fi
+
+ if [ ! -z "${OPTIONS}" ] ; then
+ command_args="${command_args} ${OPTIONS}"
+ fi
+
+ ebegin "Starting the ${description}"
+ start-stop-daemon --start --exec "${command}" --pidfile "${pidfile}" \
+ -- ${command_args}
+ eend $?
+}
diff --git a/app-laptop/hdapsd/files/hdapsd.init.3 b/app-laptop/hdapsd/files/hdapsd.init.3
new file mode 100644
index 000000000000..d7894fbc8ada
--- /dev/null
+++ b/app-laptop/hdapsd/files/hdapsd.init.3
@@ -0,0 +1,69 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2
+
+depend() {
+ need localmount
+}
+
+checkconfig() {
+ if [ -n "${DISK}" ]; then
+ ewarn "Please migrate DISK to DISKLIST in /etc/conf.d/hdapsd."
+ DISKLIST=${DISK}
+ fi
+
+ if [ -z "${THRESHOLD}" ] ; then
+ eerror "You should setup THRESHOLD in /etc/conf.d/hdapsd."
+ return 1
+ fi
+
+ #empty DISKLIST is allowed as well
+ for DISK in ${DISKLIST}; do
+ if [ ! -b /dev/${DISK} ]; then
+ eerror "Could not find disk /dev/${DISK}!"
+ eerror "Adjust the DISK setting in /etc/conf.d/hdapsd"
+ return 1
+ fi
+
+ 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
+ fi
+ done
+
+ # Load the tp_smapi module first
+ # This is not a requirement, but it helps hdapsd adaptive mode
+ if [ ! -e /sys/devices/platform/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
+
+ local DISKOPTS DISK
+ for DISK in ${DISKLIST}; do
+ DISKOPTS="${DISKOPTS} -d ${DISK}"
+ done
+
+ ebegin "Starting Hard Drive Active Protection System daemon"
+ start-stop-daemon --start --exec /usr/sbin/hdapsd \
+ --pidfile /var/run/hdapsd.pid \
+ -- --syslog --background --pidfile \
+ ${DISKOPTS} --sensitivity "${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-20090401-r2.ebuild b/app-laptop/hdapsd/hdapsd-20090401-r2.ebuild
new file mode 100644
index 000000000000..42abdeeee8d5
--- /dev/null
+++ b/app-laptop/hdapsd/hdapsd-20090401-r2.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit linux-info readme.gentoo
+
+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="amd64 x86"
+IUSE=""
+
+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[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
+
+ DOC_CONTENTS="You can change the default frequency by modifing /sys/devices/platform/hdaps/sampling_rate.
+ You might need to enable shock protection manually by running:\n
+ # echo -1 > /sys/block/DEVICE/device/unload_heads"
+}
+
+src_install() {
+ emake DESTDIR="${ED}" install
+ rm -rf "${ED}"/usr/share/doc/hdapsd
+ dodoc ChangeLog README AUTHORS
+ newconfd "${FILESDIR}"/hdapsd.conf.3 hdapsd
+ newinitd "${FILESDIR}"/hdapsd.init.3 hdapsd
+ readme.gentoo_create_doc
+}
+
+pkg_postinst(){
+ [[ -z $(ls ${EROOT}/sys/block/*/queue/protect 2>/dev/null) ]] && \
+ [[ -z $(ls ${EROOT}/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[hdaps]; then
+ ewarn "Using the hdaps module provided by app-laptop/tp_smapi instead"
+ ewarn "of the in-kernel driver is strongly recommended!"
+ fi
+
+ readme.gentoo_print_elog
+}
diff --git a/app-laptop/hdapsd/hdapsd-20141203.ebuild b/app-laptop/hdapsd/hdapsd-20141203.ebuild
new file mode 100644
index 000000000000..6cdd859386dc
--- /dev/null
+++ b/app-laptop/hdapsd/hdapsd-20141203.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit linux-info readme.gentoo systemd
+
+DESCRIPTION="IBM ThinkPad Hard Drive Active Protection System (HDAPS) daemon"
+HOMEPAGE="https://github.com/evgeni/${PN}/"
+SRC_URI="https://github.com/evgeni/${PN}/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="libconfig"
+
+DEPEND="libconfig? ( dev-libs/libconfig )"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ # We require the hdaps module which can either come from either the
+ # kernel itself (CONFIG_SENSORS_HDAPS) or from the tp_smapi package.
+ if ! has_version app-laptop/tp_smapi[hdaps]; then
+ CONFIG_CHECK="~SENSORS_HDAPS"
+ ERROR_SENSORS_HDAPS="${P} requires app-laptop/tp_smapi[hdaps] or "
+ ERROR_SENSORS_HDAPS+="kernel support for CONFIG_SENSORS_HDAPS enabled"
+ linux-info_pkg_setup
+ fi
+}
+
+src_configure(){
+ econf \
+ $(use_enable libconfig) \
+ --with-systemdsystemunitdir=$(systemd_get_unitdir) \
+ --docdir="/usr/share/doc/${PF}"
+}
+
+src_install() {
+ default
+ newconfd "${FILESDIR}/hdapsd.conf-20141024" hdapsd
+ newinitd "${FILESDIR}/hdapsd.init-20141024" hdapsd
+ readme.gentoo_create_doc
+}
+
+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."
+
+ readme.gentoo_print_elog
+}
+
+DISABLE_AUTOFORMATTING=1
+DOC_CONTENTS="
+${PN} requires a kernel module to function properly. The recommended
+approach is to install app-laptop/tp_smapi[hdaps], but the in-tree
+module provided by CONFIG_SENSORS_HDAPS may work as well.
+
+Common daemon parameters can be set in ${EROOT}etc/conf.d/${PN}. If the
+package was installed with USE=libconfig, then the parameters can also
+be set in ${EROOT}etc/${PN}.conf, although the former will take
+precedence over the latter if both are used.
+
+You can change the default sampling rate by modifing
+
+ /sys/devices/platform/hdaps/sampling_rate
+
+and you may need to enable shock protection manually by running
+
+ # echo -1 > /sys/block/<disk>/device/unload_heads
+
+as root.
+"
diff --git a/app-laptop/hdapsd/metadata.xml b/app-laptop/hdapsd/metadata.xml
new file mode 100644
index 000000000000..c9b72ec04f01
--- /dev/null
+++ b/app-laptop/hdapsd/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>ottxor@gentoo.org</email>
+ <name>Christoph Junghans</name>
+ </maintainer>
+ <maintainer>
+ <email>mjo@gentoo.org</email>
+ <name>Michael Orlitzky</name>
+ </maintainer>
+ <use>
+ <flag name="libconfig">
+ Require <pkg>dev-libs/libconfig</pkg> to allow the daemon to
+ read a configuration file at startup
+ </flag>
+ </use>
+ <upstream>
+ <remote-id type="github">evgeni/hdapsd</remote-id>
+ </upstream>
+</pkgmetadata>