[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#694267: Updated debdiff



Unfortunately the previous version of the proposed update contained a
typo which meant the debian-installer aspect didn't work as expected.
I've now acquired some suitable hardware with this feature and have been
able to test more fully.

In the process I've also discovered that the TS-419P II also has a
watchdog.

I've uploaded 0.4.2+svn-r40-3 to unstable and have updated the backport
accordingly. New debdiff is attached.

Thanks,
Ian.

-- 
Ian Campbell
diff -u qcontrol-0.4.2/debian/rules qcontrol-0.4.2/debian/rules
--- qcontrol-0.4.2/debian/rules
+++ qcontrol-0.4.2/debian/rules
@@ -51,6 +51,10 @@
 			debian/$(PACKAGE)/etc/qcontrol; )
 	install -m0755 qcontrol.udeb \
 		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/
@@ -58,7 +62,6 @@
 		install -m0755 debian/udeb/$$(basename $(UDEB_DIR))/* \
 			debian/qcontrol-udeb/$(UDEB_DIR); )
 
-
 # Build architecture-independent files here.
 binary-indep: build install
 # We have nothing to do by default.
diff -u qcontrol-0.4.2/debian/qcontrol.postinst qcontrol-0.4.2/debian/qcontrol.postinst
--- qcontrol-0.4.2/debian/qcontrol.postinst
+++ qcontrol-0.4.2/debian/qcontrol.postinst
@@ -24,2 +24,10 @@
 
+case "$1" in
+    configure)
+        if [ -x /usr/sbin/update-initramfs ]; then
+            update-initramfs -u
+        fi
+    ;;
+esac
+
 #DEBHELPER#
diff -u qcontrol-0.4.2/debian/qcontrol.dirs qcontrol-0.4.2/debian/qcontrol.dirs
--- qcontrol-0.4.2/debian/qcontrol.dirs
+++ qcontrol-0.4.2/debian/qcontrol.dirs
@@ -3,0 +4,2 @@
+usr/share/initramfs-tools/hooks
+usr/share/initramfs-tools/scripts/init-bottom
diff -u qcontrol-0.4.2/debian/changelog qcontrol-0.4.2/debian/changelog
--- qcontrol-0.4.2/debian/changelog
+++ qcontrol-0.4.2/debian/changelog
@@ -1,3 +1,9 @@
+qcontrol (0.4.2-7+wheezy1) UNRELEASED; urgency=low
+
+  * Disable firmware watchdog on TS-219p II and TS-419p II. (Closes: #693263)
+
+ -- Ian Campbell <ijc@hellion.org.uk>  Sat, 17 Nov 2012 12:08:50 +0000
+
 qcontrol (0.4.2-7) unstable; urgency=medium
 
   * QA upload.
diff -u qcontrol-0.4.2/debian/patches/series qcontrol-0.4.2/debian/patches/series
--- qcontrol-0.4.2/debian/patches/series
+++ qcontrol-0.4.2/debian/patches/series
@@ -6,0 +7 @@
+watchdog.patch
diff -u qcontrol-0.4.2/debian/udeb/debian-installer-startup.d/S99qcontrol qcontrol-0.4.2/debian/udeb/debian-installer-startup.d/S99qcontrol
--- qcontrol-0.4.2/debian/udeb/debian-installer-startup.d/S99qcontrol
+++ qcontrol-0.4.2/debian/udeb/debian-installer-startup.d/S99qcontrol
@@ -1,16 +1,19 @@
 #! /bin/sh
 
 if qcommand -t; then
+	watchdog="no"
 	device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
 		 head -n1 | sed "s/^[^:]*: //")
 	case $device in
 	    "QNAP TS-109/TS-209")
 		mv /etc/qcontrol/ts209.lua /etc/qcontrol.conf ;;
 	    "QNAP TS-119/TS-219")
+		watchdog="yes"
 		mv /etc/qcontrol/ts219.lua /etc/qcontrol.conf ;;
 	    "QNAP TS-409")
 		mv /etc/qcontrol/ts409.lua /etc/qcontrol.conf ;;
 	    "QNAP TS-41x")
+		watchdog="yes"
 		mv /etc/qcontrol/ts41x.lua /etc/qcontrol.conf ;;
 	esac
 	rm -rf /etc/qcontrol/
@@ -18,6 +21,10 @@
 	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
only in patch2:
unchanged:
--- qcontrol-0.4.2.orig/debian/patches/watchdog.patch
+++ qcontrol-0.4.2/debian/patches/watchdog.patch
@@ -0,0 +1,76 @@
+Index: qcontrol/ts219.c
+===================================================================
+--- qcontrol.orig/ts219.c	2012-11-25 11:40:15.000000000 +0000
++++ qcontrol/ts219.c	2012-11-25 11:40:15.000000000 +0000
+@@ -303,6 +303,21 @@
+ 	return 0;
+ }
+ 
++static int ts219_wdt(int argc, const char **argv)
++{
++        char code = 0;
++
++        if (argc != 1)
++                return -1;
++        if (strcmp(argv[0], "off") == 0)
++                code = 0x67;
++        else
++                return -1;
++
++        return serial_write(&code, 1);
++        return 0;
++}
++
+ int ts219_init(int argc, const char **argv)
+ {
+ 	int err;
+@@ -348,6 +363,11 @@
+ 	                       "Control the automatic power mechanism, options are:\n"
+ 	                       "\ton\n\toff\n",
+ 	                       ts219_autopower);
++	err = register_command("watchdog",
++	                       "Disable the PIC watchdog",
++	                       "Watchdog options are:\n"
++	                       "\toff",
++	                       ts219_wdt);
+ 
+ 	return pthread_create(&ts219_thread, NULL, serial_poll, NULL);
+ }
+Index: qcontrol/ts41x.c
+===================================================================
+--- qcontrol.orig/ts41x.c	2012-11-25 11:40:15.000000000 +0000
++++ qcontrol/ts41x.c	2012-11-25 11:40:28.000000000 +0000
+@@ -303,6 +303,21 @@
+ 	return 0;
+ }
+ 
++static int ts41x_wdt(int argc, const char **argv)
++{
++        char code = 0;
++
++        if (argc != 1)
++                return -1;
++        if (strcmp(argv[0], "off") == 0)
++                code = 0x67;
++        else
++                return -1;
++
++        return serial_write(&code, 1);
++        return 0;
++}
++
+ int ts41x_init(int argc, const char **argv)
+ {
+ 	int err;
+@@ -348,6 +363,11 @@
+ 	                       "Control the automatic power mechanism, options are:\n"
+ 	                       "\ton\n\toff\n",
+ 	                       ts41x_autopower);
++	err = register_command("watchdog",
++	                       "Disable the PIC watchdog",
++	                       "Watchdog options are:\n"
++	                       "\toff",
++	                       ts41x_wdt);
+ 
+ 	return pthread_create(&ts41x_thread, NULL, serial_poll, NULL);
+ }
only in patch2:
unchanged:
--- qcontrol-0.4.2.orig/debian/initramfs/init-bottom
+++ qcontrol-0.4.2/debian/initramfs/init-bottom
@@ -0,0 +1,35 @@
+#!/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.
+device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
+	 head -n1 | sed "s/^[^:]*: //")
+case $device in
+    "QNAP TS-119/TS-219") break ;;
+    "QNAP TS-41x")        break ;;
+    *)                    exit 0 ;;
+esac
+
+if [ ! -x "/sbin/qcontrol" ]; then
+    exit 0
+fi
+
+/sbin/qcontrol --direct watchdog off || true
+
+exit 0
only in patch2:
unchanged:
--- qcontrol-0.4.2.orig/debian/initramfs/hook
+++ qcontrol-0.4.2/debian/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

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: