Your message dated Sat, 14 Nov 2009 13:02:07 +0000
with message-id <[email protected]>
and subject line Bug#556206: fixed in qcontrol 0.4.2-4
has caused the Debian Bug report #556206,
regarding Please add QNAP TS-41x support
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
556206: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=556206
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: qcontrol
Version: 0.4.2-3
Severity: wishlist

Frans, would you be ok with including this patch to add support for
QNAP TS-41x (TS-410, TS-410U, TS-419P and TS-419U)?  I'll work with
Byron to get this upstream.

diff -urN 1/debian/configs/ts41x.lua qcontrol-0.4.2/debian/configs/ts41x.lua
--- 1/debian/configs/ts41x.lua  1970-01-01 01:00:00.000000000 +0100
+++ qcontrol-0.4.2/debian/configs/ts41x.lua     2009-11-14 10:29:55.000000000 
+0000
@@ -0,0 +1,39 @@
+--[[
+       Debian configuration file for qcontrol (LUA syntax)
+       Supports QNAP TS-409.
+--]]
+
+register("ts41x")
+
+-- Requires CONFIG_KEYBOARD_GPIO enabled in the kernel and
+-- the kernel module gpio_keys to be loaded.
+register("evdev", "/dev/input/by-path/platform-gpio-keys-event",
+       408, "restart_button",
+       133, "media_button")
+
+function power_button( time )
+       os.execute("poweroff")
+end
+
+function restart_button( time )
+       os.execute("reboot")
+end
+
+function media_button( time )
+       piccmd("usbled", "8hz")
+end
+
+--[[
+       Fan and temperature control are left disabled until qcontrol
+       gets a proper daemon mode.
+       Empty functions are needed to avoid errors.
+--]]
+function fan_error(  )
+end
+
+function fan_normal(  )
+end
+
+function temp( temp )
+       print("ts41x temperature:", temp)
+end
diff -urN 1/debian/control qcontrol-0.4.2/debian/control
--- 1/debian/control    2009-11-14 10:18:59.000000000 +0000
+++ qcontrol-0.4.2/debian/control       2009-11-14 10:28:06.000000000 +0000
@@ -20,7 +20,7 @@
  configuration file.
  .
  Supported devices at this time are the QNAP TS-109, TS-119, TS-209
- TS-219, TS-409 and TS-409U.
+ TS-219, TS-409, TS-409U, TS-410, TS-410U, TS-419P and TS-419U
  but the code is extensible so more devices may be added in future
  releases.
  .
diff -urN 1/debian/init.d qcontrol-0.4.2/debian/init.d
--- 1/debian/init.d     2009-11-14 10:18:59.000000000 +0000
+++ qcontrol-0.4.2/debian/init.d        2009-11-14 10:29:15.000000000 +0000
@@ -8,7 +8,7 @@
 # Should-Stop:       
 # Default-Start:     2 3 4 5
 # Default-Stop:      0 6
-# Short-Description: Change status leds for QNAP 
TS-109/TS-119/TS-209/TS-219/TS-409
+# 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
@@ -86,7 +86,7 @@
                        rm -f $SOCKET
                fi
                ;;
-           "QNAP TS-409")
+           "QNAP TS-409" | "QNAP TS-41x")
                test_event_dev || exit 0
                if pid=$(qcontrol_start); then
                        log_action_msg "System boot completed"
@@ -127,7 +127,7 @@
                        rm -f $SOCKET
                fi
                ;;
-           "QNAP TS-409")
+           "QNAP TS-409" | "QNAP TS-41x")
                test_event_dev || exit 0
                if pid=$(qcontrol_start); then
                        log_action_msg "Preparing for shutdown"
diff -urN 1/debian/patches/005_Add_support_for_ts-41x.patch 
qcontrol-0.4.2/debian/patches/005_Add_support_for_ts-41x.patch
--- 1/debian/patches/005_Add_support_for_ts-41x.patch   1970-01-01 
01:00:00.000000000 +0100
+++ qcontrol-0.4.2/debian/patches/005_Add_support_for_ts-41x.patch      
2009-11-14 10:24:46.000000000 +0000
@@ -0,0 +1,398 @@
+diff -urN 1/Makefile qcontrol-0.4.2/Makefile
+--- a/Makefile 2009-11-14 10:18:59.000000000 +0000
++++ b/Makefile 2009-11-14 10:19:39.000000000 +0000
+@@ -1,7 +1,7 @@
+ CFLAGS=-Os -Wall -I /usr/include/lua5.1
+ LDFLAGS=-llua5.1 -lpthread
+ LDFLAGS_UDEB=-lpthread -lm -ldl
+-SOURCES=qcontrol.c ts209.c ts219.c ts409.c evdev.c
++SOURCES=qcontrol.c ts209.c ts219.c ts409.c ts41x.c evdev.c
+ OBJECTS=$(SOURCES:.c=.o)
+ EXECUTABLE=qcontrol
+ 
+diff -urN 1/qcontrol.c qcontrol-0.4.2/qcontrol.c
+--- a/qcontrol.c       2009-11-14 10:18:59.000000000 +0000
++++ b/qcontrol.c       2009-11-14 10:19:58.000000000 +0000
+@@ -56,12 +56,14 @@
+ extern struct picmodule ts209_module;
+ extern struct picmodule ts219_module;
+ extern struct picmodule ts409_module;
++extern struct picmodule ts41x_module;
+ extern struct picmodule evdev_module;
+ 
+ struct picmodule *modules[] = {
+       &ts209_module,
+       &ts219_module,
+       &ts409_module,
++      &ts41x_module,
+       &evdev_module,
+       NULL
+ };
+diff -urN 1/ts41x.c qcontrol-0.4.2/ts41x.c
+--- a/ts41x.c  1970-01-01 01:00:00.000000000 +0100
++++ b/ts41x.c  2009-11-14 10:20:22.000000000 +0000
+@@ -0,0 +1,364 @@
++/*
++ * Copyright (C) 2007-2008  Byron Bradley ([email protected])
++ * Copyright (C) 2008, 2009  Martin Michlmayr ([email protected])
++ *
++ * This program 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 program 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 program.  If not, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <fcntl.h>
++#include <lua.h>
++#include <lualib.h>
++#include <lauxlib.h>
++#include <pthread.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <termios.h>
++#include <unistd.h>
++#include <linux/input.h>
++
++#include "picmodule.h"
++
++static int serial;
++static struct termios oldtio, newtio;
++static pthread_t ts41x_thread;
++
++static int serial_read(char *buf, int len)
++{
++      int err;
++
++      err = read(serial, buf, len);
++      buf[err] = 0;
++
++      return err;
++}
++
++static int serial_write(char *buf, int len)
++{
++      int err;
++
++      err = write(serial, buf, len);
++
++      return err;
++}
++
++int ts41x_read_serial_events()
++{
++      char buf[100];
++      int err = serial_read(buf, 100);
++      if (err < 0)
++              return err;
++      switch (buf[0]) {
++      case 0x40:
++              call_function("power_button", "%d", 3);
++              break;
++      case 0x73:
++      case 0x75:
++      case 0x77:
++      case 0x79:
++              call_function("fan_error", "");
++              break;
++      case 0x74:
++      case 0x76:
++      case 0x78:
++      case 0x7a:
++              call_function("fan_normal", "");
++              break;
++      case 0x80 ... 0x8f: /*  0 - 15 */
++      case 0x90 ... 0x9f: /* 16 - 31 */
++      case 0xa0 ... 0xaf: /* 32 - 47 */
++      case 0xb0 ... 0xbf: /* 48 - 63 */
++      case 0xc0 ... 0xc6: /* 64 - 70 */
++              call_function("temp", "%d", buf[0] - 128);
++              break;
++      case 0x38: /* 71 - 79 */
++              call_function("temp", "%d", 75);
++              break;
++      case 0x39: /* 80 or higher */
++              call_function("temp", "%d", 80);
++              break;
++      default:
++              fprintf(stderr, "(PIC 0x%x) unknown command from PIC\n", 
buf[0]);
++      }
++
++      return -1;
++}
++
++static void *serial_poll(void *tmp)
++{
++      int err;
++      fd_set rset;
++
++      FD_ZERO(&rset);
++      FD_SET(serial, &rset);
++
++      for (;;) {
++              err = select(serial + 1, &rset, NULL, NULL, NULL);
++              if (err <= 0) {
++                      FD_SET(serial, &rset);
++                      continue;
++              }
++              ts41x_read_serial_events();
++              FD_SET(serial, &rset);
++      }
++
++      return NULL;
++}
++
++static int set_nonblock(int fd)
++{
++      int flags = fcntl(fd, F_GETFL, 0);
++      if (flags < 0)
++              flags = 0;
++      return fcntl(fd, F_SETFL, flags | O_NONBLOCK);
++}
++
++static int serial_open(char *device)
++{
++      char buf[100];
++      int err;
++
++      if ((serial = open(device , O_RDWR)) < 0) {
++              sprintf(buf, "Failed to open %s", device);
++              perror(buf);
++              return -1;
++      }
++      err = set_nonblock(serial);
++      if (err < 0) {
++              perror("Error setting nonblock");
++              return -1;
++      }
++
++      tcgetattr(serial, &oldtio);
++      memset(&newtio, 0, sizeof(newtio));
++
++      newtio.c_iflag |= IGNBRK;
++      newtio.c_lflag &= ~(ISIG | ICANON | ECHO);
++      newtio.c_cflag = B19200 | CS8 | CLOCAL | CREAD;
++      newtio.c_cc[VMIN] = 1;
++      newtio.c_cc[VTIME] = 0;
++      cfsetospeed(&newtio, B19200);
++      cfsetispeed(&newtio, B19200);
++
++      err = tcsetattr(serial, TCSANOW, &newtio);
++      if (err < 0) {
++              sprintf(buf, "Failed to set attributes for %s", device);
++              perror(buf);
++              return -1;
++      }
++
++      return 0;
++}
++
++static void serial_close()
++{
++      tcsetattr(serial, TCSANOW, &oldtio);
++      close(serial);
++}
++
++static int ts41x_powerled(int argc, const char **argv)
++{
++      char code = 0;
++
++      if (argc != 1)
++              return -1;
++
++      if (strcmp(argv[0], "on") == 0)
++              code = 0x4d;
++      else if (strcmp(argv[0], "1hz") == 0)
++              code = 0x4e;
++      else if (strcmp(argv[0], "2hz") == 0)
++              code = 0x4c;
++      else if (strcmp(argv[0], "off") == 0)
++              code = 0x4b;
++      else
++              return -1;
++
++      return serial_write(&code, 1);
++      return 0;
++}
++
++static int ts41x_statusled(int argc, const char **argv)
++{
++      char code = 0;
++
++      if (argc != 1)
++              return -1;
++
++      if (strcmp(argv[0], "red2hz") == 0)
++              code = 0x54;
++      else if (strcmp(argv[0], "green2hz") == 0)
++              code = 0x55;
++      else if (strcmp(argv[0], "greenon") == 0)
++              code = 0x56;
++      else if (strcmp(argv[0], "redon") == 0)
++              code = 0x57;
++      else if (strcmp(argv[0], "greenred2hz") == 0)
++              code = 0x58;
++      else if (strcmp(argv[0], "off") == 0)
++              code = 0x59;
++      else if (strcmp(argv[0], "green1hz") == 0)
++              code = 0x5a;
++      else if (strcmp(argv[0], "red1hz") == 0)
++              code = 0x5b;
++      else if (strcmp(argv[0], "greenred1hz") == 0)
++              code = 0x5c;
++      else
++              return -1;
++
++      return serial_write(&code, 1);
++      return 0;
++}
++
++static int ts41x_buzz(int argc, const char **argv)
++{
++      char code = 0;
++
++      if (argc != 1)
++              return -1;
++
++      if (strcmp(argv[0], "short") == 0)
++              code = 0x50;
++      else if (strcmp(argv[0], "long") == 0)
++              code = 0x51;
++      else
++              return -1;
++
++      return serial_write(&code, 1);
++      return 0;
++}
++
++static int ts41x_fanspeed(int argc, const char **argv)
++{
++      char code = 0;
++
++      if (argc != 1)
++              return -1;
++
++      if (strcmp(argv[0], "stop") == 0)
++              code = 0x30;
++      else if (strcmp(argv[0], "silence") == 0)
++              code = 0x31;
++      else if (strcmp(argv[0], "low") == 0)
++              code = 0x32;
++      else if (strcmp(argv[0], "medium") == 0)
++              code = 0x33;
++      else if (strcmp(argv[0], "high") == 0)
++              code = 0x34;
++      else if (strcmp(argv[0], "full") == 0)
++              code = 0x35;
++      else
++              return -1;
++
++      return serial_write(&code, 1);
++      return 0;
++}
++
++static int ts41x_usbled(int argc, const char **argv)
++{
++      char code = 0;
++
++      if (argc != 1)
++              return -1;
++
++      if (strcmp(argv[0], "on") == 0)
++              code = 0x60;
++      else if (strcmp(argv[0], "8hz") == 0)
++              code = 0x61;
++      else if (strcmp(argv[0], "off") == 0)
++              code = 0x62;
++      else
++              return -1;
++
++      return serial_write(&code, 1);
++      return 0;
++}
++
++static int ts41x_autopower(int argc, const char **argv)
++{
++      char code = 0;
++
++      if (argc != 1)
++              return -1;
++
++      if (strcmp(argv[0], "on") == 0)
++              code = 0x48;
++      else if (strcmp(argv[0], "off") == 0)
++              code = 0x49;
++      else
++              return -1;
++
++      return serial_write(&code, 1);
++      return 0;
++}
++
++int ts41x_init(int argc, const char **argv)
++{
++      int err;
++
++      if (argc > 0) {
++              printf("%s: module does not take any arguments\n", __func__);
++              return -1;
++      }
++
++      err = serial_open("/dev/ttyS1");
++      if (err < 0)
++              return err;
++
++      err = register_command("statusled",
++                             "Change the status LED",
++                             "Change the status LED, options are:\n"
++                             "\tred2hz\n\tgreen2hz\n\tgreenon\n\tredon\n"
++                             "\tgreenred2hz\n\toff\n\tgreen1hz\n\tred1hz\n",
++                             ts41x_statusled);
++      err = register_command("powerled",
++                             "Change the power LED",
++                             "Change the power LED, options are:\n"
++                             "\ton\n\toff\n\t1hz\n\t2hz\n",
++                             ts41x_powerled);
++      err = register_command("buzzer",
++                             "Buzz",
++                             "Buzz, options are:\n"
++                             "\tshort\n\tlong\n",
++                             ts41x_buzz);
++      err = register_command("fanspeed",
++                             "Set the fanspeed",
++                             "Set the fanspeed, options are:\n"
++                             "\tstop\n\tsilence\n\tlow\n\tmedium\n"
++                             "\thigh\n\tfull\n",
++                             ts41x_fanspeed);
++      err = register_command("usbled",
++                             "Set the usbled",
++                             "Set the usbled, options are:\n"
++                             "\ton\n\t8hz\n\toff\n",
++                             ts41x_usbled);
++      err = register_command("autopower",
++                             "Control the automatic power mechanism",
++                             "Control the automatic power mechanism, options 
are:\n"
++                             "\ton\n\toff\n",
++                             ts41x_autopower);
++
++      return pthread_create(&ts41x_thread, NULL, serial_poll, NULL);
++}
++
++void ts41x_exit(void)
++{
++      serial_close();
++}
++
++struct picmodule ts41x_module = {
++      .name           = "ts41x",
++      .init           = ts41x_init,
++      .exit           = ts41x_exit,
++};
diff -urN 1/debian/patches/series qcontrol-0.4.2/debian/patches/series
--- 1/debian/patches/series     2009-11-14 10:18:59.000000000 +0000
+++ qcontrol-0.4.2/debian/patches/series        2009-11-14 10:25:23.000000000 
+0000
@@ -2,3 +2,4 @@
 002_Update_config_values_for_restart_and_media_buttons.patch
 003_Add_support_for_ts-119.patch
 004_Support_autopower_feature.patch
+005_Add_support_for_ts-41x.patch
diff -urN 1/debian/qcontrol.1 qcontrol-0.4.2/debian/qcontrol.1
--- 1/debian/qcontrol.1 2009-11-14 10:18:59.000000000 +0000
+++ qcontrol-0.4.2/debian/qcontrol.1    2009-11-14 10:28:46.000000000 +0000
@@ -19,8 +19,9 @@
 control a device.
 .PP
 Currently supported devices are the QNAP TS-109, QNAP TS-119, QNAP TS-209,
-QNAP TS-219, QNAP TS-409 and QNAP TS-409U, but support for additional
-devices may be added in future releases.
+QNAP TS-219, QNAP TS-409, QNAP TS-409U, QNAP TS-410, QNAP TS-410U, QNAP
+TS-419P and QNAP TS-419U but support for additional devices may be added
+in future releases.
 
 .SH BASIC USAGE
 First a control process needs to be started that opens a socket through
diff -urN 1/debian/qcontrol.postinst qcontrol-0.4.2/debian/qcontrol.postinst
--- 1/debian/qcontrol.postinst  2009-11-14 10:18:59.000000000 +0000
+++ qcontrol-0.4.2/debian/qcontrol.postinst     2009-11-14 10:26:57.000000000 
+0000
@@ -11,6 +11,8 @@
                ln -s qcontrol/ts219.lua /etc/qcontrol.conf ;;
            "QNAP TS-409")
                ln -s qcontrol/ts409.lua /etc/qcontrol.conf ;;
+           "QNAP TS-41x")
+               ln -s qcontrol/ts41x.lua /etc/qcontrol.conf ;;
        esac
 fi
 

-- 
Martin Michlmayr
http://www.cyrius.com/



--- End Message ---
--- Begin Message ---
Source: qcontrol
Source-Version: 0.4.2-4

We believe that the bug you reported is fixed in the latest version of
qcontrol, which is due to be installed in the Debian FTP archive:

qcontrol-udeb_0.4.2-4_armel.udeb
  to main/q/qcontrol/qcontrol-udeb_0.4.2-4_armel.udeb
qcontrol_0.4.2-4.diff.gz
  to main/q/qcontrol/qcontrol_0.4.2-4.diff.gz
qcontrol_0.4.2-4.dsc
  to main/q/qcontrol/qcontrol_0.4.2-4.dsc
qcontrol_0.4.2-4_armel.deb
  to main/q/qcontrol/qcontrol_0.4.2-4_armel.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Frans Pop <[email protected]> (supplier of updated qcontrol package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sat, 14 Nov 2009 13:35:41 +0100
Source: qcontrol
Binary: qcontrol qcontrol-udeb
Architecture: source armel
Version: 0.4.2-4
Distribution: unstable
Urgency: low
Maintainer: Frans Pop <[email protected]>
Changed-By: Frans Pop <[email protected]>
Description: 
 qcontrol   - hardware control for QNAP Turbo Station devices
 qcontrol-udeb - hardware control for QNAP Turbo Station devices (udeb)
Closes: 554796 556206 556210
Changes: 
 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.
Checksums-Sha1: 
 c8772fc01bf8525eab52ac7601d0c4941e09d374 1185 qcontrol_0.4.2-4.dsc
 7097911ebd01530f59a29a8669ac8e2b4d93ae00 11047 qcontrol_0.4.2-4.diff.gz
 595cb61bf82ca0394c138ef1a298fc1e55496b72 17992 qcontrol_0.4.2-4_armel.deb
 7d914b838a929c8471bd2cf5a57a2df046137c19 71924 qcontrol-udeb_0.4.2-4_armel.udeb
Checksums-Sha256: 
 a872dd38513d88adbb57e6143587ca076b638e6f74d1c69b50600aea4e1f7a06 1185 
qcontrol_0.4.2-4.dsc
 3e489361185b22cf02dc357c6896bb030c7bee0a1b96514950e5a2f2d564090c 11047 
qcontrol_0.4.2-4.diff.gz
 c3f55c752811b7d386876f273a9e2ad3b2a01de9069395b35cdf87a3916b3368 17992 
qcontrol_0.4.2-4_armel.deb
 e8b251a27da83b1125a95febb85ad83af493025163b255a2ca44966ac1fddb2b 71924 
qcontrol-udeb_0.4.2-4_armel.udeb
Files: 
 686136debefea267b6462c73769f9e27 1185 utils optional qcontrol_0.4.2-4.dsc
 ad6eed59a8577cf271f4806899109019 11047 utils optional qcontrol_0.4.2-4.diff.gz
 524846002e14cecf0eeefbead23ab768 17992 utils optional 
qcontrol_0.4.2-4_armel.deb
 8b2e6f41381fce5f8c247498656b83c7 71924 debian-installer optional 
qcontrol-udeb_0.4.2-4_armel.udeb
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkr+pioACgkQgm/Kwh6ICoRGNgCfTT6icv69I7QvV+BAEjJ1R3zm
V+4An1tVVvxDzdUsY7EhMpHcFlAHR50A
=mReR
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to