--- hdapsd-0.0.20070803.orig/debian/copyright +++ hdapsd-0.0.20070803/debian/copyright @@ -0,0 +1,33 @@ +This package was debianized by Evgeni Golov on +Tue, 12 Dec 2006 10:44:31 +0100. + +It was downloaded from http://www.dresco.co.uk/hdaps/ + +Upstream Author: Jon Escombe + Robert Love + Shem Multinymous + + +Copyright: 2005-2007 Jon Escombe, Robert Love, Shem Multinymous + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + +The Debian packaging is (C) 2006, Evgeni Golov and +is licensed under the GPL, see above. --- hdapsd-0.0.20070803.orig/debian/README.Debian +++ hdapsd-0.0.20070803/debian/README.Debian @@ -0,0 +1,8 @@ +hdapsd for Debian +----------------- + +hdapsd needs the hdaps kernel module and the hdaps_protect patch in the kernel +so it WON'T work out-of-the-box on a Debian machine yet. +Look at http://thinkwiki.org/wiki/HDAPS for additional information. + + -- Evgeni Golov Tue, 12 Dec 2006 10:44:31 +0100 --- hdapsd-0.0.20070803.orig/debian/default +++ hdapsd-0.0.20070803/debian/default @@ -0,0 +1,17 @@ +# hdapsd default file + +# start hdapsd at boottime? +START="yes" + +# the name of the disk device that hdapsd should monitor. +# +# usually this is 'hda' the primary master or 'sda' +# on SATA ThinkPads. +DISK="hda" + +# sensitivity +SENSITIVITY=15 + +# other options to pass to hdapsd. +# the -d $DISK, -s $SENSITIVITY, -b and -p $PIDFILE options are always passed. +OPTIONS="" --- hdapsd-0.0.20070803.orig/debian/hdapsd.8 +++ hdapsd-0.0.20070803/debian/hdapsd.8 @@ -0,0 +1,40 @@ +.TH HDAPSD "8" "August 2007" "hdapsd 20070803" "User Commands" +.SH NAME +hdapsd \- park the drive in case of an emergency +.SH SYNOPSIS +.B hdapsd +[\fIOPTIONS\fR] +.SH DESCRIPTION +.SS "Required options:" +.TP +\fB\-d\fR \fB\-\-device=\fR + is likely to be hda or sda. +.TP +\fB\-s\fR \fB\-\-sensitivity=\fR +A suggested starting is 15. +.SS "Additional options:" +.TP +\fB\-a\fR \fB\-\-adaptive\fR +Adaptive threshold (automatic +increase when the built\-in +keyboard/mouse are used). +.TP +\fB\-v\fR \fB\-\-verbose\fR +Get verbose statistics. +.TP +\fB\-b\fR \fB\-\-background\fR +Run the process in the background. +.TP +\fB\-p\fR \fB\-\-pidfile[=\fR] +Create a pid file when running +in background. +If is not specified, +it's set to /var/run/hdapsd.pid. +.TP +\fB\-t\fR \fB\-\-dry\-run\fR +Don't actually park the drive. +.TP +\fB\-y\fR \fB\-\-poll\-sysfs\fR +Force use of sysfs interface to accelerometer. +.PP +You can send SIGUSR1 to deactivate hdapsd for 8 seconds. --- hdapsd-0.0.20070803.orig/debian/NEWS +++ hdapsd-0.0.20070803/debian/NEWS @@ -0,0 +1,7 @@ +hdapsd (1:0.0.20070524-1) unstable; urgency=low + + After the change to the original hdapsd by Jon Escombe, the configuration + file (/etc/default/hdapsd) has changed, please have a look at it, as it + won't work with the old one anymore. + + -- Evgeni Golov Fri, 25 May 2007 21:55:10 +0200 --- hdapsd-0.0.20070803.orig/debian/changelog +++ hdapsd-0.0.20070803/debian/changelog @@ -0,0 +1,59 @@ +hdapsd (1:0.0.20070803-2ubuntu1) jaunty; urgency=low + + * Bump build-depend on debhelper to install udev rules into + /lib/udev/rules.d, add Breaks on udev to get correct version. + + -- Scott James Remnant Tue, 13 Jan 2009 02:13:19 +0000 + +hdapsd (1:0.0.20070803-2) unstable; urgency=low + + * debian/init: + + Add a notice that the user should read /u/s/d/hdapsd/README.Debian + + * debian/control: + + Add a Recommends on tp-smapi-modules, as this is recommended instead + of the in-kernel hdaps module + + Explain the relationship to tp-smapi and the kernel-patch in the + long description (Closes: #468387) + + Bump Standards-Version to 3.7.3, no changes needed + + -- Evgeni Golov Thu, 06 Mar 2008 00:41:41 +0100 + +hdapsd (1:0.0.20070803-1) unstable; urgency=low + + * New upstream version (Closes: #435759) + * PID-option has to be -p/path/to/pid, without a space, thanks Whoopie + * Check if hdaps module is loaded, and try to do so if not + + -- Evgeni Golov Fri, 10 Aug 2007 12:06:40 +0200 + +hdapsd (1:0.0.20070524-1) unstable; urgency=low + + * New upstream version, fixing compile errors + + -- Evgeni Golov Fri, 25 May 2007 21:54:05 +0200 + +hdapsd (1:0.0.20070415-1) UNRELEASED; urgency=low + + * New upstream version, fixing one minor bug + * Using the "original" version by Jon Escombe again + * Added a watch-file + + -- Evgeni Golov Sun, 29 Apr 2007 22:47:52 +0200 + +hdapsd (1:0.0.20061007-2) unstable; urgency=low + + * Remove THRESHOLD variable from default-file, add OPTIONS instead + Thanks to Chris Hanson (Closes: #408906) + * Minor cleanups in the manpage + * Remove bashism in /etc/init.d/hdapsd (Closes: #408998) + + -- Evgeni Golov Mon, 29 Jan 2007 22:13:45 +0100 + +hdapsd (1:0.0.20061007-1) unstable; urgency=low + + * Initial release (Closes: #402908) + * Using epoch 1, so users with unofficial packages from Andrew Barr + notice the existence of this package + + -- Evgeni Golov Tue, 12 Dec 2006 10:44:31 +0100 --- hdapsd-0.0.20070803.orig/debian/init +++ hdapsd-0.0.20070803/debian/init @@ -0,0 +1,161 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: hdapsd +# Required-Start: $local_fs +# Required-Stop: $local_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: initscript to start hdapsd +# Description: This file starts the hdapsd daemon +### END INIT INFO + +# Author: Evgeni Golov + +# Do NOT "set -e" + +# PATH should only include /usr/* if it runs after the mountnfs.sh script +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="IBM Hard Disk Active Protection System (HDAPS) daemon" +NAME=hdapsd +DAEMON=/usr/sbin/$NAME +DAEMON_ARGS="" +PIDFILE=/var/run/$NAME.pid +SCRIPTNAME=/etc/init.d/$NAME +START="no" +DISK="hda" +SENSITIVITY=15 +OPTIONS="" + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Read configuration variable file if it is present +[ -r /etc/default/$NAME ] && . /etc/default/$NAME + +# Do we really want to start the daemon? +[ "$START" = "yes" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +DAEMON_ARGS="-p$PIDFILE -d $DISK -s $SENSITIVITY -b $OPTIONS" + +# +# Function that checks if /sys/block/$DISK/queue/protect exists +# +do_checkprotect() +{ + if [ ! -f /sys/block/$DISK/queue/protect ]; then + log_warning_msg "Not starting $NAME: /sys/block/$DISK/queue/protect does not exist, please read /usr/share/doc/hdapsd/README.Debian" + exit 0 + fi +} + +# +# Function that starts the daemon/service +# +do_start() +{ + # Return + # 0 if daemon has been started + # 1 if daemon was already running + # 2 if daemon could not be started + grep -q hdaps /proc/modules || modprobe hdaps && sleep 1 + start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ + || return 1 + start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_ARGS \ + || return 2 + # Add code here, if necessary, that waits for the process to be ready + # to handle requests from services started subsequently which depend + # on this one. As a last resort, sleep for some time. +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + # Return + # 0 if daemon has been stopped + # 1 if daemon was already stopped + # 2 if daemon could not be stopped + # other if a failure occurred + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME + RETVAL="$?" + [ "$RETVAL" = 2 ] && return 2 + # Wait for children to finish too if this is a daemon that forks + # and if the daemon is only ever run from this initscript. + # If the above conditions are not satisfied then add some other code + # that waits for the process to drop all resources that could be + # needed by services started subsequently. A last resort is to + # sleep for some time. + start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON + [ "$?" = 2 ] && return 2 + # Many daemons don't delete their pidfiles when they exit. + rm -f $PIDFILE + return "$RETVAL" +} + +# +# Function that sends a SIGUSR1 to the daemon/service +# +do_pause() { + start-stop-daemon --stop --signal 10 --quiet --pidfile $PIDFILE --name $NAME + return 0 +} + +case "$1" in + start) + do_checkprotect + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + pause) + [ "$VERBOSE" != no ] && log_daemon_msg "Pauseing (8sec) $DESC" "$NAME" + do_pause + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|pause}" >&2 + exit 3 + ;; +esac + +: --- hdapsd-0.0.20070803.orig/debian/hdapsd.udev +++ hdapsd-0.0.20070803/debian/hdapsd.udev @@ -0,0 +1 @@ +KERNEL=="event[0-9]*", ATTRS{phys}=="hdaps/input1", ATTRS{modalias}=="input:b0019v1014p5054e4801-*", SYMLINK+="input/hdaps/accelerometer-event" --- hdapsd-0.0.20070803.orig/debian/compat +++ hdapsd-0.0.20070803/debian/compat @@ -0,0 +1 @@ +5 --- hdapsd-0.0.20070803.orig/debian/control +++ hdapsd-0.0.20070803/debian/control @@ -0,0 +1,25 @@ +Source: hdapsd +Section: misc +Priority: optional +Maintainer: Ubuntu MOTU Developers +XSBC-Original-Maintainer: Evgeni Golov +Build-Depends: debhelper (>= 7.0.17ubuntu2) +Standards-Version: 3.7.3 + +Package: hdapsd +Architecture: i386 amd64 +Depends: ${shlibs:Depends}, lsb-base (>= 3.0-6) +Recommends: tp-smapi-modules +Breaks: udev (<< 136-1) +Description: HDAPS daemon for IBM/Lenovo ThinkPads + This is a disk protection userspace daemon. It monitors the acceleration + values through the HDAPS interface and automatically initiates disk head + parking if a fall or sliding of the laptop is detected. + . + This daemon won't work out of the box on a stock Debian kernel, as it + needs a patch, which is not in the default Debian kernels. Please read + README.Debian for the source of that patch. + . + It is recommended that you use this daemon with the hdaps module provided + by tp-smapi rather the one in the kernel, as this will save you a bit + power and will work on a wider range of ThinkPads. --- hdapsd-0.0.20070803.orig/debian/rules +++ hdapsd-0.0.20070803/debian/rules @@ -0,0 +1,60 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +build: build-stamp + +build-stamp: + dh_testdir + gcc $(CFLAGS) hdapsd-20070803.c -o hdapsd + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + rm -f hdapsd + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + install -D hdapsd debian/hdapsd/usr/sbin/hdapsd + dh_installman debian/hdapsd.8 + dh_installinit + dh_installudev + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- hdapsd-0.0.20070803.orig/debian/watch +++ hdapsd-0.0.20070803/debian/watch @@ -0,0 +1,5 @@ +# Compulsory line, this is a version 3 file +version=3 + +# +opts="uversionmangle=s/^/0.0./" http://www.dresco.co.uk/hdaps/hdapsd-(.*)\.c