summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Campbell <ijc@debian.org>2019-01-06 13:37:59 +0000
committerIan Campbell <ijc@debian.org>2019-01-06 13:37:59 +0000
commit074ba55a4d6cb747451295825b357533fa943d2d (patch)
treef2040020f91f3736be798e0cee2514ede8406669
Import qcontrol_0.5.6-4.debian.tar.xz
[dgit import tarball qcontrol 0.5.6-4 qcontrol_0.5.6-4.debian.tar.xz]
-rw-r--r--NEWS33
-rw-r--r--README.Debian23
-rw-r--r--README.source5
-rw-r--r--TODO5
-rw-r--r--changelog316
-rw-r--r--compat1
-rw-r--r--control42
-rw-r--r--copyright34
-rw-r--r--docs3
-rw-r--r--gbp.conf2
-rwxr-xr-xinitramfs/hook24
-rwxr-xr-xinitramfs/init-bottom41
-rw-r--r--lintian-overrides8
-rw-r--r--manpages1
-rw-r--r--patches/build-static.patch15
-rw-r--r--patches/clean-static-build.patch70
-rw-r--r--patches/cross-pkg-config.patch42
-rw-r--r--patches/debian-config.patch42
-rw-r--r--patches/multiarch.patch15
-rw-r--r--patches/series5
-rw-r--r--qcontrol-udeb.dirs6
-rw-r--r--qcontrol.1130
-rw-r--r--qcontrol.dirs6
-rw-r--r--qcontrol.init58
-rw-r--r--qcontrol.install4
-rwxr-xr-xqcontrol.postinst41
-rw-r--r--qcontrol.postrm13
-rw-r--r--qcontrol.preinst16
-rw-r--r--qcontrol.prerm11
-rw-r--r--qcontrol.qcontrold.init75
-rw-r--r--qcontrol.udev3
-rwxr-xr-xrules45
-rw-r--r--source/format1
-rw-r--r--udeb/base-installer.d/10qcontrol10
-rw-r--r--udeb/debian-installer-startup.d/S99qcontrol34
-rw-r--r--udeb/finish-install.d/21qcontrol6
-rw-r--r--udeb/qcommand32
-rw-r--r--upstream/signing-key.asc150
-rw-r--r--watch9
39 files changed, 1377 insertions, 0 deletions
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..cddd852
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,33 @@
+qcontrol (0.4.2-2) unstable; urgency=low
+
+ * Input device changed
+
+ With udev (0.141-2) the persistent input device created by udev has
+ changed to: /dev/input/by-path/platform-gpio-keys-event.
+
+ -- Frans Pop <fjp@debian.org> Fri, 21 Aug 2009 01:54:46 +0200
+
+qcontrol (0.4.2-1) unstable; urgency=low
+
+ qcontrol config file compatibility with Linux kernel
+
+ With Debian kernel 2.6.26 and upstream 2.6.27 a change has been made in
+ the values for restart and media buttons. This version of qcontrol uses
+ the *new* values.
+
+ As the daemon function of qcontrol is currently not supported this does
+ not really matter. However, if users want to experiment with the daemon
+ mode and button actions and are using older kernel versions, the following
+ changes should be made in the config file that is used.
+
+ # Values for Debian kernel 2.6.26 and upstream 2.6.27 (or higher)
+ register("evdev", "/dev/input/by-path/platform-gpio-keys-event-",
+ 408, "restart_button",
+ 133, "media_button")
+
+ # Values for Debian kernel 2.6.25 and upstream 2.6.26
+ register("evdev", "/dev/input/by-path/platform-gpio-keys-event-",
+ 116, "restart_button",
+ 408, "media_button")
+
+ -- Frans Pop <fjp@debian.org> Mon, 11 Aug 2008 13:56:30 +0200
diff --git a/README.Debian b/README.Debian
new file mode 100644
index 0000000..73dcf78
--- /dev/null
+++ b/README.Debian
@@ -0,0 +1,23 @@
+qcontrol for Debian
+---------------------------
+
+The qcontrol program is still in alpha stage. It is for example missing
+a proper daemon mode that would enable it to run permanently in the
+background.
+
+Because of the missing daemon mode, the functionality to monitor temperature
+and control fan speed (TS-209/219/409) has been disabled in the config file.
+See the original config file in ./examples/ for how it could be done.
+
+This Debian package includes an init script that will change the leds and
+sound the buzzer at the end of the boot process and at the beginning of
+the shutdown or reboot process.
+
+The init script only runs the control process as long as needed to make these
+changes. There is no permanently running daemon to listen for commands, which
+means that qcontrol also does not yet respond to button presses.
+
+For further information, see the man page or the upstream webpage:
+ http://qnap.nas-central.org/index.php/PIC_Control_Software
+
+ -- Frans Pop <fjp@debian.org> Thu, 12 Jun 2008 18:36:54 +0200
diff --git a/README.source b/README.source
new file mode 100644
index 0000000..f968765
--- /dev/null
+++ b/README.source
@@ -0,0 +1,5 @@
+This package uses quilt to manage all modifications to the upstream
+source. Changes are stored in the source package as diffs in
+debian/patches and applied during the build.
+
+See /usr/share/doc/quilt/README.source for a detailed explanation.
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..7b0bd30
--- /dev/null
+++ b/TODO
@@ -0,0 +1,5 @@
+* Check for gpio_keys module on install; load it and add to /etc/modules
+* Update manpage
+* Update package description
+* File ITP
+* Add useful content to the udeb
diff --git a/changelog b/changelog
new file mode 100644
index 0000000..f55bb89
--- /dev/null
+++ b/changelog
@@ -0,0 +1,316 @@
+qcontrol (0.5.6-4) unstable; urgency=medium
+
+ * Specify Rules-Requires-Root: no.
+ * Switch to debhelper compat level 11, changes are:
+ - it is no longer necessary to patch `--with systemd` to `dh(1)`.
+ - Use `-a` option to `dh_listpackages`, in favour of obsolete `-s` option.
+ - Use `--no-stop-on-upgrade` option to `dh_installinit` in favour of
+ obsolete `--no-restart-on-upgrade` option.
+ Sticking to level 11 (rather than moving to 12, the latest version) for now
+ eases backports to stretch-backports when system units are involved as they
+ are here (see "Caveat for stretch-backports support" in
+ https://nthykier.wordpress.com/2019/01/04/debhelper-compat-12-is-now-released/).
+ * Only trigger a udev event if `udevadm` is available. Also ignore any error
+ from `udevadm trigger`.
+ * Update postinst check for presence of `update-initramfs` to use `which`
+ rather than a hardcoded path. Resolves lintian warning
+ "command-with-path-in-maintainer-script".
+ * Override `init.d-script-depends-on-all-virtual-facility` lintian warning.
+
+ -- Ian Campbell <ijc@debian.org> Sun, 06 Jan 2019 13:37:59 +0000
+
+qcontrol (0.5.6-3) unstable; urgency=medium
+
+ * Use `dh_installudev` rather than open coding.
+ * Run `udevadm trigger` from postinst so that the gpio keys device is tagged
+ before trying to start the qcontrol services (which depend on the tagged
+ device). (Closes: #914160, again!).
+ * Drop postinst code cleaning up from Lenny era.
+ * Bump standards version to 4.3.0, no changes required.
+
+ -- Ian Campbell <ijc@debian.org> Wed, 02 Jan 2019 17:28:51 +0000
+
+qcontrol (0.5.6-2) unstable; urgency=medium
+
+ [ Ondřej Nový ]
+ * d/changelog: Remove trailing whitespaces
+
+ [ Ian Campbell ]
+ * Switch Homepage to https.
+ * Fix "qcontrol FTCBFS: upstream Makefile hard codes the build
+ architecture pkg-config" by allowing the override of the pkg-config binary
+ Thanks to Helmut Grohne for the initial patch (Closes: #908525).
+ * Correctly install 60-qcontrol.rules (Closes: #912376).
+ * Refresh all patches to apply without fuzz.
+ * Catch more installation errors in debian/rules.
+
+ -- Ian Campbell <ijc@debian.org> Sun, 09 Dec 2018 14:42:37 +0000
+
+qcontrol (0.5.6-1) unstable; urgency=medium
+
+ * New upstream release.
+ - All local patches merged upstream.
+ - Add a configuration option in the examples to handle QNAP devices which
+ lack a fan (closes: #712841).
+ * Update standards version, no changes required.
+ * Use Package-Type control header in preference to XC-Package-Type.
+ * Reformat control files according to cme.
+
+ -- Ian Campbell <ijc@debian.org> Sun, 27 May 2018 11:22:20 +0100
+
+qcontrol (0.5.5-3) unstable; urgency=medium
+
+ * Open /sys/class/gpio/export write only, avoids EPERM error
+ (Closes: #795558).
+ * Enable systemd support at build time and install systemd unit files, the
+ transition away from support for rcS in the sysvinit compat layer means
+ that LSB compat mode is no longer sufficient for qcontrol (closes: #852127).
+ * Update standards version, no changes required.
+ * Add gbp.conf to packaging directory.
+
+ -- Ian Campbell <ijc@debian.org> Mon, 01 Jan 2018 12:11:17 +0000
+
+qcontrol (0.5.5-2) unstable; urgency=medium
+
+ * Update standards version, no changes required.
+
+ -- Ian Campbell <ijc@debian.org> Tue, 15 Nov 2016 18:39:43 +0000
+
+qcontrol (0.5.5-1) unstable; urgency=medium
+
+ * New upstream release.
+ - All local patches incorporated upstream.
+ - Improvements to option parsing and help messages (Closes: #804767).
+ * Update Homepage URL.
+ * Update watch file.
+
+ -- Ian Campbell <ijc@debian.org> Sun, 30 Oct 2016 14:41:08 +0000
+
+qcontrol (0.5.4-5) unstable; urgency=medium
+
+ * [udeb/qcommand] Drop check for gpio-keys driver, it is no longer required.
+ (Closes: #793179)
+
+ -- Ian Campbell <ijc@debian.org> Sun, 26 Jul 2015 17:01:05 +0100
+
+qcontrol (0.5.4-4) unstable; urgency=medium
+
+ * Handle differently named GPIO keys device nodes, this has changed in the
+ * kernel.
+
+ -- Ian Campbell <ijc@debian.org> Wed, 08 Jul 2015 19:54:06 +0100
+
+qcontrol (0.5.4-3) unstable; urgency=medium
+
+ * Apply patch from Martin Michlmayr to support device-tree only systems.
+ (Closes: #788885)
+ * Update description and README with new devices, patch from Martin Michlmayr.
+ (Closes: #788911)
+
+ -- Ian Campbell <ijc@debian.org> Tue, 23 Jun 2015 08:59:53 +0100
+
+qcontrol (0.5.4-2) unstable; urgency=medium
+
+ * Update Vcs-* to point to anonscm.
+ * Wait for necessary devices to appear before starting.
+ (Closes: #781886). This works around an issue exposed by systemd LSB
+ compatibility mode. Proper systemd support will come later.
+ * Update path to examples in man page. (Closes: #749127)
+ * Update to standards version 0.9.6, no changes required.
+
+ -- Ian Campbell <ijc@debian.org> Wed, 13 May 2015 20:02:02 +0100
+
+qcontrol (0.5.4-1) unstable; urgency=low
+
+ * New upstream release 0.5.4.
+ - Correct system-status command.
+ * New upstream release 0.5.3.
+ - New command to control rtc in ts219/ts41x (Closes: #732768)
+ - Correctly enable LCD detect GPIO if necessary
+ - Return correct status from qcontrol --direct (Closes: #617439)
+ - Reduce spaminess of temperature logging (Closes: #727150)
+ * Update to standards version 3.9.5 (no changes required).
+
+ -- Ian Campbell <ijc@hellion.org.uk> Fri, 11 Apr 2014 17:40:45 +0100
+
+qcontrol (0.5.2-2) unstable; urgency=low
+
+ * Superceded unintentional upload of 0.5.2-1~exp1 to unstable instead of
+ experimental. No changes from 0.5.2-1.
+
+ -- Ian Campbell <ijc@hellion.org.uk> Wed, 02 Oct 2013 07:31:24 +0100
+
+qcontrol (0.5.2-1) unstable; urgency=low
+
+ * New upstream release.
+ - Move confdir to end of configuration file, making it useful for local
+ overrides (Closes: #713046)
+ - New system-status module to handle system start/stop notification.
+ Sounding of the buzzer is now controlled in /etc/qcontrol.conf.
+ * Update homepage link in debian/control (Closes: #712190)
+ * Do not pass obsolete parameters to update-rc.d
+ * Simplify qcontrold initscript, use presence of /etc/qcontrol.conf to decide
+ when to start the daemon.
+
+ -- Ian Campbell <ijc@hellion.org.uk> Tue, 01 Oct 2013 19:52:44 +0100
+
+qcontrol (0.5.1-3) unstable; urgency=low
+
+ * Ignore 0x43 (RTC wakeup command) from PIC to avoid spamming logs.
+ * Implement hysteresis for fan control. (Closes: #709095)
+
+ -- Ian Campbell <ijc@hellion.org.uk> Sat, 01 Jun 2013 15:02:26 +0100
+
+qcontrol (0.5.1-2) unstable; urgency=low
+
+ * Remove alpha warning from description
+ * Fix memory corruption bug in confdir handling (Closes: #708376)
+
+ -- Ian Campbell <ijc@hellion.org.uk> Sat, 18 May 2013 10:55:39 +0100
+
+qcontrol (0.5.1-1) unstable; urgency=low
+
+ * New upstream release.
+ - Wake-on-Lan support. (Closes: #703888)
+ - Support for qcontrol.d directories. (Closes: #697574)
+ - Disable buffering when stdout/err is not a tty. (Closes: #703894)
+ - Patches merged upstream.
+ * Only require event-modules udeb on armel.
+ * Add /etc/qcontrol.d include to config files and package the directory
+
+ -- Ian Campbell <ijc@hellion.org.uk> Sun, 12 May 2013 19:25:57 +0100
+
+qcontrol (0.5.0-1) unstable; urgency=low
+
+ * New upstream release.
+ - Several patches merged upstream.
+ * Add lcd_button function to ts41x default configuration. (Closes: #702763)
+ * Sanity check the arguments to functions called from lua. (Closes: #698543)
+
+ -- Ian Campbell <ijc@hellion.org.uk> Sun, 12 May 2013 16:41:08 +0100
+
+qcontrol (0.4.2+svn-r40-3) unstable; urgency=low
+
+ * Fix typo in S99qcontrol installer hook.
+ * Disable firmware watchdog on TS-419p II as well.
+
+ -- Ian Campbell <ijc@hellion.org.uk> Sun, 25 Nov 2012 11:51:20 +0000
+
+qcontrol (0.4.2+svn-r40-2) unstable; urgency=low
+
+ * Disable firmware watchdog on TS-219p II. (Closes: #693263)
+ * Enable LCD on TS-419P II based on GPIO status. (Closes: #689912)
+
+ -- Ian Campbell <ijc@hellion.org.uk> Sat, 17 Nov 2012 12:08:50 +0000
+
+qcontrol (0.4.2+svn-r40-1) unstable; urgency=low
+
+ [ Ian Campbell ]
+ * New maintainer (Closes: #617749)
+ * Incorporate unreleased changes by Frans Pop:
+ - Update to new upstream snapshot r31 (Closes: #513344).
+ - Add an initscript to start daemon on boot.
+ - Enable temperature and fan support.
+ * Switch to 3.0 (quilt) source format.
+ * Switch to debhelper 9 and dh(1).
+ * Update version in --version (Closes: #636325).
+ * Build on armhf (Closes: 645670).
+ * New upstream snapshot r40 (Closes: #600333).
+ * Bump standards version to 3.9.4 (no changes needed).
+ * Enable hardening flags.
+
+ -- Ian Campbell <ijc@hellion.org.uk> Sat, 06 Oct 2012 13:45:22 +0100
+
+qcontrol (0.4.2-7) unstable; urgency=medium
+
+ * QA upload.
+ * Set maintainer to QA group
+ * Apply patch from Matthias Klose to fix FTBFS with ld --as-needed
+ and with multiarched lua (Closes: #643604)
+ * Set urgency to medium due to rc bug fix
+ * Fix lintian detected spelling error in package descriptions
+ (s/Allows\ to/Allows one to/)
+ * Add recommended targets build-arch and build-indep to debian/rules
+ * Add $remote_fs to the Required-Stop of the debian/init.d
+ * Bump standards to 3.9.2 (no furhter changes needed)
+
+ -- Alexander Reichle-Schmehl <tolimar@debian.org> Wed, 07 Dec 2011 13:51:09 +0100
+
+qcontrol (0.4.2-6) unstable; urgency=low
+
+ * qcontrol-udeb: depend on event-modules instead of input-modules.
+ Closes: #589581
+
+ -- Martin Michlmayr <tbm@cyrius.com> Tue, 31 Aug 2010 21:59:57 +0100
+
+qcontrol (0.4.2-5) unstable; urgency=low
+
+ * Also add support for TS-419U to udeb. Closes: #557523.
+
+ -- Frans Pop <fjp@debian.org> Mon, 23 Nov 2009 18:11:02 +0100
+
+qcontrol (0.4.2-4) unstable; urgency=low
+
+ * Let USB headers match default update-rc.d stop levels. Closes: #554796.
+ * Add support for QNAP TS-419U. Closes: #556206.
+ Many thanks to Martin Michlmayr for the patch.
+ * Update supported devices in documentation. Closes: #556210.
+ Thanks to Martin Michlmayr for the patch.
+
+ -- Frans Pop <fjp@debian.org> Sat, 14 Nov 2009 13:35:41 +0100
+
+qcontrol (0.4.2-3) unstable; urgency=low
+
+ * Remove custom udev rules file added in Lenny update (0.4.2-1lenny1).
+
+ -- Frans Pop <fjp@debian.org> Thu, 10 Sep 2009 12:15:04 +0200
+
+qcontrol (0.4.2-2) unstable; urgency=low
+
+ * Use quilt to manage patches against upstream.
+ * Update input device for udev (0.141-2). Closes: #524505.
+ * Use bash for the init script as dash does not support disown.
+ Closes: #538321.
+ * Add support for the QNAP TS-119 and TS-219. Closes: #525721.
+ Many thanks to Martin Michlmayr for the patch.
+ * Add support for autopower feature. Closes: #526932.
+ Thanks to Martin Michlmayr for the patch.
+
+ -- Frans Pop <fjp@debian.org> Fri, 21 Aug 2009 01:55:45 +0200
+
+qcontrol (0.4.2-1) unstable; urgency=low
+
+ * New upstream version:
+ - support for QNAP TS-409 (closes: #491567)
+ * Update config values for restart and media buttons in line with change in
+ Debian kernel 2.6.26 (upstream 2.6.27). Thanks to Martin Michlmayr for
+ alerting me to the change.
+ * udeb: Modify /etc/modules during base-installer instead of finish-install;
+ it is slightly more logical to do this at the same time as installing the
+ package.
+
+ -- Frans Pop <fjp@debian.org> Mon, 11 Aug 2008 15:21:21 +0200
+
+qcontrol (0.4.1-3) unstable; urgency=low
+
+ * Add gpio_keys to /etc/modules in target instead of D-I environment.
+ * Remove workaround for missing persistent-input rules. It was added
+ in udev 0.124-1.
+
+ -- Frans Pop <fjp@debian.org> Mon, 14 Jul 2008 17:39:43 +0200
+
+qcontrol (0.4.1-2) unstable; urgency=low
+
+ * Update watch file for rename from piccontrol to qcontrol.
+ * Fix errors in udeb. Closes: #488394.
+ * Add temporary workaround in udeb for #488439 (missing persistent-input
+ rules in udev-udeb).
+ * Improve the way additional scripts are included in the udeb.
+
+ -- Frans Pop <fjp@debian.org> Thu, 03 Jul 2008 20:21:23 +0200
+
+qcontrol (0.4.1-1) unstable; urgency=low
+
+ * Initial release. Closes: #483721.
+
+ -- Frans Pop <fjp@debian.org> Thu, 12 Jun 2008 18:46:42 +0200
diff --git a/compat b/compat
new file mode 100644
index 0000000..b4de394
--- /dev/null
+++ b/compat
@@ -0,0 +1 @@
+11
diff --git a/control b/control
new file mode 100644
index 0000000..030f08d
--- /dev/null
+++ b/control
@@ -0,0 +1,42 @@
+Source: qcontrol
+Maintainer: Ian Campbell <ijc@debian.org>
+Section: utils
+Priority: optional
+Build-Depends: debhelper (>= 11~),
+ libsystemd-dev,
+ liblua5.1-0-dev,
+ pkg-config
+Standards-Version: 4.3.0
+Vcs-Browser: https://salsa.debian.org/debian/qcontrol
+Vcs-Git: https://salsa.debian.org/debian/qcontrol.git
+Homepage: https://www.hellion.org.uk/qcontrol/
+Rules-Requires-Root: no
+
+Package: qcontrol
+Architecture: armel armhf
+Depends: ${shlibs:Depends},
+ ${misc:Depends},
+ udev
+Description: hardware control for QNAP Turbo Station devices
+ Allows one to send commands to the microcontroller of supported devices,
+ for example to change leds or sound a buzzer.
+ .
+ Depending on the device it can also monitor for example for button
+ presses or temperature, with events triggering actions defined in the
+ configuration file.
+ .
+ Currently supported devices are the QNAP TS-109, QNAP TS-11x,
+ QNAP TS-12x, QNAP TS-209, QNAP HS-210, QNAP TS-21x, QNAP TS-22x,
+ QNAP TS-409, QNAP TS-409U, QNAP TS-41x, QNAP TS-42x and Synology
+ Diskstation and Rackstation.
+
+Package: qcontrol-udeb
+Architecture: armel armhf
+Section: debian-installer
+Depends: ${shlibs:Depends},
+ ${misc:Depends},
+ udev-udeb (>= 0.141-2),
+ event-modules [armel]
+Package-Type: udeb
+Description: hardware control for QNAP Turbo Station devices
+ Allows one to change status leds or sound the buzzer of supported devices.
diff --git a/copyright b/copyright
new file mode 100644
index 0000000..97ea6d5
--- /dev/null
+++ b/copyright
@@ -0,0 +1,34 @@
+This package was debianized by Frans Pop <fjp@debian.org> on
+Sun, 23 Mar 2008 18:14:35 +0100.
+
+It was downloaded from http://byronbradley.co.uk/piccontrol/.
+
+Upstream Author:
+
+ Byron Bradley <byron.bbradley@gmail.com>
+
+Copyright:
+
+ Copyright (C) 2007-2008 Byron Bradley
+
+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 3 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) 2008, Frans Pop <fjp@debian.org> and
+is licensed under the GPL, see above.
diff --git a/docs b/docs
new file mode 100644
index 0000000..fba9108
--- /dev/null
+++ b/docs
@@ -0,0 +1,3 @@
+# Upstream README not included as its contents are not relevant
+#README
+debian/README.Debian
diff --git a/gbp.conf b/gbp.conf
new file mode 100644
index 0000000..4e94eb4
--- /dev/null
+++ b/gbp.conf
@@ -0,0 +1,2 @@
+[DEFAULT]
+upstream-tag = v%(version)s
diff --git a/initramfs/hook b/initramfs/hook
new file mode 100755
index 0000000..145f3c3
--- /dev/null
+++ b/initramfs/hook
@@ -0,0 +1,24 @@
+#!/bin/sh
+PREREQ=""
+prereqs()
+{
+ echo "$PREREQ"
+}
+
+case $1 in
+prereqs)
+ prereqs
+ exit 0
+ ;;
+esac
+
+if [ ! -x /usr/sbin/qcontrol ] || [ ! -f /etc/qcontrol.conf ] ; then
+ exit 0
+fi
+
+. /usr/share/initramfs-tools/hook-functions
+# Begin real processing below this line
+
+copy_exec /usr/sbin/qcontrol /sbin
+cp /etc/qcontrol.conf ${DESTDIR}/etc/qcontrol.conf
+exit 0
diff --git a/initramfs/init-bottom b/initramfs/init-bottom
new file mode 100755
index 0000000..722fae3
--- /dev/null
+++ b/initramfs/init-bottom
@@ -0,0 +1,41 @@
+#!/bin/sh
+# Qcontrol boot script, disables watchdog
+
+PREREQ=""
+prereqs()
+{
+ echo "$PREREQ"
+}
+
+case $1 in
+prereqs)
+ prereqs
+ exit 0
+ ;;
+esac
+
+. /scripts/functions
+# Begin real processing below this line
+
+# Only needed on TS-219P II and TS-419P II, safe to call on any TS-x19 though.
+if [ -e /proc/device-tree/model ]; then
+ device=$(cat /proc/device-tree/model)
+else
+ device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
+ head -n1 | sed "s/^[^:]*: //")
+fi
+case $device in
+ "QNAP TS-119/TS-219") break ;;
+ "QNAP TS219 family") break ;;
+ "QNAP TS-41x") break ;;
+ "QNAP TS419 family") break ;;
+ *) exit 0 ;;
+esac
+
+if [ ! -x "/sbin/qcontrol" ]; then
+ exit 0
+fi
+
+/sbin/qcontrol --direct watchdog off || true
+
+exit 0
diff --git a/lintian-overrides b/lintian-overrides
new file mode 100644
index 0000000..97f9607
--- /dev/null
+++ b/lintian-overrides
@@ -0,0 +1,8 @@
+# The qcontrol initscript triggers the `system-start` action which e.g
+# changes the LEDs to green in order to indicate a successful boot, so
+# we want it to run as near as possible to the end of boot. The $all
+# virtual facility is the closest thing we have to this, even though
+# it means qcontrol might signal successful boot even if local scripts
+# are still left run, it likely means that at least getty/network/sshd
+# are up and running.
+qcontrol: init.d-script-depends-on-all-virtual-facility etc/init.d/qcontrol required-start
diff --git a/manpages b/manpages
new file mode 100644
index 0000000..88fc432
--- /dev/null
+++ b/manpages
@@ -0,0 +1 @@
+debian/qcontrol.1
diff --git a/patches/build-static.patch b/patches/build-static.patch
new file mode 100644
index 0000000..98a8df2
--- /dev/null
+++ b/patches/build-static.patch
@@ -0,0 +1,15 @@
+From: Ian Campbell <ijc@debian.org>
+
+Build the static binary by default too.
+
+--- a/Makefile
++++ b/Makefile
+@@ -21,7 +21,7 @@
+ OBJECTS=$(SOURCES:.c=.o)
+ EXECUTABLE=qcontrol
+
+-all: $(SOURCES) $(EXECUTABLE)
++all: $(SOURCES) $(EXECUTABLE) $(EXECUTABLE)-static
+
+ $(EXECUTABLE): $(OBJECTS)
+ $(CC) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $@
diff --git a/patches/clean-static-build.patch b/patches/clean-static-build.patch
new file mode 100644
index 0000000..6c82bb5
--- /dev/null
+++ b/patches/clean-static-build.patch
@@ -0,0 +1,70 @@
+From: Ian Campbell <ijc@debian.org>
+
+Split static and dynamic builds
+
+Only enable systemd for the dynamic build, the static build is targetting the
+installer environment where systemd is not present.
+
+To do this split the .o files into .o-dyn and .o-static and arrange for
+appropriate *FLAGS etc for each case.
+
+--- a/Makefile
++++ b/Makefile
+@@ -5,35 +5,44 @@
+
+ PKG_CONFIG ?= pkg-config
+ LDFLAGS += -g
+-LIBS += -lpthread
+-LIBS_STATIC += /usr/lib/$$(dpkg-architecture -qDEB_HOST_MULTIARCH)/liblua5.1.a -lpthread -lm -ldl
++LIBS_DYNAMIC += -lpthread
++LIBS_STATIC += /usr/lib/$$(dpkg-architecture -qDEB_HOST_MULTIARCH)/liblua5.1.a -lpthread -lm -ldl
+
+ CFLAGS += $(shell $(PKG_CONFIG) --cflags lua5.1)
+-LIBS += $(shell $(PKG_CONFIG) --libs lua5.1)
++
++LIBS_DYNAMIC += $(shell $(PKG_CONFIG) --libs lua5.1)
+
+ ifeq ($(shell $(PKG_CONFIG) --exists libsystemd-daemon 2>/dev/null && echo 1),1)
+-CPPFLAGS += -DHAVE_SYSTEMD
+-CFLAGS += $(shell $(PKG_CONFIG) --cflags libsystemd-daemon)
+-LIBS += $(shell $(PKG_CONFIG) --libs libsystemd-daemon)
++CPPFLAGS_DYNAMIC += -DHAVE_SYSTEMD
++CFLAGS_DYNAMIC += $(shell $(PKG_CONFIG) --cflags libsystemd-daemon)
++LIBS_DYNAMIC += $(shell $(PKG_CONFIG) --libs libsystemd-daemon)
+ endif
+
+ SOURCES=qcontrol.c system.c qnap-pic.c ts209.c ts219.c ts409.c ts41x.c evdev.c a125.c synology.c
+-OBJECTS=$(SOURCES:.c=.o)
++OBJECTS_DYNAMIC=$(SOURCES:.c=.o-dyn)
++OBJECTS_STATIC=$(SOURCES:.c=.o-static)
+ EXECUTABLE=qcontrol
+
+ all: $(SOURCES) $(EXECUTABLE) $(EXECUTABLE)-static
+
+-$(EXECUTABLE): $(OBJECTS)
+- $(CC) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $@
++$(EXECUTABLE): $(OBJECTS_DYNAMIC)
++ $(CC) $(LDFLAGS) $(OBJECTS_DYNAMIC) $(LIBS_DYNAMIC) -o $@
++
++$(EXECUTABLE)-static: $(OBJECTS_STATIC)
++ $(CC) $(LDFLAGS) $(OBJECTS_STATIC) $(LIBS_STATIC) -o $@
+
+-$(EXECUTABLE)-static: $(OBJECTS)
+- $(CC) $(LDFLAGS) $(OBJECTS) $(LIBS_STATIC) -o $@
++$(OBJECTS_DYNAMIC): CPPFLAGS += $(CPPFLAGS_DYNAMIC)
++$(OBJECTS_DYNAMIC): CFLAGS += $(CFLAGS_DYNAMIC)
++%.o-dyn: %.c
++ $(CC) $(CPPFLAGS) $(CFLAGS) $< -o $@
+
+-.c.o:
++$(OBJECTS_STATIC): CPPFLAGS += $(CPPFLAGS_STATIC)
++$(OBJECTS_STATIC): CFLAGS += $(CFLAGS_STATIC)
++%.o-static: %.c
+ $(CC) $(CPPFLAGS) $(CFLAGS) $< -o $@
+
+ clean:
+- rm -f $(OBJECTS) $(EXECUTABLE) $(EXECUTABLE)-static
++ rm -f $(OBJECTS_DYNAMIC) $(OBJECTS_STATIC) $(EXECUTABLE) $(EXECUTABLE)-static
+
+ dist: RELEASES := $(PWD)/../releases/
+ dist: TARBALL := qcontrol-$(VERSION).tar
diff --git a/patches/cross-pkg-config.patch b/patches/cross-pkg-config.patch
new file mode 100644
index 0000000..d894fa3
--- /dev/null
+++ b/patches/cross-pkg-config.patch
@@ -0,0 +1,42 @@
+From 3bf66a3e3b1e7c5a1e23693e0e08aeb2cefa7e08 Mon Sep 17 00:00:00 2001
+From: Ian Campbell <ijc@hellion.org.uk>
+Date: Sun, 9 Dec 2018 11:37:45 +0000
+Subject: [PATCH] Allow configuration of the pkg-config to use
+
+This allows for cross building. Based on a patch from Helmut Grohne in Debian
+bug #908525.
+---
+ Makefile | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 1034036..71da891 100644
+--- a/Makefile
++++ b/Makefile
+@@ -3,17 +3,18 @@ VERSION=0.5.6
+ CFLAGS += -c -g -Os -Wall -Wextra
+ CPPFLAGS += -DQCONTROL_VERSION=\"$(VERSION)\"
+
++PKG_CONFIG ?= pkg-config
+ LDFLAGS += -g
+ LIBS += -lpthread
+ LIBS_STATIC += /usr/lib/liblua5.1.a -lpthread -lm -ldl
+
+-CFLAGS += $(shell pkg-config --cflags lua5.1)
+-LIBS += $(shell pkg-config --libs lua5.1)
++CFLAGS += $(shell $(PKG_CONFIG) --cflags lua5.1)
++LIBS += $(shell $(PKG_CONFIG) --libs lua5.1)
+
+-ifeq ($(shell pkg-config --exists libsystemd-daemon 2>/dev/null && echo 1),1)
++ifeq ($(shell $(PKG_CONFIG) --exists libsystemd-daemon 2>/dev/null && echo 1),1)
+ CPPFLAGS += -DHAVE_SYSTEMD
+-CFLAGS += $(shell pkg-config --cflags libsystemd-daemon)
+-LIBS += $(shell pkg-config --libs libsystemd-daemon)
++CFLAGS += $(shell $(PKG_CONFIG) --cflags libsystemd-daemon)
++LIBS += $(shell $(PKG_CONFIG) --libs libsystemd-daemon)
+ endif
+
+ SOURCES=qcontrol.c system.c qnap-pic.c ts209.c ts219.c ts409.c ts41x.c evdev.c a125.c synology.c
+--
+2.18.0
+
diff --git a/patches/debian-config.patch b/patches/debian-config.patch
new file mode 100644
index 0000000..35ceb0b
--- /dev/null
+++ b/patches/debian-config.patch
@@ -0,0 +1,42 @@
+From: Ian Campbell <ijc@debian.org>
+
+Update LUA configuration files headers to indicate they are tailored for
+Debian. Also avoids noisy conffile updates for people who installed older
+versions.
+
+--- a/examples/ts209.lua
++++ b/examples/ts209.lua
+@@ -1,5 +1,5 @@
+ --[[
+- Configuration file for qcontrol (LUA syntax)
++ Debian configuration file for qcontrol (LUA syntax)
+ Supports both QNAP TS-109 and TS-209.
+ --]]
+
+--- a/examples/ts219.lua
++++ b/examples/ts219.lua
+@@ -1,5 +1,5 @@
+ --[[
+- Configuration file for qcontrol (LUA syntax)
++ Debian configuration file for qcontrol (LUA syntax)
+ Supports QNAP TS-110, TS-119, TS-210, TS-219 and TS-219P.
+ --]]
+
+--- a/examples/ts409.lua
++++ b/examples/ts409.lua
+@@ -1,5 +1,5 @@
+ --[[
+- Configuration file for qcontrol (LUA syntax)
++ Debian configuration file for qcontrol (LUA syntax)
+ Supports the QNAP TS-409.
+ --]]
+
+--- a/examples/ts41x.lua
++++ b/examples/ts41x.lua
+@@ -1,5 +1,5 @@
+ --[[
+- Configuration file for qcontrol (LUA syntax)
++ Debian configuration file for qcontrol (LUA syntax)
+ Supports the QNAP TS-410, TS-410U, TS-419P and TS-419U.
+ --]]
+
diff --git a/patches/multiarch.patch b/patches/multiarch.patch
new file mode 100644
index 0000000..7b523c1
--- /dev/null
+++ b/patches/multiarch.patch
@@ -0,0 +1,15 @@
+From: Ian Campbell <ijc@debian.org>
+
+Link against multi-arch location for static lua library.
+
+--- a/Makefile
++++ b/Makefile
+@@ -6,7 +6,7 @@
+ PKG_CONFIG ?= pkg-config
+ LDFLAGS += -g
+ LIBS += -lpthread
+-LIBS_STATIC += /usr/lib/liblua5.1.a -lpthread -lm -ldl
++LIBS_STATIC += /usr/lib/$$(dpkg-architecture -qDEB_HOST_MULTIARCH)/liblua5.1.a -lpthread -lm -ldl
+
+ CFLAGS += $(shell $(PKG_CONFIG) --cflags lua5.1)
+ LIBS += $(shell $(PKG_CONFIG) --libs lua5.1)
diff --git a/patches/series b/patches/series
new file mode 100644
index 0000000..9d05cc2
--- /dev/null
+++ b/patches/series
@@ -0,0 +1,5 @@
+cross-pkg-config.patch
+multiarch.patch
+build-static.patch
+debian-config.patch
+clean-static-build.patch
diff --git a/qcontrol-udeb.dirs b/qcontrol-udeb.dirs
new file mode 100644
index 0000000..5691e79
--- /dev/null
+++ b/qcontrol-udeb.dirs
@@ -0,0 +1,6 @@
+etc
+etc/qcontrol
+lib/debian-installer-startup.d
+usr/lib/base-installer.d
+usr/lib/finish-install.d
+usr/sbin
diff --git a/qcontrol.1 b/qcontrol.1
new file mode 100644
index 0000000..942523b
--- /dev/null
+++ b/qcontrol.1
@@ -0,0 +1,130 @@
+.TH QCONTROL 1 "2009-12-07" "Debian Project" ""
+
+.SH NAME
+qcontrol \- Hardware control for QNAP Turbo Station
+
+.SH SYNOPSIS
+\fBqcontrol\fB -d
+.PP
+\fBqcontrol\fB \fIcommand\fP \fIvalue\fP
+
+.SH DESCRIPTION
+The utility can be used to control leds or fan speed, or sound the buzzer.
+As a daemon it can monitor the device for example for button presses or
+temperature values and trigger actions defined in the LUA configuration
+file, for example to power off the system or to modify the fan speed.
+.PP
+Note: the current version does not have a real daemon mode. Caution is
+therefore advised when using qcontrol as a real daemon to monitor and
+control a device.
+.PP
+Currently supported devices are the QNAP TS-109, QNAP TS-11x, QNAP TS-12x,
+QNAP TS-209, QNAP HS-210, QNAP TS-21x, QNAP TS-22x, QNAP TS-409, QNAP
+TS-409U, QNAP TS-41x, QNAP TS-42x and Synology Diskstation and Rackstation.
+Support for additional devices may be added in future releases.
+
+.SH BASIC USAGE
+Normally a control process will be started when the system is booted.
+This control process opens a socket through which the actual commands can
+be passed. A control proces is started using either the \fB\-\-daemon\fP
+or \fB\-\-foreground\fP options.
+.PP
+After that, the actual commands to control devices can be entered:
+ # qcontrol <command> <value>
+.PP
+Because the socket file is created in /var/run, all commands must be run
+as root.
+
+.SH OPTIONS
+This program follows the usual GNU command line syntax, with long options
+starting with two dashes (`-').
+An overview of supported options is included below.
+
+.IP "\fB\-d\fP, \fB\-\-daemon\fP"
+Starts the control process as a background process (daemon mode).
+Messages will be logged in the syslog.
+
+.IP "\fB\-f\fP, \fB\-\-foreground\fP"
+Starts the control process as a foreground process. Mainly useful for testing.
+
+.IP "\fB\-\-direct\fP"
+Allows to execute a qcontrol command without a running control process.
+
+.IP "\fB\-?\fP, \fB\-\-help\fP"
+Print command help and info.
+
+.IP "\fB\-V\fP, \fB\-\-version\fP"
+Print program version.
+
+.SH SUPPORTED CLIENT COMMANDS
+Below an overview of the supported commands that can be sent using the
+program in client mode, and the allowed values for each.
+
+Commands (these and others) can also be programmed in response to events
+using the LUA configuration file.
+
+For the leds, values including `1hz' and `2hz' will result in the led
+flashing on/off in the default or specified color, with the `hz' value
+determining the speed of the flashes. In the case of `greenred', the led
+will alternate between green and red instead of on and off.
+
+.IP "\fBpowerled\fP"
+Controls the power led (not available on TS-409 and TS-409U).
+
+Values: off | on | 1hz | 2hz
+
+.IP "\fBstatusled\fP"
+Controls the status led.
+
+Values:
+ off | greenon | redon |
+ green1hz | red1hz | greenred1hz |
+ green2hz | red2hz | greenred2hz
+
+.IP "\fBusbled\fP"
+Controls the usb led.
+
+Values: off | on | 8hz
+
+.IP "\fBbuzzer\fP"
+Sounds the buzzer.
+
+Values: short | long
+
+.IP "\fBfanspeed\fP"
+Controls the speed of the fan (if present).
+
+Values: stop | silence | low | medium | high | full
+
+.IP "\fBautopower\fP"
+Controls the automatic power mechanism.
+
+Values: on | off
+
+.SH KNOWN ISSUES
+After running the control process and killing it, the socket file will still
+exist. This will cause the following error when the control process is started
+again: `Error binding to socket: Address already in use'.
+.PP
+The solution is to remove the socket file and then try again:
+ # rm /var/run/qcontrol.sock
+.PP
+The program is not yet very robust against errors in the configuration file.
+
+.SH FILES
+.IP \fB/etc/qcontrol.conf\fP
+LUA configuration file for qcontrol
+.IP \fB/etc/default/qcontrol\fP
+Configuration file for qcontrol init script
+.IP \fB/var/run/qcontrol.sock\fP
+Socket file for communication between daemon precess and client
+
+.SH SEE ALSO
+.IP \fB/etc/qcontrol/*.lua\fP
+Example LUA configuration files for a variety of platforms
+
+.SH AUTHOR
+qcontrol was written by Byron Bradley <byron.bbradley@gmail.com>.
+.PP
+This manual page was written by Frans Pop <fjp@debian.org>
+for the Debian project (but may be used by others).
diff --git a/qcontrol.dirs b/qcontrol.dirs
new file mode 100644
index 0000000..e557021
--- /dev/null
+++ b/qcontrol.dirs
@@ -0,0 +1,6 @@
+etc
+etc/qcontrol
+etc/qcontrol.d
+usr/sbin
+usr/share/initramfs-tools/hooks
+usr/share/initramfs-tools/scripts/init-bottom
diff --git a/qcontrol.init b/qcontrol.init
new file mode 100644
index 0000000..d38c837
--- /dev/null
+++ b/qcontrol.init
@@ -0,0 +1,58 @@
+#!/bin/bash
+#
+### BEGIN INIT INFO
+# Provides: qcontrol
+# Required-Start: qcontrold $remote_fs $all
+# Required-Stop: qcontrold $remote_fs
+# Should-Start:
+# Should-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Change status leds for QNAP Turbo Station devices
+### END INIT INFO
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+DAEMON=/usr/sbin/qcontrol
+NAME=qcontrol
+
+PIDFILE=/var/run/$NAME.pid
+
+test -x $DAEMON || exit 0
+
+. /lib/lsb/init-functions
+
+# Include defaults if available
+if [ -f /etc/default/$NAME ] ; then
+ . /etc/default/$NAME
+fi
+
+if [ ! -e /etc/qcontrol.conf ] ; then
+ exit 0
+fi
+
+set -e
+
+case "$1" in
+ start)
+ # TODO: check that daemon is running
+ log_action_msg "System boot completed"
+ # Change status led to show green etc
+ qcontrol system-status start
+ ;;
+ stop)
+ # TODO: check that daemon is running
+ log_action_msg "Preparing for shutdown"
+ # Change status led to show red etc
+ qcontrol system-status stop
+ ;;
+ force-stop|restart|force-reload|status|reload)
+ ;;
+ *)
+ N=/etc/init.d/$NAME
+ echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/qcontrol.install b/qcontrol.install
new file mode 100644
index 0000000..25d1727
--- /dev/null
+++ b/qcontrol.install
@@ -0,0 +1,4 @@
+qcontrol usr/sbin/
+systemd/qcontrold.service lib/systemd/system/
+systemd/qcontrold.socket lib/systemd/system/
+systemd/qcontrol.service lib/systemd/system/
diff --git a/qcontrol.postinst b/qcontrol.postinst
new file mode 100755
index 0000000..def99e0
--- /dev/null
+++ b/qcontrol.postinst
@@ -0,0 +1,41 @@
+#! /bin/sh
+set -e
+
+if [ ! -e /etc/qcontrol.conf ]; then
+ if [ -e /proc/device-tree/model ]; then
+ device=$(cat /proc/device-tree/model)
+ else
+ device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
+ head -n1 | sed "s/^[^:]*: //")
+ fi
+ case $device in
+ "QNAP TS-109/TS-209")
+ ln -s qcontrol/ts209.lua /etc/qcontrol.conf ;;
+ "QNAP TS-119/TS-219" | "QNAP TS219 family")
+ ln -s qcontrol/ts219.lua /etc/qcontrol.conf ;;
+ "QNAP TS-409")
+ ln -s qcontrol/ts409.lua /etc/qcontrol.conf ;;
+ "QNAP TS-41x" | "QNAP TS419 family")
+ ln -s qcontrol/ts41x.lua /etc/qcontrol.conf ;;
+ esac
+fi
+
+if dpkg-maintscript-helper supports rm_conffile; then
+ dpkg-maintscript-helper rm_conffile \
+ /etc/default/qcontrol 0.5.1-4~ qcontrol -- "$@"
+fi
+
+case "$1" in
+ configure)
+ # Ensures that a newly installed qcontrol.rules actually tags the
+ # device such that systemd sees it.
+ if which udevadm >/dev/null 2>&1; then
+ udevadm trigger --subsystem-match input --property-match ID_PATH=platform-gpio_keys
+ fi
+ if which update-initramfs >/dev/null 2>&1; then
+ update-initramfs -u
+ fi
+ ;;
+esac
+
+#DEBHELPER#
diff --git a/qcontrol.postrm b/qcontrol.postrm
new file mode 100644
index 0000000..25b0963
--- /dev/null
+++ b/qcontrol.postrm
@@ -0,0 +1,13 @@
+#! /bin/sh
+set -e
+
+if [ "$1" = purge ]; then
+ rm -f /etc/qcontrol.conf /etc/qcontrol.conf.dpkg*
+fi
+
+if dpkg-maintscript-helper supports rm_conffile; then
+ dpkg-maintscript-helper rm_conffile \
+ /etc/default/qcontrol 0.5.1-4~ qcontrol -- "$@"
+fi
+
+#DEBHELPER#
diff --git a/qcontrol.preinst b/qcontrol.preinst
new file mode 100644
index 0000000..5e5979b
--- /dev/null
+++ b/qcontrol.preinst
@@ -0,0 +1,16 @@
+#! /bin/sh
+set -e
+
+# For upgrade from versions < 0.4.2
+if [ "$2" ] && dpkg --compare-versions "$2" lt 0.4.2 && \
+ [ -f /etc/qcontrol.conf ] && [ ! -L /etc/qcontrol.conf ]; then
+ mkdir -p /etc/qcontrol
+ mv /etc/qcontrol.conf /etc/qcontrol/ts209.lua
+fi
+
+if dpkg-maintscript-helper supports rm_conffile; then
+ dpkg-maintscript-helper rm_conffile \
+ /etc/default/qcontrol 0.5.1-4~ qcontrol -- "$@"
+fi
+
+#DEBHELPER#
diff --git a/qcontrol.prerm b/qcontrol.prerm
new file mode 100644
index 0000000..c513502
--- /dev/null
+++ b/qcontrol.prerm
@@ -0,0 +1,11 @@
+#! /bin/sh
+set -e
+
+# For downgrade to versions < 0.4.2
+if [ "$1" = upgrade ] && dpkg --compare-versions "$2" lt 0.4.2; then
+ rm -f /etc/qcontrol.conf
+ mv /etc/qcontrol/ts209.lua /etc/qcontrol.conf
+ rm -rf /etc/qcontrol/
+fi
+
+#DEBHELPER#
diff --git a/qcontrol.qcontrold.init b/qcontrol.qcontrold.init
new file mode 100644
index 0000000..55bd5a1
--- /dev/null
+++ b/qcontrol.qcontrold.init
@@ -0,0 +1,75 @@
+#!/bin/bash
+#
+### BEGIN INIT INFO
+# Provides: qcontrold
+# Required-Start: $local_fs $remote_fs $syslog
+# Required-Stop: $local_fs $remote_fs $syslog
+# Should-Start:
+# Should-Stop:
+# Default-Start: S
+# Default-Stop: 0 1 6
+# Short-Description: Start qcontrol daemon
+### END INIT INFO
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+DAEMON=/usr/sbin/qcontrol
+NAME=qcontrol
+
+PIDFILE=/var/run/$NAME.pid
+
+test -x $DAEMON || exit 0
+
+. /lib/lsb/init-functions
+
+SOUND_BUZZER=yes
+
+# Include defaults if available
+if [ -f /etc/default/$NAME ] ; then
+ . /etc/default/$NAME
+fi
+
+# Only run if config exists.
+if [ ! -e /etc/qcontrol.conf ] ; then
+ exit 0
+fi
+
+set -e
+
+case "$1" in
+ start)
+ # Ensure that /dev/input/by-path/platform-gpio-keys-event has
+ # arrived. Under systemd LSB compatibility mode it may not
+ # have yet.
+ udevadm settle
+
+ log_daemon_msg "Starting qcontrol daemon" "qcontrol"
+ if start-stop-daemon --start --quiet --oknodo --exec $DAEMON -- -d; then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ fi
+ ;;
+ stop|force-stop)
+ log_daemon_msg "Stopping qcontrol daemon" "qcontrol"
+ if start-stop-daemon --stop --quiet --oknodo --exec $DAEMON; then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ fi
+ ;;
+ restart|reload|force-reload)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ status)
+ ;;
+ *)
+ N=/etc/init.d/$NAME
+ echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/qcontrol.udev b/qcontrol.udev
new file mode 100644
index 0000000..9262cad
--- /dev/null
+++ b/qcontrol.udev
@@ -0,0 +1,3 @@
+# qcontrold.socket requires notification of
+# /dev/input/by-path/platform-gpio-keys-event's arrival
+KERNELS=="gpio[-_]keys", SUBSYSTEMS=="platform", DRIVERS=="gpio[-_]keys", TAG+="systemd"
diff --git a/rules b/rules
new file mode 100755
index 0000000..e49c2ec
--- /dev/null
+++ b/rules
@@ -0,0 +1,45 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+PACKAGES = $(shell dh_listpackages -a)
+UDEB_DIRS = lib/debian-installer-startup.d \
+ usr/lib/base-installer.d \
+ usr/lib/finish-install.d
+
+CONFIGS = ts209.lua ts219.lua ts409.lua ts41x.lua
+
+%:
+ dh $@
+
+override_dh_auto_install:
+ dh_install
+ dh_installudev --priority=60
+
+ # Install the following "manually" as they need a rename
+ @set -ex; $(foreach PACKAGE, $(PACKAGES), \
+ $(foreach CONFIG, $(CONFIGS), \
+ install -m0644 examples/$(CONFIG) \
+ debian/$(PACKAGE)/etc/qcontrol/; \
+ ) \
+ )
+ install -m0755 qcontrol-static \
+ debian/qcontrol-udeb/usr/sbin/qcontrol
+ install -m0755 debian/initramfs/hook \
+ debian/qcontrol/usr/share/initramfs-tools/hooks/qcontrol
+ install -m0755 debian/initramfs/init-bottom \
+ debian/qcontrol/usr/share/initramfs-tools/scripts/init-bottom/qcontrol
+ # Install the following "manually" as they need permissions set
+ install -m0755 debian/udeb/qcommand \
+ debian/qcontrol-udeb/usr/sbin/
+ @set -ex; $(foreach UDEB_DIR, $(UDEB_DIRS), \
+ install -m0755 debian/udeb/$$(basename $(UDEB_DIR))/* \
+ debian/qcontrol-udeb/$(UDEB_DIR); )
+
+override_dh_installinit:
+ dh_installinit --name=qcontrold
+ # This initscript just changes the LEDs and sounds the buzzer. No need
+ # to do this on install or upgrade.
+ dh_installinit --no-start --no-stop-on-upgrade
diff --git a/source/format b/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/udeb/base-installer.d/10qcontrol b/udeb/base-installer.d/10qcontrol
new file mode 100644
index 0000000..86c3a1e
--- /dev/null
+++ b/udeb/base-installer.d/10qcontrol
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+if qcommand -t; then
+ # Queue qcontrol for installation on supported devices
+ apt-install qcontrol
+
+ # qcontrol requires the gpio_keys module; add it in /etc/modules
+ printf "\n\n# Required for qcontrol\n" >>/target/etc/modules
+ printf "gpio_keys\n" >>/target/etc/modules
+fi
diff --git a/udeb/debian-installer-startup.d/S99qcontrol b/udeb/debian-installer-startup.d/S99qcontrol
new file mode 100644
index 0000000..06fa7d1
--- /dev/null
+++ b/udeb/debian-installer-startup.d/S99qcontrol
@@ -0,0 +1,34 @@
+#! /bin/sh
+
+if qcommand -t; then
+ watchdog="no"
+ if [ -e /proc/device-tree/model ]; then
+ device=$(cat /proc/device-tree/model)
+ else
+ device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
+ head -n1 | sed "s/^[^:]*: //")
+ fi
+ case $device in
+ "QNAP TS-109/TS-209")
+ mv /etc/qcontrol/ts209.lua /etc/qcontrol.conf ;;
+ "QNAP TS-119/TS-219" | "QNAP TS219 family")
+ watchdog="yes"
+ mv /etc/qcontrol/ts219.lua /etc/qcontrol.conf ;;
+ "QNAP TS-409")
+ mv /etc/qcontrol/ts409.lua /etc/qcontrol.conf ;;
+ "QNAP TS-41x" | "QNAP TS419 family")
+ watchdog="yes"
+ mv /etc/qcontrol/ts41x.lua /etc/qcontrol.conf ;;
+ esac
+ rm -rf /etc/qcontrol/
+
+ modprobe -q gpio_keys >/dev/null 2>&1
+ sleep 1
+
+ if [ X"$watchdog" = X"yes" ]; then
+ qcommand watchdog off
+ fi
+
+ qcommand powerled on
+ qcommand statusled green1hz
+fi
diff --git a/udeb/finish-install.d/21qcontrol b/udeb/finish-install.d/21qcontrol
new file mode 100644
index 0000000..73407fb
--- /dev/null
+++ b/udeb/finish-install.d/21qcontrol
@@ -0,0 +1,6 @@
+#! /bin/sh
+
+if qcommand -t; then
+ qcommand powerled 1hz
+ qcommand statusled red1hz
+fi
diff --git a/udeb/qcommand b/udeb/qcommand
new file mode 100644
index 0000000..83e60c6
--- /dev/null
+++ b/udeb/qcommand
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# Wrapper script for qcontrol to execute single commands
+# If called with -t, it only tests if the device is supported
+
+# Test if device is supported
+if [ -e /proc/device-tree/model ]; then
+ device=$(cat /proc/device-tree/model)
+else
+ device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
+ head -n1 | sed "s/^[^:]*: //")
+fi
+case $device in
+ "QNAP TS-109/TS-209" | "QNAP TS-119/TS-219" | "QNAP TS219 family" | "QNAP TS-409" | "QNAP TS-41x" | "QNAP TS419 family")
+ # Success or continue
+ [ "$1" = "-t" ] && exit 0 || true ;;
+ *)
+ # Failure or silently exit
+ [ "$1" = "-t" ] && exit 1 || exit 0 ;;
+esac
+
+case $device in
+ "QNAP TS-409" | "QNAP TS-41x" | "QNAP TS419 family")
+ if [ "$1" = powerled ]; then
+ exit 0
+ fi ;;
+esac
+
+# Returns 1 even on success (TODO: is that still true?)
+qcontrol --direct "$@" || true
+
+exit 0
diff --git a/upstream/signing-key.asc b/upstream/signing-key.asc
new file mode 100644
index 0000000..2ecd505
--- /dev/null
+++ b/upstream/signing-key.asc
@@ -0,0 +1,150 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1
+
+mQINBE24IUcBEACis9e3QtgcOOHlbqjgVXScdxud6AvE5ziXGM7vt1AFudWqVqWf
+yXoEA22l1qG2l54Fe/+sWJ5y43ReROOlTRUIyx40Xz8dVj35/PJZ442elpUz5Ica
+KUNX/cgGen0I98VRoNUUCZQfuxg3y0CgHU2S5U7ETSKxVx0E2UYZOqsaU4gYQjmn
+ly1uvkNiEthdDB+15yL0YpqA8g2OcQsfh6WmfM2bo78tLvsQj6zlEhiaUimUUlSM
+Z8X38FK4hC8x353LO8K+9yryX5SMBPYsi8GlD0x12mL7v2TayIxKJP8iKpXL1TU6
+rnrxs2Q8wyPIuosK9nVx24o8hA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fNHzpyo8NpWnYyIKhm3jGH64jFX+GvMVYkFxUpyTmHBq6K0roC7LU
+1V7fRqns/5iSY3xGlKkUWY1p1h/lcGVHInuNZ+JYtiRTKS10612nWByBci51UP0b
+wyMh/4Nlxc1jPWv+NJTVlpLw91W78ocbKNs4+qHj4Z9OCSABVk9voEMbVrfTltnh
+Zyir29XrCyBhiilCap2e6QdC3EjToKfRK9dmZGum1Lh9tJynXSU7kjdsM3BQesQM
+iICzVlnoU9TDLmHrfLCEUbb8ErPbqQAGXDgQ2oQDeT6lLv7ZztRAQFmjHFTiBGu0
+LY7MLS15fQBh5vaDu7BIWB8ttUx/gZA+Eiecaype86yAzl+syOmvViN+e9b16h1X
+WnEgumQ8DQPnZsG7a9n6gghqoSxP8i7xtAMzFco9oxBbl75VwETHhRMrY0hpDLcm
+WSUQlECjYWpMiIoSiPZOThlTZLCqWPRgeHHGXasUlURn9mtNcNwr7c3CuhQZlCQS
+cWcmLWvN60dQRY/QLmCM7SCnAg4Ek8SD+fdysiREPXs7r4hFv6saVpwTYm7xgmnr
+Vl6Ku+n8puw=
+=X7bR
+-----END PGP PUBLIC KEY BLOCK-----
diff --git a/watch b/watch
new file mode 100644
index 0000000..2209ae2
--- /dev/null
+++ b/watch
@@ -0,0 +1,9 @@
+# Example watch control file for uscan
+# Rename this file to "watch" and then you can run the "uscan" command
+# to check for upstream updates and more.
+# See uscan(1) for format
+
+# Compulsory line, this is a version 3 file
+version=3
+opts=pgpsigurlmangle=s/$/.asc/,filenamemangle=s/.*\/qcontrol-(\d\S*)\.tar\.xz/qcontrol-$1\.tar\.xz/ \
+ https://www.hellion.org.uk/qcontrol/releases/ .*/qcontrol-(\d\S*)\.tar\.xz