[OpenWrt-Devel] [PATCH] [packages] add triggerhappy hotkey daemon

2010-11-12 Thread Stefan Tomanek
Triggerhappy is a lightweight hotkey daemon that can launch arbitrary commands
on input events. It supports the hotplugging of devices and the processing of
key combinations.

Signed-off-by: Stefan Tomanek stefan.tomanek+open...@wertarbyte.de
---
 utils/triggerhappy/Makefile|   51 
 utils/triggerhappy/files/triggerhappy-example.conf |   14 +
 utils/triggerhappy/files/triggerhappy.hotplug  |   15 ++
 utils/triggerhappy/files/triggerhappy.init |   10 
 4 files changed, 90 insertions(+), 0 deletions(-)
 create mode 100644 utils/triggerhappy/Makefile
 create mode 100644 utils/triggerhappy/files/triggerhappy-example.conf
 create mode 100644 utils/triggerhappy/files/triggerhappy.hotplug
 create mode 100644 utils/triggerhappy/files/triggerhappy.init

diff --git a/utils/triggerhappy/Makefile b/utils/triggerhappy/Makefile
new file mode 100644
index 000..b3e122f
--- /dev/null
+++ b/utils/triggerhappy/Makefile
@@ -0,0 +1,51 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=triggerhappy
+PKG_VERSION:=0.1.3
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://github.com/wertarbyte/triggerhappy/tarball/release/
+PKG_MD5SUM:=7da137a7d2ba1ce396231e821e68de4e
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/wertarbyte-triggerhappy-f7c4216/
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/triggerhappy
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=handle input events and run configured programs
+  URL:=http://github.com/wertarbyte/triggerhappy
+endef
+
+define Package/triggerhappy/description
+   triggerhappy - handle input events and run configured programs
+   The daemon thd can handle hotplugged input devices and is configured 
through
+   simple configuration files in /etc/triggerhappy/triggers.d/.
+endef
+
+MAKE_FLAGS += \
+   $(TARGET_CONFIGURE_OPTS) \
+   $(1)
+
+define Package/triggerhappy/install
+   $(INSTALL_DIR) $(1)/usr/sbin
+   $(INSTALL_DIR) $(1)/etc
+   $(INSTALL_DIR) $(1)/etc/init.d
+   $(INSTALL_DIR) $(1)/etc/triggerhappy
+   $(INSTALL_DIR) $(1)/etc/triggerhappy/triggers.d/
+   $(INSTALL_DIR) $(1)/etc/hotplug.d/input/
+   $(INSTALL_BIN) $(PKG_BUILD_DIR)/thd $(1)/usr/sbin
+   $(INSTALL_BIN) $(PKG_BUILD_DIR)/th-cmd $(1)/usr/sbin
+   $(INSTALL_BIN) ./files/triggerhappy.init $(1)/etc/init.d/triggerhappy
+   $(INSTALL_BIN) ./files/triggerhappy.hotplug 
$(1)/etc/hotplug.d/input/10-triggerhappy
+   $(INSTALL_BIN) ./files/triggerhappy-example.conf 
$(1)/etc/triggerhappy/triggers.d/example.conf
+endef
+
+$(eval $(call BuildPackage,triggerhappy))
diff --git a/utils/triggerhappy/files/triggerhappy-example.conf 
b/utils/triggerhappy/files/triggerhappy-example.conf
new file mode 100644
index 000..3a8017a
--- /dev/null
+++ b/utils/triggerhappy/files/triggerhappy-example.conf
@@ -0,0 +1,14 @@
+# This is an example configuration for the triggerhappy daemon (thd)
+# please note that every file to be processed must end in .conf
+#
+# To view a list of supported event codes, use thd --listevents or
+# thd --dump /dev/input/event*
+#
+# Format:
+# eventcode value command
+#
+# values for key events are 1 (pressed), 0 (released) or 2 (held)
+#
+## control an mpd instance
+# KEY_NEXTSONG 1   /usr/bin/mpc next
+# KEY_PREVSONG 1   /usr/bin/mpc prev
diff --git a/utils/triggerhappy/files/triggerhappy.hotplug 
b/utils/triggerhappy/files/triggerhappy.hotplug
new file mode 100644
index 000..78ad349
--- /dev/null
+++ b/utils/triggerhappy/files/triggerhappy.hotplug
@@ -0,0 +1,15 @@
+#!/bin/sh
+THD_SOCKET=/tmp/triggerhappy.socket
+[ -S $THD_SOCKET ] || exit
+
+case $ACTION in
+   add)
+   DEVICE=/dev/$DEVNAME
+   [ -c $DEVICE ] || exit
+   # offer device to triggerhappy daemon
+   /usr/sbin/th-cmd --socket $THD_SOCKET --add $DEVICE
+   ;;
+remove)
+   # nothing to do
+   ;;
+esac
diff --git a/utils/triggerhappy/files/triggerhappy.init 
b/utils/triggerhappy/files/triggerhappy.init
new file mode 100644
index 000..e846d29
--- /dev/null
+++ b/utils/triggerhappy/files/triggerhappy.init
@@ -0,0 +1,10 @@
+#!/bin/sh /etc/rc.common
+START=93
+
+start() {
+   /usr/sbin/thd --socket /tmp/triggerhappy.socket --triggers 
/etc/triggerhappy/triggers.d/ --daemon /dev/input/event*
+}
+
+stop() {
+   /usr/sbin/th-cmd --socket /tmp/triggerhappy.socket --quit
+}
-- 
1.7.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [packages] add triggerhappy hotkey daemon

2010-11-12 Thread Stefan Tomanek
Dies schrieb Stefan Tomanek (stefan.tomanek+open...@wertarbyte.de):

 Triggerhappy is a lightweight hotkey daemon that can launch arbitrary commands
 on input events. It supports the hotplugging of devices and the processing of
 key combinations.

Any suggestions regarding this patch? I'm not sure if I got the format right, 
however
I'd really like to see that piece of software included in the package system.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] Remove obsolete patches

2010-11-12 Thread Guillaume LECERF
Signed-off-by: Guillaume LECERF glec...@gmail.com
---
 .../014-cfi_show_amd_extended_table_version.patch  |   30 
 .../014-cfi_show_amd_extended_table_version.patch  |   30 
 2 files changed, 0 insertions(+), 60 deletions(-)
 delete mode 100644 
target/linux/generic/patches-2.6.36/014-cfi_show_amd_extended_table_version.patch
 delete mode 100644 
target/linux/generic/patches-2.6.37/014-cfi_show_amd_extended_table_version.patch

diff --git 
a/target/linux/generic/patches-2.6.36/014-cfi_show_amd_extended_table_version.patch
 
b/target/linux/generic/patches-2.6.36/014-cfi_show_amd_extended_table_version.patch
deleted file mode 100644
index 55a6c2e..000
--- 
a/target/linux/generic/patches-2.6.36/014-cfi_show_amd_extended_table_version.patch
+++ /dev/null
@@ -1,30 +0,0 @@
 a/drivers/mtd/chips/cfi_cmdset_0002.c
-+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
-@@ -371,6 +371,8 @@ static struct cfi_fixup fixup_table[] =
- static void cfi_fixup_major_minor(struct cfi_private *cfi,
- struct cfi_pri_amdstd *extp)
- {
-+  // manufacturers defined in include/linux/mtd/cfi.h
-+
-   if (cfi-mfr == CFI_MFR_SAMSUNG  cfi-id == 0x257e 
-   extp-MajorVersion == '0')
-   extp-MajorVersion = '1';
-@@ -403,6 +405,9 @@ struct mtd_info *cfi_cmdset_0002(struct
- 
-   mtd-reboot_notifier.notifier_call = cfi_amdstd_reboot;
- 
-+  printk( CFI mfr 0x%08x\n, cfi-mfr);  // TODO: Is there a more 
general place to print this info?
-+  printk( CFI id  0x%08x\n, cfi-id);
-+
-   if (cfi-cfi_mode==CFI_MODE_CFI){
-   unsigned char bootloc;
-   __u16 adr = primary?cfi-cfiq-P_ADR:cfi-cfiq-A_ADR;
-@@ -420,7 +425,7 @@ struct mtd_info *cfi_cmdset_0002(struct
-* Valid primary extension versions are: 1.0, 1.1, 1.2, 
1.3, 1.4
-* see: 
http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_r20.pdf, 
page 19
-*  
http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_100_20011201.pdf
--   *  
http://www.spansion.com/Support/Datasheets/s29ws-p_00_a12_e.pdf
-+   *  
http://www.spansion.com/Support/AppNotes/CFI_Spec_AN_03.pdf
-*/
-   if (extp-MajorVersion != '1' ||
-   (extp-MajorVersion == '1'  (extp-MinorVersion  
'0' || extp-MinorVersion  '4'))) {
diff --git 
a/target/linux/generic/patches-2.6.37/014-cfi_show_amd_extended_table_version.patch
 
b/target/linux/generic/patches-2.6.37/014-cfi_show_amd_extended_table_version.patch
deleted file mode 100644
index 6da34f7..000
--- 
a/target/linux/generic/patches-2.6.37/014-cfi_show_amd_extended_table_version.patch
+++ /dev/null
@@ -1,30 +0,0 @@
 a/drivers/mtd/chips/cfi_cmdset_0002.c
-+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
-@@ -392,6 +392,8 @@ static struct cfi_fixup fixup_table[] =
- static void cfi_fixup_major_minor(struct cfi_private *cfi,
- struct cfi_pri_amdstd *extp)
- {
-+  // manufacturers defined in include/linux/mtd/cfi.h
-+
-   if (cfi-mfr == CFI_MFR_SAMSUNG  cfi-id == 0x257e 
-   extp-MajorVersion == '0')
-   extp-MajorVersion = '1';
-@@ -431,6 +433,9 @@ struct mtd_info *cfi_cmdset_0002(struct
- 
-   mtd-reboot_notifier.notifier_call = cfi_amdstd_reboot;
- 
-+  printk( CFI mfr 0x%08x\n, cfi-mfr);  // TODO: Is there a more 
general place to print this info?
-+  printk( CFI id  0x%08x\n, cfi-id);
-+
-   if (cfi-cfi_mode==CFI_MODE_CFI){
-   unsigned char bootloc;
-   __u16 adr = primary?cfi-cfiq-P_ADR:cfi-cfiq-A_ADR;
-@@ -448,7 +453,7 @@ struct mtd_info *cfi_cmdset_0002(struct
-* Valid primary extension versions are: 1.0, 1.1, 1.2, 
1.3, 1.4
-* see: 
http://cs.ozerki.net/zap/pub/axim-x5/docs/cfi_r20.pdf, page 19 
-*  
http://www.spansion.com/Support/AppNotes/cfi_100_20011201.pdf
--   *  
http://www.spansion.com/Support/Datasheets/s29ws-p_00_a12_e.pdf
-+   *  
http://www.spansion.com/Support/AppNotes/CFI_Spec_AN_03.pdf
-*/
-   if (extp-MajorVersion != '1' ||
-   (extp-MajorVersion == '1'  (extp-MinorVersion  
'0' || extp-MinorVersion  '4'))) {

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Remove obsolete patches

2010-11-12 Thread Matthias Buecher / Germany
Generic 014 is also something I'm currently working on, and it is not
really obsolete.
The printk() definitely helps to identify hardware, especially not
supported one.
The other changes help developers to find the correct spots for
enhancements.

You may remove the blocks with the comments, but the prints should be
left in.

Maddes

On 12.11.2010 18:14, Guillaume LECERF wrote:
 Signed-off-by: Guillaume LECERF glec...@gmail.com
 ---
  .../014-cfi_show_amd_extended_table_version.patch  |   30 
 
  .../014-cfi_show_amd_extended_table_version.patch  |   30 
 
  2 files changed, 0 insertions(+), 60 deletions(-)
  delete mode 100644 
 target/linux/generic/patches-2.6.36/014-cfi_show_amd_extended_table_version.patch
  delete mode 100644 
 target/linux/generic/patches-2.6.37/014-cfi_show_amd_extended_table_version.patch
 
 diff --git 
 a/target/linux/generic/patches-2.6.36/014-cfi_show_amd_extended_table_version.patch
  
 b/target/linux/generic/patches-2.6.36/014-cfi_show_amd_extended_table_version.patch
 deleted file mode 100644
 index 55a6c2e..000
 --- 
 a/target/linux/generic/patches-2.6.36/014-cfi_show_amd_extended_table_version.patch
 +++ /dev/null
 @@ -1,30 +0,0 @@
  a/drivers/mtd/chips/cfi_cmdset_0002.c
 -+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
 -@@ -371,6 +371,8 @@ static struct cfi_fixup fixup_table[] =
 - static void cfi_fixup_major_minor(struct cfi_private *cfi,
 -   struct cfi_pri_amdstd *extp)
 - {
 -+// manufacturers defined in include/linux/mtd/cfi.h
 -+
 - if (cfi-mfr == CFI_MFR_SAMSUNG  cfi-id == 0x257e 
 - extp-MajorVersion == '0')
 - extp-MajorVersion = '1';
 -@@ -403,6 +405,9 @@ struct mtd_info *cfi_cmdset_0002(struct
 - 
 - mtd-reboot_notifier.notifier_call = cfi_amdstd_reboot;
 - 
 -+printk( CFI mfr 0x%08x\n, cfi-mfr);  // TODO: Is there a more 
 general place to print this info?
 -+printk( CFI id  0x%08x\n, cfi-id);
 -+
 - if (cfi-cfi_mode==CFI_MODE_CFI){
 - unsigned char bootloc;
 - __u16 adr = primary?cfi-cfiq-P_ADR:cfi-cfiq-A_ADR;
 -@@ -420,7 +425,7 @@ struct mtd_info *cfi_cmdset_0002(struct
 -  * Valid primary extension versions are: 1.0, 1.1, 1.2, 
 1.3, 1.4
 -  * see: 
 http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_r20.pdf, 
 page 19
 -  *  
 http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_100_20011201.pdf
 -- *  
 http://www.spansion.com/Support/Datasheets/s29ws-p_00_a12_e.pdf
 -+ *  
 http://www.spansion.com/Support/AppNotes/CFI_Spec_AN_03.pdf
 -  */
 - if (extp-MajorVersion != '1' ||
 - (extp-MajorVersion == '1'  (extp-MinorVersion  
 '0' || extp-MinorVersion  '4'))) {
 diff --git 
 a/target/linux/generic/patches-2.6.37/014-cfi_show_amd_extended_table_version.patch
  
 b/target/linux/generic/patches-2.6.37/014-cfi_show_amd_extended_table_version.patch
 deleted file mode 100644
 index 6da34f7..000
 --- 
 a/target/linux/generic/patches-2.6.37/014-cfi_show_amd_extended_table_version.patch
 +++ /dev/null
 @@ -1,30 +0,0 @@
  a/drivers/mtd/chips/cfi_cmdset_0002.c
 -+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
 -@@ -392,6 +392,8 @@ static struct cfi_fixup fixup_table[] =
 - static void cfi_fixup_major_minor(struct cfi_private *cfi,
 -   struct cfi_pri_amdstd *extp)
 - {
 -+// manufacturers defined in include/linux/mtd/cfi.h
 -+
 - if (cfi-mfr == CFI_MFR_SAMSUNG  cfi-id == 0x257e 
 - extp-MajorVersion == '0')
 - extp-MajorVersion = '1';
 -@@ -431,6 +433,9 @@ struct mtd_info *cfi_cmdset_0002(struct
 - 
 - mtd-reboot_notifier.notifier_call = cfi_amdstd_reboot;
 - 
 -+printk( CFI mfr 0x%08x\n, cfi-mfr);  // TODO: Is there a more 
 general place to print this info?
 -+printk( CFI id  0x%08x\n, cfi-id);
 -+
 - if (cfi-cfi_mode==CFI_MODE_CFI){
 - unsigned char bootloc;
 - __u16 adr = primary?cfi-cfiq-P_ADR:cfi-cfiq-A_ADR;
 -@@ -448,7 +453,7 @@ struct mtd_info *cfi_cmdset_0002(struct
 -  * Valid primary extension versions are: 1.0, 1.1, 1.2, 
 1.3, 1.4
 -  * see: 
 http://cs.ozerki.net/zap/pub/axim-x5/docs/cfi_r20.pdf, page 19 
 -  *  
 http://www.spansion.com/Support/AppNotes/cfi_100_20011201.pdf
 -- *  
 http://www.spansion.com/Support/Datasheets/s29ws-p_00_a12_e.pdf
 -+ *  
 http://www.spansion.com/Support/AppNotes/CFI_Spec_AN_03.pdf
 -  */
 - if (extp-MajorVersion != '1' ||
 - (extp-MajorVersion == '1'  (extp-MinorVersion  
 '0' || extp-MinorVersion  '4'))) {
 
 ___
 openwrt-devel mailing list
 

[OpenWrt-Devel] [PATCH] Fix typo in name of to be included file

2010-11-12 Thread mark . vels
From: Mark Vels mark.v...@team-embedded.nl

This typo fix solves at least the following warning:
sysinit: WARNING: /lib/functions/fsck not found
but probably also some functionality that uses the functions
from this include file.

Signed-off-by: Mark Vels mark.v...@team-embedded.nl
---
 package/block-mount/files/fsck.sh |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/package/block-mount/files/fsck.sh 
b/package/block-mount/files/fsck.sh
index 3011160..047bdd3 100644
--- a/package/block-mount/files/fsck.sh
+++ b/package/block-mount/files/fsck.sh
@@ -30,5 +30,5 @@ libmount_fsck() {
 
 libmount_known_fsck=
 
-pi_include /lib/functions/fsck
+pi_include /lib/functions/fsck.sh
 
-- 
1.7.0.4

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Remove obsolete patches

2010-11-12 Thread Guillaume LECERF
2010/11/12 Matthias Buecher / Germany m...@maddes.net:
 Generic 014 is also something I'm currently working on, and it is not
 really obsolete.
 The printk() definitely helps to identify hardware, especially not
 supported one.
 The other changes help developers to find the correct spots for
 enhancements.

 You may remove the blocks with the comments, but the prints should be
 left in.

I already pushed the printk upstream, at a more generic place, i.e. in
cfi_probe.c :: cfi_chip_setup() :

http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.36.y.git;a=commitdiff;h=771a115a6df06c45cf783e24c3f1f08b3e9aac4c

-- 
Guillaume LECERF
GeeXboX developer - www.geexbox.org
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Remove obsolete patches

2010-11-12 Thread Matthias Buecher / Germany
On 12.11.2010 21:33, Guillaume LECERF wrote:
 2010/11/12 Matthias Buecher / Germany m...@maddes.net:
 Generic 014 is also something I'm currently working on, and it is not
 really obsolete.
 The printk() definitely helps to identify hardware, especially not
 supported one.
 The other changes help developers to find the correct spots for
 enhancements.

 You may remove the blocks with the comments, but the prints should be
 left in.
 
 I already pushed the printk upstream, at a more generic place, i.e. in
 cfi_probe.c :: cfi_chip_setup() :
 
 http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.36.y.git;a=commitdiff;h=771a115a6df06c45cf783e24c3f1f08b3e9aac4c
 

Sorry, didn't see that yet. Then generic 014 is obsolete starting from
2.6.36.
Although the additional comments help when developing, especially the
link from 014 points directly to the 1.4 definition instead of a device
description.

Thanks
Maddes
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel