summaryrefslogtreecommitdiff
path: root/sys-apps/qcontrol/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-apps/qcontrol/files
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-apps/qcontrol/files')
-rw-r--r--sys-apps/qcontrol/files/0.4.2-Makefile.patch22
-rw-r--r--sys-apps/qcontrol/files/conf.d5
-rw-r--r--sys-apps/qcontrol/files/init.d74
3 files changed, 101 insertions, 0 deletions
diff --git a/sys-apps/qcontrol/files/0.4.2-Makefile.patch b/sys-apps/qcontrol/files/0.4.2-Makefile.patch
new file mode 100644
index 000000000000..ad3701c549eb
--- /dev/null
+++ b/sys-apps/qcontrol/files/0.4.2-Makefile.patch
@@ -0,0 +1,22 @@
+--- Makefile.orig 2011-04-02 20:44:05.021252507 +0200
++++ Makefile 2011-04-02 20:45:21.751248966 +0200
+@@ -1,5 +1,4 @@
+-CFLAGS=-Os -Wall -I /usr/include/lua5.1
+-LDFLAGS=-llua5.1 -lpthread
++LDFLAGS=-llua -lpthread
+ LDFLAGS_UDEB=-lpthread -lm -ldl
+ SOURCES=qcontrol.c ts209.c ts219.c ts409.c ts41x.c evdev.c
+ OBJECTS=$(SOURCES:.c=.o)
+@@ -8,10 +7,10 @@
+ all: $(SOURCES) $(EXECUTABLE) qcontrol.udeb
+
+ $(EXECUTABLE): $(OBJECTS)
+- $(CC) $(LDFLAGS) $(OBJECTS) -o $@
++ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) -o $@
+
+ qcontrol.udeb: $(OBJECTS)
+- $(CC) $(LDFLAGS_UDEB) $(OBJECTS) /usr/lib/liblua5.1.a -o $@
++ $(CC) $(CFLAGS) $(LDFLAGS_UDEB) $(OBJECTS) /usr/lib/liblua.a -o $@
+
+ .cpp.o:
+ $(CC) $(CFLAGS) $< -o $@
diff --git a/sys-apps/qcontrol/files/conf.d b/sys-apps/qcontrol/files/conf.d
new file mode 100644
index 000000000000..6a732c48e2ff
--- /dev/null
+++ b/sys-apps/qcontrol/files/conf.d
@@ -0,0 +1,5 @@
+# /etc/conf.d/qcontrol: config file for /etc/init.d/qcontrol
+
+# Set to "no" to suppress the sounding of the buzzer
+#SOUND_BUZZER=no
+
diff --git a/sys-apps/qcontrol/files/init.d b/sys-apps/qcontrol/files/init.d
new file mode 100644
index 000000000000..1a2ea38eb4d4
--- /dev/null
+++ b/sys-apps/qcontrol/files/init.d
@@ -0,0 +1,74 @@
+#!/sbin/openrc-run
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# Header: $
+
+# Init script from Debian
+
+depend() {
+ after local
+}
+
+start() {
+ einfo "System boot completed"
+ if [ ! -c /dev/input/by-path/platform-gpio-keys-event- ]; then
+ eerror "qcontrol error: gpio_keys device not available"
+ return 1
+ fi
+ start-stop-daemon --start --quiet --background --pidfile /var/run/qcontrol.pid --make-pidfile --exec /usr/sbin/qcontrol -- -d
+ # Change status led to show green
+ device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
+ head -n1 | sed "s/^[^:]*: //")
+ case $device in
+ "QNAP TS-109/TS-209" | "QNAP TS-119/TS-219")
+ qcontrol statusled greenon || true
+ qcontrol powerled on || true
+ if [ "$SOUND_BUZZER" != no ]; then
+ qcontrol buzzer short || true
+ fi
+ ;;
+ "QNAP TS-409" | "QNAP TS-41x")
+ qcontrol statusled greenon || true
+ if [ "$SOUND_BUZZER" != no ]; then
+ qcontrol buzzer short || true
+ fi
+ ;;
+ *)
+ eerror "qcontrol error: device is not supported"
+ ;;
+ esac
+ start-stop-daemon --stop --quiet --pidfile /var/run/qcontrol.pid --name qcontrol
+ rm /var/run/qcontrol.sock
+}
+
+stop() {
+ einfo "Shutting down system"
+ if [ ! -c /dev/input/by-path/platform-gpio-keys-event- ]; then
+ eerror "qcontrol error: gpio_keys device not available"
+ return 1
+ fi
+ start-stop-daemon --start --quiet --background --pidfile /var/run/qcontrol.pid --make-pidfile --exec /usr/sbin/qcontrol -- -d
+ # Change status led to show red
+ device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
+ head -n1 | sed "s/^[^:]*: //")
+ case $device in
+ "QNAP TS-109/TS-209" | "QNAP TS-119/TS-219")
+ qcontrol statusled rednon || true
+ qcontrol powerled 1hz || true
+ if [ "$SOUND_BUZZER" != no ]; then
+ qcontrol buzzer short || true
+ fi
+ ;;
+ "QNAP TS-409" | "QNAP TS-41x")
+ qcontrol statusled redon || true
+ if [ "$SOUND_BUZZER" != no ]; then
+ qcontrol buzzer short || true
+ fi
+ ;;
+ *)
+ eerror "qcontrol error: device is not supported"
+ ;;
+ esac
+ start-stop-daemon --stop --quiet --pidfile /var/run/qcontrol.pid --name qcontrol
+ rm /var/run/qcontrol.sock
+}