On Sat, 2012-12-29 at 14:48 +0000, Martin Michlmayr wrote:
> * Ian Campbell <i...@hellion.org.uk> [2012-12-29 14:20]:
> > qcommand is probably right thing to use even in the Sid version,
> 
> I believe qcommand only exists in the udeb, so this won't work.
> Might be better to backport --direct instead.

This turned out to be relatively simple, thanks for the hint.

Hanno,

Could you try the packages at
http://www.hellion.org.uk/tmp/2012-12/qcontrol-0.4.2-7+wheezy2/ please.
It works in my limited testing.

sha256sums of everything:
c3f8e68429e4d8a37977bdd2c1e64224d1903b87573fe3a20582f6f4cea42ba1  
qcontrol_0.4.2-7+wheezy2_armel.deb
d9ca6bd57baf60b8bd9e78cb65a2d9e7796cbb894103c12f6609aca9d7d7c793  
qcontrol_0.4.2-7+wheezy2.diff.gz
c9e81241ab98bf28b62e8b42b4ecf2537ad59e3ede4abd9e374ccf6331d5b1ae  
qcontrol_0.4.2-7+wheezy2.dsc
efe7311cdd460a51475d22f737540e7bb3c4303e5eba97b782d765c8f1e67055  
qcontrol_0.4.2.orig.tar.gz
c7285db78aef1c0ed1346e2b100fd4cb8ae4a8d696f1e453974b132e37f1c089  
qcontrol-udeb_0.4.2-7+wheezy2_armel.udeb

Ian.

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,10 @@
+qcontrol (0.4.2-7+wheezy2) UNRELEASED; urgency=low
+
+  * Backport --direct support. This is needed to disable firmware watchdog from
+    initramfs. (Closes: #693263)
+
+ -- Ian Campbell <i...@hellion.org.uk>  Sat, 29 Dec 2012 15:09:07 +0000
+
 qcontrol (0.4.2-7+wheezy1) testing; urgency=low
 
   * Disable firmware watchdog on TS-219p II and TS-419p II. (Closes: #693263)
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
@@ -7,0 +8 @@
+direct.patch
diff -u qcontrol-0.4.2/debian/udeb/qcommand qcontrol-0.4.2/debian/udeb/qcommand
--- qcontrol-0.4.2/debian/udeb/qcommand
+++ qcontrol-0.4.2/debian/udeb/qcommand
@@ -15,29 +15,6 @@
        [ "$1" = "-t" ] && exit 1 || exit 0 ;;
 esac
 
-# qcontrol should not be running already; silently exit
-[ -z "$(pidof qcontrol)" ] || exit 0
-
-SOCKET=/var/run/qcontrol.sock
-
-qcontrol_start() {
-       rm -f $SOCKET
-       qcontrol -d >/dev/null &
-       # allow time to startup (read config)
-       sleep 1
-       pid=$(pidof qcontrol)
-
-       if [ "$pid" ]; then
-               if [ -S $SOCKET ]; then
-                       echo $pid
-                       return 0
-               else
-                       kill -TERM $pid
-               fi
-       fi
-       return 1
-}
-
 # The gpio_keys character device is required with the default
 # Debian configuration file.
 test_event_dev() {
@@ -53,12 +30,7 @@
 
 test_event_dev || exit 0
-if pid=$(qcontrol_start); then
-       # Returns 1 even on success
-       qcontrol "$@" || true
 
-       # Kill the control process
-       kill -TERM $pid
-       rm -f $SOCKET
-fi
+# Returns 1 even on success (TODO: is that still true?)
+qcontrol --direct "$@" || true
 
 exit 0
only in patch2:
unchanged:
--- qcontrol-0.4.2.orig/debian/patches/direct.patch
+++ qcontrol-0.4.2/debian/patches/direct.patch
@@ -0,0 +1,15 @@
+Index: qcontrol/qcontrol.c
+===================================================================
+--- qcontrol.orig/qcontrol.c   2012-12-29 15:07:43.000000000 +0000
++++ qcontrol/qcontrol.c        2012-12-29 15:09:49.000000000 +0000
+@@ -440,6 +440,10 @@
+               /* Startup in daemon mode */
+               pic_lua_setup(&lua);
+               return network_listen();
++      } else if (argc > 2 && strcmp(argv[1], "--direct") == 0) {
++              /* Execute a single command and terminate */
++              pic_lua_setup(&lua);
++              return run_command(argv[2], argc - 3, argv + 3);
+       } else if (argc > 1) {
+               /* Send the command to the server */
+               return network_send(argc - 1, argv + 1);

-- 
Ian Campbell


To the systems programmer, users and applications serve only to provide a
test load.

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

Reply via email to