[OpenWrt-Devel] [PATCH] sysctl: read settings from /etc/sysctl.d/*.conf
This changes makes it possible to store custom settings in individual files inside the directory /etc/sysctl.d/, which take precedence over /etc/sysctl.conf. Signed-off-by: Stefan Tomanek --- package/base-files/files/etc/init.d/sysctl |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/package/base-files/files/etc/init.d/sysctl b/package/base-files/files/etc/init.d/sysctl index 36e29ea..2dfbaf7 100755 --- a/package/base-files/files/etc/init.d/sysctl +++ b/package/base-files/files/etc/init.d/sysctl @@ -3,5 +3,7 @@ START=11 start() { - [ -f /etc/sysctl.conf ] && sysctl -p -e >&- + for CONF in /etc/sysctl.conf /etc/sysctl.d/*.conf; do + [ -f "$CONF" ] && sysctl -p "$CONF" -e >&- + done } -- 1.7.2.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v2] sysctl: read settings from /etc/sysctl.d/*.conf
This changes makes it possible to store custom settings in individual files inside the directory /etc/sysctl.d/. Signed-off-by: Stefan Tomanek --- package/base-files/Makefile|2 ++ .../base-files/files/etc/hotplug.d/net/00-sysctl |9 ++--- package/base-files/files/etc/init.d/sysctl |4 +++- package/base-files/files/etc/sysctl.d/local.conf |1 + 4 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 package/base-files/files/etc/sysctl.d/local.conf diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 0bba313..a5f15fa 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -55,6 +55,8 @@ define Package/base-files/conffiles /etc/config/ /etc/dropbear/ /etc/crontabs/ +/etc/sysctl.d/local.conf +/etc/sysctl.d/ $(call $(TARGET)/conffiles) endef diff --git a/package/base-files/files/etc/hotplug.d/net/00-sysctl b/package/base-files/files/etc/hotplug.d/net/00-sysctl index 5d9da8a..7a71652 100644 --- a/package/base-files/files/etc/hotplug.d/net/00-sysctl +++ b/package/base-files/files/etc/hotplug.d/net/00-sysctl @@ -1,6 +1,9 @@ #!/bin/sh -if [ -f /etc/sysctl.conf ] && [ "$ACTION" = add ]; then - sed -ne "/^[[:space:]]*net\..*\.$DEVICENAME\./p" /etc/sysctl.conf | \ - sysctl -e -p - | logger -t sysctl +if [ "$ACTION" = add ]; then + for CONF in /etc/sysctl.conf /etc/sysctl.d/*.conf; do + [ ! -f "$CONF" ] && continue; + sed -ne "/^[[:space:]]*net\..*\.$DEVICENAME\./p" "$CONF" | \ + sysctl -e -p - | logger -t sysctl + done fi diff --git a/package/base-files/files/etc/init.d/sysctl b/package/base-files/files/etc/init.d/sysctl index 36e29ea..2dfbaf7 100755 --- a/package/base-files/files/etc/init.d/sysctl +++ b/package/base-files/files/etc/init.d/sysctl @@ -3,5 +3,7 @@ START=11 start() { - [ -f /etc/sysctl.conf ] && sysctl -p -e >&- + for CONF in /etc/sysctl.conf /etc/sysctl.d/*.conf; do + [ -f "$CONF" ] && sysctl -p "$CONF" -e >&- + done } diff --git a/package/base-files/files/etc/sysctl.d/local.conf b/package/base-files/files/etc/sysctl.d/local.conf new file mode 100644 index 000..891da73 --- /dev/null +++ b/package/base-files/files/etc/sysctl.d/local.conf @@ -0,0 +1 @@ +# local sysctl settings can be stored in this directory -- 1.7.2.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH v2] sysctl: read settings from /etc/sysctl.d/*.conf
Dies schrieb Stefan Tomanek (stefan.tomanek+open...@wertarbyte.de): > This changes makes it possible to store custom settings > in individual files inside the directory /etc/sysctl.d/. Anything new here? :-D ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] How to keep disabled services disabled after sysupgrade
Whenever I update my OpenWrt system using sysupgrade, unwanted services pop up; I am using one of my devices as a simple AP, so it must not start dnsmasq, odhcpd or the firewall service. Running sysupgrade however reinstates the links in /etc/rc.d/ removed by '/etc/init.d/foo disable'. I was thinking about an elegant way to change this behaviour and would like to request some feedback. 1) do not remove the link, but change it I tried patching rc.common to change the service link in /etc/rc.d/ to a new script /etc/init.d/DISABLED that just forwards any call to the real script - except the start instruction which is disabled. For example: After running '/etc/init.d/dnsmasq disable', /etc/rc.d/S60dnsmasq will still be present, but point toward ../init.d/DISABLED which defies service startup. While this all works, it doesn't help for sysupgrade purposes: the links in /etc/rc.d/ are replaced during a sysupgrade. 2) add some flag file for disabled services I also thought about adding a flagfile like /etc/disable/dnsmasq that get's checked in /etc/rc.common before running the start command; this however would prevent the manual startup of a service that is still possible with option 1). Can anyone supply any different ideas or provide some feedback? ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] How to keep disabled services disabled after sysupgrade
Dies schrieb Bastian Bittorf (bitt...@bluebottle.com): > > Can anyone supply any different ideas or provide some feedback? > > maybe: disabled services are stored during sysupgrade in > e.g. /lib/upgrade/keep.d/services_disabled > > and this file will be read line by line during firstboot/uci-defaults > (and services diabled again) and the file is then deleted. Yes, I was thinking in that direction as well - however, /lib/upgrade/keep.d/ seems to contain file locations that should be kept during an upgrade; is there a safe place where temporary data can be stashed during a sysupgrade? I'd like to save the list of installed packages as well, since remembering what packages were installed is often a kind of PITA. At the moment, I am using these commands, but I'd like to see something like that integrated into sysupgrade as well: opkg list_installed > /etc/installed_packages sysupgrade -c .. opkg update opkg install $(awk '{print $1}' /etc/installed_packages} ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] hostapd: Add client association log file
This change adds the configuration option "assoc_log_file" to hostapd, making it possible to specify a log file to which clients joining and parting the corresponding BSS are written. Every BSS can have an individual log file, and each entry written contains a timestamp, an indicator whether the client is associating (+) or disassociating (-), the client and the bss hardware addresses as well as the device and SSID identifiers of the affected network. This makes it easy to join the file with the leases database of an DHCP server like dnsmasq. To use a logfile with OpenWrt, simply add an assoc_log_file entry to the wireless network: config wifi-iface option device 'radio1' option network 'hotspot' option ssid 'MyNetwork' option mode 'ap' option encryption 'none' option assoc_log_file '/tmp/assoc_log-hotspot' Signed-off-by: Stefan Tomanek --- package/network/services/hostapd/files/netifd.sh |7 +- ...rite-client-dis-associations-to-a-logfile.patch | 231 2 files changed, 237 insertions(+), 1 deletions(-) create mode 100644 package/network/services/hostapd/patches/720-Write-client-dis-associations-to-a-logfile.patch diff --git a/package/network/services/hostapd/files/netifd.sh b/package/network/services/hostapd/files/netifd.sh index ed2a631..be94398 100644 --- a/package/network/services/hostapd/files/netifd.sh +++ b/package/network/services/hostapd/files/netifd.sh @@ -159,6 +159,8 @@ hostapd_common_add_bss_config() { config_add_int mcast_rate config_add_array basic_rate config_add_array supported_rates + + config_add_string assoc_log_file } hostapd_set_bss_options() { @@ -177,7 +179,7 @@ hostapd_set_bss_options() { wps_pushbutton wps_label ext_registrar wps_pbc_in_m1 \ wps_device_type wps_device_name wps_manufacturer wps_pin \ macfilter ssid wmm uapsd hidden short_preamble rsn_preauth \ - iapp_interface + iapp_interface assoc_log_file set_default isolate 0 set_default maxassoc 0 @@ -189,6 +191,9 @@ hostapd_set_bss_options() { set_default uapsd 1 append bss_conf "ctrl_interface=/var/run/hostapd" + if [ "$assoc_log_file" ]; then + append bss_conf "assoc_log_file=$assoc_log_file" "$N" + fi if [ "$isolate" -gt 0 ]; then append bss_conf "ap_isolate=$isolate" "$N" fi diff --git a/package/network/services/hostapd/patches/720-Write-client-dis-associations-to-a-logfile.patch b/package/network/services/hostapd/patches/720-Write-client-dis-associations-to-a-logfile.patch new file mode 100644 index 000..7a87529 --- /dev/null +++ b/package/network/services/hostapd/patches/720-Write-client-dis-associations-to-a-logfile.patch @@ -0,0 +1,231 @@ +Write client (dis)associations to a logfile + +This change adds the configuration option "assoc_log_file" to hostapd, making +it possible to specify a log file to which clients joining and parting the +corresponding BSS are written. + +Every BSS can have an individual log file, and each entry written contains a +timestamp, an indicator whether the client is associating (+) or disassociating +(-), the client and the bss hardware addresses as well as the device and SSID +identifiers of the affected network. This makes it easy to join the file with +the leases database of an DHCP server like dnsmasq. +--- + hostapd/config_file.c | 3 +++ + hostapd/hostapd.conf | 3 +++ + hostapd/main.c| 6 ++ + src/ap/ap_config.c| 27 +++ + src/ap/ap_config.h| 5 + + src/ap/ap_mlme.c | 26 ++ + src/ap/hostapd.c | 4 + src/ap/hostapd.h | 2 ++ + 8 files changed, 76 insertions(+) + +diff --git a/hostapd/config_file.c b/hostapd/config_file.c +index ddebf1f..827f9b4 100644 +--- a/hostapd/config_file.c b/hostapd/config_file.c +@@ -1876,6 +1876,9 @@ static int hostapd_config_fill(struct hostapd_config *conf, + bss->logger_syslog = atoi(pos); + } else if (os_strcmp(buf, "logger_stdout") == 0) { + bss->logger_stdout = atoi(pos); ++ } else if (os_strcmp(buf, "assoc_log_file") == 0) { ++ os_free(bss->assoc_log_file); ++ bss->assoc_log_file = os_strdup(pos); + } else if (os_strcmp(buf, "dump_file") == 0) { + wpa_printf(MSG_INFO, "Line %d: DEPRECATED: 'dump_file' configuration variable is not used anymore", + line); +diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf +index 2e6f841..31b2193 100644 +--- a/hostapd/hostapd.conf b/hostapd/hostapd.conf +@@ -51,6 +51,9 @@ logger_syslog_level=2 + l
[OpenWrt-Devel] [PATCH] hostapd: backport BSSID black/whitelists
This change adds the configuration options "bssid_whitelist" and "bssid_blacklist" used to limit the AP selection of a network to a specified (finite) set or discard certain APs. This can be useful for environments where multiple networks operate using the same SSID and roaming between those is not desired. It is also useful to ignore a faulty or otherwise unwanted AP. In many applications it is useful not just to enumerate a group of well known access points, but to use a address/mask notation to match an entire set of addresses (ca:ff:ee:00:00:00/ff:ff:ff:00:00:00). This is especially useful if an OpenWrt device with two radios is used to retransmit the same network (one in AP mode for other clients, one as STA for the uplink); the following configuration prevents the device from associating with itself, given that the own AP to be avoided is using the bssid 'C0:FF:EE:D0:0D:42': config wifi-iface option device 'radio2' option network 'uplink' option mode 'sta' option ssid 'MyNetwork' option encryption 'none' list bssid_blacklist 'C0:FF:EE:D0:0D:42/00:FF:FF:FF:FF:FF' This change consists of the following cherry-picked upstream commits: b3d6a0a8259002448a29f14855d58fe0a624ab76 b83e455451a875ba233b3b8ac29aff8b62f064f2 79cd993a623e101952b81fa6a29c674cd858504f (squashed to implement bssid_{white,black}lists) 0047306bc9ab7d46e8cc22ff9a3e876c47626473 (Add os_snprintf_error() helper) Signed-off-by: Stefan Tomanek --- package/network/services/hostapd/files/netifd.sh |9 + .../patches/700-Add-os_snprintf_error-helper.patch | 29 + ...work-specific-BSSID-black-and-white-lists.patch | 649 3 files changed, 687 insertions(+), 0 deletions(-) create mode 100644 package/network/services/hostapd/patches/700-Add-os_snprintf_error-helper.patch create mode 100644 package/network/services/hostapd/patches/710-Add-network-specific-BSSID-black-and-white-lists.patch diff --git a/package/network/services/hostapd/files/netifd.sh b/package/network/services/hostapd/files/netifd.sh index d625709..ed2a631 100644 --- a/package/network/services/hostapd/files/netifd.sh +++ b/package/network/services/hostapd/files/netifd.sh @@ -153,6 +153,9 @@ hostapd_common_add_bss_config() { config_add_string macfilter 'macfile:file' config_add_array 'maclist:list(macaddr)' + config_add_array bssid_blacklist + config_add_array bssid_whitelist + config_add_int mcast_rate config_add_array basic_rate config_add_array supported_rates @@ -580,6 +583,12 @@ wpa_supplicant_add_network() { [ -n "$bssid" ] && append network_data "bssid=$bssid" "$N$T" [ -n "$beacon_int" ] && append network_data "beacon_int=$beacon_int" "$N$T" + local bssid_blacklist bssid_whitelist + json_get_values bssid_blacklist bssid_blacklist + json_get_values bssid_whitelist bssid_whitelist + + [ -n "$bssid_blacklist" ] && append network_data "bssid_blacklist=$bssid_blacklist" "$N$T" + [ -n "$bssid_whitelist" ] && append network_data "bssid_whitelist=$bssid_whitelist" "$N$T" [ -n "$basic_rate" ] && { local br rate_list= diff --git a/package/network/services/hostapd/patches/700-Add-os_snprintf_error-helper.patch b/package/network/services/hostapd/patches/700-Add-os_snprintf_error-helper.patch new file mode 100644 index 000..51ad1c4 --- /dev/null +++ b/package/network/services/hostapd/patches/700-Add-os_snprintf_error-helper.patch @@ -0,0 +1,29 @@ +Add os_snprintf_error() helper + +This can be used to check os_snprintf() return value more consistently. + +Signed-off-by: Jouni Malinen +--- + src/utils/os.h | 6 ++ + 1 file changed, 6 insertions(+) + +diff --git a/src/utils/os.h b/src/utils/os.h +index b9247d8..77250d6 100644 +--- a/src/utils/os.h b/src/utils/os.h +@@ -549,6 +549,12 @@ char * os_strdup(const char *s); + #endif /* OS_NO_C_LIB_DEFINES */ + + ++static inline int os_snprintf_error(size_t size, int res) ++{ ++ return res < 0 || (unsigned int) res >= size; ++} ++ ++ + static inline void * os_realloc_array(void *ptr, size_t nmemb, size_t size) + { + if (size && nmemb > (~(size_t) 0) / size) +-- +2.1.3 + diff --git a/package/network/services/hostapd/patches/710-Add-network-specific-BSSID-black-and-white-lists.patch b/package/network/services/hostapd/patches/710-Add-network-specific-BSSID-black-and-white-lists.patch new file mode 100644 index 000..5b42158 --- /dev/null +++ b/package/network/services/hostapd/patches/710-Add-network-specific-BSSID-black-and-white-lists.patch @@ -0,0 +1,649 @@ +Add network specific BSSID black and wh
Re: [OpenWrt-Devel] [PATCH] hostapd: backport BSSID black/whitelists
Dies schrieb Stefan Tomanek (stefan.tomanek+open...@wertarbyte.de): > This change adds the configuration options "bssid_whitelist" and > "bssid_blacklist" used to limit the AP selection of a network to a > specified (finite) set or discard certain APs. Any feedback regarding this backported feature? ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] hostapd: backport BSSID black/whitelists
Dies schrieb John Crispin (blo...@openwrt.org): > > Any feedback regarding this backported feature? > > this patch is fine, the log file one scares me though as there is no > log rotate logic. What kind of log rotate logic do you mean? That can be implemented externally if needed: just move the old logfile away and send SIGHUP to the hostapd process, to make it reopen (and recreate) the file. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] hostapd: backport BSSID black/whitelists
Dies schrieb Stefan Tomanek (stefan.tomanek+open...@wertarbyte.de): > > > Any feedback regarding this backported feature? > > > > this patch is fine, the log file one scares me though as there is no > > log rotate logic. > > What kind of log rotate logic do you mean? That can be implemented externally > if needed: just move the old logfile away and send SIGHUP to the hostapd > process, to make it reopen (and recreate) the file. Any more feedback regarding both patches? ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] hostapd: backport BSSID black/whitelists
Dies schrieb John Crispin (blo...@openwrt.org): > > Any more feedback regarding both patches? > > still on my todo, sorry for the delay it'll take a few more days till i > can go over all the hostapd patches in the queue. Nevermind, I just wanted to make sure that it didn't slide off the table :-) ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] dnsmasq: Make parameters optional in dhcpboot config
The --dhcp-boot option of dnsmasq does not require servername and serveraddress arguments if the builtin tftp server is used. Signed-off-by: Stefan Tomanek --- .../network/services/dnsmasq/files/dnsmasq.init|7 +++ 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 40ec584..fb118d5 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -364,12 +364,11 @@ dhcp_boot_add() { [ -n "$filename" ] || return 0 config_get servername "$cfg" servername - [ -n "$servername" ] || return 0 - config_get serveraddress "$cfg" serveraddress - [ -n "$serveraddress" ] || return 0 - xappend "--dhcp-boot=${networkid:+net:$networkid,}$filename,$servername,$serveraddress" + [ -n "$serveraddress" -a ! -n "$servername" ] && return 0 + + xappend "--dhcp-boot=${networkid:+net:$networkid,}${filename}${servername:+,$servername}${serveraddress:+,$serveraddress}" config_get_bool force "$cfg" force 0 -- 1.7.2.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] [dnsmasq] add --tftp-no-fail to ignore missing tftp root
This patch introduces the option --tftp-no-fail to dnsmasq and prevents the service from aborting if the specified TFTP root directory is not available; this might be the case if TFTP files are located on external media that might occasionally not be present at startup. Signed-off-by: Stefan Tomanek --- .../network/services/dnsmasq/files/dnsmasq.init|1 + ...-tftp-no-fail-to-ignore-missing-tftp-root.patch | 103 2 files changed, 104 insertions(+), 0 deletions(-) create mode 100644 package/network/services/dnsmasq/patches/120-add-tftp-no-fail-to-ignore-missing-tftp-root.patch diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 2e7fb7b..9795d1a 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -128,6 +128,7 @@ dnsmasq() { append_bool "$cfg" boguspriv "--bogus-priv" append_bool "$cfg" expandhosts "--expand-hosts" append_bool "$cfg" enable_tftp "--enable-tftp" + append_bool "$cfg" tftp_no_fail "--tftp-no-fail" append_bool "$cfg" nonwildcard "--bind-interfaces" append_bool "$cfg" fqdn "--dhcp-fqdn" append_bool "$cfg" proxydnssec "--proxy-dnssec" diff --git a/package/network/services/dnsmasq/patches/120-add-tftp-no-fail-to-ignore-missing-tftp-root.patch b/package/network/services/dnsmasq/patches/120-add-tftp-no-fail-to-ignore-missing-tftp-root.patch new file mode 100644 index 000..9a2a94a --- /dev/null +++ b/package/network/services/dnsmasq/patches/120-add-tftp-no-fail-to-ignore-missing-tftp-root.patch @@ -0,0 +1,103 @@ +From 859e01b56ca9aa1e3a871bfd4db1e372f1a7302d Mon Sep 17 00:00:00 2001 +From: Stefan Tomanek +Date: Mon, 30 Mar 2015 22:58:10 +0200 +Subject: [PATCH] add --tftp-no-fail to ignore missing tftp root + +This change makes dnsmasq ignore any missing TFTP root directories +if --tftp-no-fail is specified; this is useful for router devices +that store TFTP data on an external storage that might not always +be present. +--- + src/dnsmasq.c | 24 ++-- + src/dnsmasq.h | 3 ++- + src/option.c | 3 +++ + 3 files changed, 23 insertions(+), 7 deletions(-) + +diff --git a/src/dnsmasq.c b/src/dnsmasq.c +index 5c7750d..71e101d 100644 +--- a/src/dnsmasq.c b/src/dnsmasq.c +@@ -632,20 +632,32 @@ int main (int argc, char **argv) + { + if (!((dir = opendir(daemon->tftp_prefix + { +-send_event(err_pipe[1], EVENT_TFTP_ERR, errno, daemon->tftp_prefix); +-_exit(0); ++if (! option_bool(OPT_TFTP_NO_FAIL)) ++ { ++send_event(err_pipe[1], EVENT_TFTP_ERR, errno, daemon->tftp_prefix); ++_exit(0); ++ } ++else ++ my_syslog(LOG_WARNING, _("warning: TFTP directory '%s' inaccessible"), daemon->tftp_prefix); + } +-closedir(dir); ++else ++ closedir(dir); + } + + for (p = daemon->if_prefix; p; p = p->next) + { + if (!((dir = opendir(p->prefix + { +- send_event(err_pipe[1], EVENT_TFTP_ERR, errno, p->prefix); +- _exit(0); ++if (! option_bool(OPT_TFTP_NO_FAIL)) ++ { ++send_event(err_pipe[1], EVENT_TFTP_ERR, errno, p->prefix); ++_exit(0); ++ } ++else ++ my_syslog(LOG_WARNING, _("warning: TFTP directory '%s' inaccessible"), p->prefix); + } +-closedir(dir); ++else ++ closedir(dir); + } + } + #endif +diff --git a/src/dnsmasq.h b/src/dnsmasq.h +index 1dd61c5..8e0d352 100644 +--- a/src/dnsmasq.h b/src/dnsmasq.h +@@ -238,7 +238,8 @@ struct event_desc { + #define OPT_DNSSEC_NO_SIGN 48 + #define OPT_LOCAL_SERVICE 49 + #define OPT_LOOP_DETECT50 +-#define OPT_LAST 51 ++#define OPT_TFTP_NO_FAIL 51 ++#define OPT_LAST 52 + + /* extra flags for my_syslog, we use a couple of facilities since they are known +not to occupy the same bits as priorities, no matter how syslog.h is set up. */ +diff --git a/src/option.c b/src/option.c +index 209fa69..fa5e4d3 100644 +--- a/src/option.c b/src/option.c +@@ -147,6 +147,7 @@ struct myoption { + #define LOPT_LOCAL_SERVICE 335 + #define LOPT_DNSSEC_TIME 336 + #define LOPT_LOOP_DETECT 337 ++#define LOPT_TFTP_NO_FAIL 338 + + #ifdef HAVE_GETOPT_LONG + static const struct option opts[] = +@@ -227,6 +228,7 @@ static const struct myoption opts[] = + { "dhcp-ignore-names", 2, 0, LOPT_NO_NAMES }, + { "enable-tftp", 2, 0, LOPT_TFTP }, + { "tftp-secure", 0, 0, LOPT_SECURE }
[OpenWrt-Devel] [Patch v2] [dnsmasq] backport --tftp-no-fail to ignore missing tftp root
This patch backports the option --tftp-no-fail to dnsmasq and prevents the service from aborting if the specified TFTP root directory is not available; this might be the case if TFTP files are located on external media that might occasionally not be present at startup. Signed-off-by: Stefan Tomanek --- .../network/services/dnsmasq/files/dnsmasq.init|1 + ...-tftp-no-fail-to-ignore-missing-tftp-root.patch | 193 2 files changed, 194 insertions(+), 0 deletions(-) create mode 100644 package/network/services/dnsmasq/patches/120-add-tftp-no-fail-to-ignore-missing-tftp-root.patch diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 2e7fb7b..9795d1a 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -128,6 +128,7 @@ dnsmasq() { append_bool "$cfg" boguspriv "--bogus-priv" append_bool "$cfg" expandhosts "--expand-hosts" append_bool "$cfg" enable_tftp "--enable-tftp" + append_bool "$cfg" tftp_no_fail "--tftp-no-fail" append_bool "$cfg" nonwildcard "--bind-interfaces" append_bool "$cfg" fqdn "--dhcp-fqdn" append_bool "$cfg" proxydnssec "--proxy-dnssec" diff --git a/package/network/services/dnsmasq/patches/120-add-tftp-no-fail-to-ignore-missing-tftp-root.patch b/package/network/services/dnsmasq/patches/120-add-tftp-no-fail-to-ignore-missing-tftp-root.patch new file mode 100644 index 000..c85e4e6 --- /dev/null +++ b/package/network/services/dnsmasq/patches/120-add-tftp-no-fail-to-ignore-missing-tftp-root.patch @@ -0,0 +1,193 @@ +From 56920681eaf2c5eb08fc75baee4939d15d03b0ea Mon Sep 17 00:00:00 2001 +From: Stefan Tomanek +Date: Tue, 31 Mar 2015 22:32:11 +0100 +Subject: [PATCH] add --tftp-no-fail to ignore missing tftp root + +(cherry picked from commit 30d0879ed55cb67b1b735beab3d93f3bb3ef1dd2) + +Conflicts: + CHANGELOG + src/dnsmasq.c + src/dnsmasq.h + src/option.c +--- + dnsmasq.conf.example | 3 +++ + man/dnsmasq.8| 3 +++ + src/dnsmasq.c| 42 +++--- + src/dnsmasq.h| 4 +++- + src/option.c | 3 +++ + 5 files changed, 43 insertions(+), 12 deletions(-) + +diff --git a/dnsmasq.conf.example b/dnsmasq.conf.example +index 1bd305d..67be99a 100644 +--- a/dnsmasq.conf.example b/dnsmasq.conf.example +@@ -486,6 +486,9 @@ + # Set the root directory for files available via FTP. + #tftp-root=/var/ftpd + ++# Do not abort if the tftp-root is unavailable ++#tftp-no-fail ++ + # Make the TFTP server more secure: with this set, only files owned by + # the user dnsmasq is running as will be send over the net. + #tftp-secure +diff --git a/man/dnsmasq.8 b/man/dnsmasq.8 +index 0b8e04f..2ff4b96 100644 +--- a/man/dnsmasq.8 b/man/dnsmasq.8 +@@ -1670,6 +1670,9 @@ Absolute paths (starting with /) are allowed, but they must be within + the tftp-root. If the optional interface argument is given, the + directory is only used for TFTP requests via that interface. + .TP ++.B --tftp-no-fail ++Do not abort startup if specified tftp root directories are inaccessible. ++.TP + .B --tftp-unique-root + Add the IP address of the TFTP client as a path component on the end + of the TFTP-root (in standard dotted-quad format). Only valid if a +diff --git a/src/dnsmasq.c b/src/dnsmasq.c +index 5c7750d..b6fa285 100644 +--- a/src/dnsmasq.c b/src/dnsmasq.c +@@ -58,6 +58,9 @@ int main (int argc, char **argv) + struct dhcp_context *context; + struct dhcp_relay *relay; + #endif ++#ifdef HAVE_TFTP ++ int tftp_prefix_missing = 0; ++#endif + + #ifdef LOCALEDIR + setlocale(LC_ALL, ""); +@@ -623,7 +626,7 @@ int main (int argc, char **argv) + #endif + + #ifdef HAVE_TFTP +- if (option_bool(OPT_TFTP)) ++ if (option_bool(OPT_TFTP)) + { + DIR *dir; + struct tftp_prefix *p; +@@ -632,24 +635,33 @@ int main (int argc, char **argv) + { + if (!((dir = opendir(daemon->tftp_prefix + { +-send_event(err_pipe[1], EVENT_TFTP_ERR, errno, daemon->tftp_prefix); +-_exit(0); ++tftp_prefix_missing = 1; ++if (!option_bool(OPT_TFTP_NO_FAIL)) ++ { ++send_event(err_pipe[1], EVENT_TFTP_ERR, errno, daemon->tftp_prefix); ++_exit(0); ++ } + } + closedir(dir); + } +- ++ + for (p = daemon->if_prefix; p; p = p->next) + { ++p->missing = 0; + if (!((dir = opendir(p->prefix +- { +- send_event(err_pipe[1], EVENT_TFTP_ERR, errno, p->prefix); +- _exit(0); +- } ++ { ++p->missin
[OpenWrt-Devel] Current trunk fails to compile: mtd-utils patches failing
Any idea why my trunk/git snapshot fails to compile? $ make [...] make[3]: Entering directory `/home/stefan/openwrt/openwrt/tools/mtd-utils' . /home/stefan/openwrt/openwrt/include/shell.sh; gzip -dc /home/stefan/openwrt/openwrt/dl/mtd-20101124.tar.gz | /bin/tar -C /home/stefan/openwrt/openwrt/build_dir/host/mtd-20101124/.. -xf - Applying ./patches/000-upstream_jffs2reader.patch using plaintext: patching file jffs2reader.c Hunk #1 FAILED at 77. Hunk #2 FAILED at 136. Hunk #3 FAILED at 163. Hunk #4 FAILED at 188. Hunk #5 FAILED at 208. Hunk #6 FAILED at 344. Hunk #7 FAILED at 379. Hunk #8 FAILED at 817. Hunk #9 FAILED at 848. Hunk #10 FAILED at 896. 10 out of 10 hunks FAILED -- saving rejects to file jffs2reader.c.rej Patch failed! Please fix ./patches/000-upstream_jffs2reader.patch! ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] update iptables to 1.4.12.1
--- package/iptables/Makefile |6 +- .../patches/010-multiport-linux-2.4-compat.patch | 265 package/iptables/patches/011-recent-add-reap.patch | 116 - .../patches/020-iptables-disable-modprobe.patch|8 +- package/iptables/patches/100-bash-location.patch | 12 +- 5 files changed, 9 insertions(+), 398 deletions(-) delete mode 100644 package/iptables/patches/010-multiport-linux-2.4-compat.patch delete mode 100644 package/iptables/patches/011-recent-add-reap.patch diff --git a/package/iptables/Makefile b/package/iptables/Makefile index 67dedca..7c7d466 100644 --- a/package/iptables/Makefile +++ b/package/iptables/Makefile @@ -9,10 +9,10 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=iptables -PKG_VERSION:=1.4.10 -PKG_RELEASE:=4 +PKG_VERSION:=1.4.12.1 +PKG_RELEASE:=1 -PKG_MD5SUM:=f382fe693f0b59d87bd47bea65eca198 +PKG_MD5SUM:=b08a1195ec2c1ebeaf072db3c55fdf43 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://www.netfilter.org/projects/iptables/files \ ftp://ftp.be.netfilter.org/pub/netfilter/iptables/ \ diff --git a/package/iptables/patches/010-multiport-linux-2.4-compat.patch b/package/iptables/patches/010-multiport-linux-2.4-compat.patch deleted file mode 100644 index 3b35f7e..000 --- a/package/iptables/patches/010-multiport-linux-2.4-compat.patch +++ /dev/null @@ -1,265 +0,0 @@ a/extensions/libxt_multiport.c -+++ b/extensions/libxt_multiport.c -@@ -15,21 +15,6 @@ - #include - - /* Function which prints out usage message. */ --static void multiport_help(void) --{ -- printf( --"multiport match options:\n" --" --source-ports port[,port,port...]\n" --" --sports ...\n" --" match source port(s)\n" --" --destination-ports port[,port,port...]\n" --" --dports ...\n" --" match destination port(s)\n" --" --ports port[,port,port]\n" --" match both source and destination port(s)\n" --" NOTE: this kernel does not support port ranges in multiport.\n"); --} -- - static void multiport_help_v1(void) - { - printf( -@@ -72,26 +57,6 @@ proto_to_name(u_int8_t proto) - } - } - --static unsigned int --parse_multi_ports(const char *portstring, u_int16_t *ports, const char *proto) --{ -- char *buffer, *cp, *next; -- unsigned int i; -- -- buffer = strdup(portstring); -- if (!buffer) xtables_error(OTHER_PROBLEM, "strdup failed"); -- -- for (cp=buffer, i=0; cp && idata; -- -- switch (c) { -- case '1': -- xtables_check_inverse(optarg, &invert, &optind, 0, argv); -- proto = check_proto(pnum, invflags); -- multiinfo->count = parse_multi_ports(optarg, -- multiinfo->ports, proto); -- multiinfo->flags = XT_MULTIPORT_SOURCE; -- break; -- -- case '2': -- xtables_check_inverse(optarg, &invert, &optind, 0, argv); -- proto = check_proto(pnum, invflags); -- multiinfo->count = parse_multi_ports(optarg, -- multiinfo->ports, proto); -- multiinfo->flags = XT_MULTIPORT_DESTINATION; -- break; -- -- case '3': -- xtables_check_inverse(optarg, &invert, &optind, 0, argv); -- proto = check_proto(pnum, invflags); -- multiinfo->count = parse_multi_ports(optarg, -- multiinfo->ports, proto); -- multiinfo->flags = XT_MULTIPORT_EITHER; -- break; -- -- default: -- return 0; -- } -- -- if (invert) -- xtables_error(PARAMETER_PROBLEM, -- "multiport does not support invert"); -- -- if (*flags) -- xtables_error(PARAMETER_PROBLEM, -- "multiport can only have one option"); -- *flags = 1; -- return 1; --} -- --static int --multiport_parse(int c, char **argv, int invert, unsigned int *flags, --const void *e, struct xt_entry_match **match) --{ -- const struct ipt_entry *entry = e; -- return __multiport_parse(c, argv, invert, flags, match, -- entry->ip.proto, entry->ip.invflags); --} -- --static int --multiport_parse6(int c, char **argv, int invert, unsigned int *flags, -- const void *e, struct xt_entry_match **match) --{ -- const struct ip6t_entry *entry = e; -- return __multiport_parse(c, argv, invert, flags, match, -- entry->ipv6.proto, entry->ipv6.invflags); --} -- --static int - __multiport_parse_v1(int c, char **argv, int invert, unsigned int *flags, - struct xt_entry_match **match, u_int16_t pnum, - u_int8_t invflags) -@@ -314,55 +212,6 @@ print_port(u_int16_t port, u_int8_t prot - } - - /* Prints out the
Re: [OpenWrt-Devel] [PATCH] update iptables to 1.4.12.1
Any news about updating iptables to a recent version? ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] dsniff: add patch to fix decoding of POP data
Signed-off-by: Stefan Tomanek --- net/dsniff/patches/001-decode_pop.patch | 122 +++ 1 files changed, 122 insertions(+), 0 deletions(-) create mode 100644 net/dsniff/patches/001-decode_pop.patch diff --git a/net/dsniff/patches/001-decode_pop.patch b/net/dsniff/patches/001-decode_pop.patch new file mode 100644 index 000..24e1a47 --- /dev/null +++ b/net/dsniff/patches/001-decode_pop.patch @@ -0,0 +1,122 @@ +diff --git a/decode_pop.c b/decode_pop.c +index 04044f5..767da41 100644 +--- a/decode_pop.c b/decode_pop.c +@@ -6,6 +6,8 @@ + * Copyright (c) 2000 Dug Song + * + * $Id: decode_pop.c,v 1.4 2001/03/15 08:33:02 dugsong Exp $ ++ * ++ * Rewritten by Stefan Tomanek 2011 + */ + + #include "config.h" +@@ -45,32 +47,88 @@ int + decode_pop(u_char *buf, int len, u_char *obuf, int olen) + { + char *p; ++ char *s; ++ int n; + int i, j; ++ char *user; ++ char *password; ++ enum { ++ NONE, ++ AUTHPLAIN, ++ AUTHLOGIN, ++ USERPASS ++ } mode = NONE; ++ + + obuf[0] = '\0'; + + for (p = strtok(buf, "\r\n"); p != NULL; p = strtok(NULL, "\r\n")) { +- if (strncasecmp(p, "AUTH PLAIN", 10) == 0 || +- strncasecmp(p, "AUTH LOGIN", 10) == 0) { +- strlcat(obuf, p, olen); +- strlcat(obuf, "\n", olen); +- +- /* Decode SASL auth. */ +- for (i = 0; i < 2 && (p = strtok(NULL, "\r\n")); i++) { +- strlcat(obuf, p, olen); +- j = base64_pton(p, p, strlen(p)); +- p[j] = '\0'; +- strlcat(obuf, " [", olen); +- strlcat(obuf, p, olen); +- strlcat(obuf, "]\n", olen); ++ if (mode == NONE) { ++ user = NULL; ++ password = NULL; ++ if (strncasecmp(p, "AUTH PLAIN", 10) == 0) { ++ mode = AUTHPLAIN; ++ continue; ++ } ++ if (strncasecmp(p, "AUTH LOGIN", 10) == 0) { ++ mode = AUTHLOGIN; ++ continue; ++ } ++ if (strncasecmp(p, "USER ", 5) == 0) { ++ mode = USERPASS; ++ /* the traditional login cuts right to the case, ++ * so no continue here ++ */ + } + } +- /* Save regular POP2, POP3 auth info. */ +- else if (strncasecmp(p, "USER ", 5) == 0 || +- strncasecmp(p, "PASS ", 5) == 0 || +- strncasecmp(p, "HELO ", 5) == 0) { +- strlcat(obuf, p, olen); +- strlcat(obuf, "\n", olen); ++ printf("(%d) %s\n", mode, p); ++ if (mode == USERPASS) { ++ if (strncasecmp(p, "USER ", 5) == 0) { ++ user = &p[5]; ++ } else if (strncasecmp(p, "PASS ", 5) == 0) { ++ password = &p[5]; ++ } ++ } ++ ++ if (mode == AUTHPLAIN) { ++ j = base64_pton(p, p, strlen(p)); ++ p[j] = '\0'; ++ n = 0; ++ s = p; ++ /* p consists of three parts, divided by \0 */ ++ while (s <= &p[j] && n<=3) { ++ if (n == 0) { ++ /* we do not process this portion yet */ ++ } else if (n == 1) { ++ user = s; ++ } else if (n == 2) { ++ password = s; ++ } ++ n++; ++ while (*s) s++; ++ s++; ++ } ++ } ++ ++ if (mode == AUTHLOGIN) { ++ j = base64_pton(p, p, strlen(p)); ++ p[j] = '\0'; ++ if (! user) { ++ user = p; ++ } else { ++ password = p; ++ /* got everything we need :-) */ ++ } ++ } +
[OpenWrt-Devel] [PATCH] add input subsystem to hotplug rules
This patch adds the input subsystem to the hotplug rules, making it possible to react on the addition of input devices (e.g. USB numpads). Signed-off-by: Stefan Tomanek --- package/hotplug2/files/hotplug2.rules |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/package/hotplug2/files/hotplug2.rules b/package/hotplug2/files/hotplug2.rules index e8847f2..9800658 100644 --- a/package/hotplug2/files/hotplug2.rules +++ b/package/hotplug2/files/hotplug2.rules @@ -1,6 +1,6 @@ $include /etc/hotplug2-common.rules -SUBSYSTEM ~~ (net|button|usb|platform|ieee1394|block|atm) { +SUBSYSTEM ~~ (net|input|button|usb|platform|ieee1394|block|atm) { exec /sbin/hotplug-call %SUBSYSTEM% } -- 1.7.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] [package] add triggerhappy hotkey daemon
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 --- utils/triggerhappy/Makefile| 49 utils/triggerhappy/files/triggerhappy-example.conf | 15 ++ utils/triggerhappy/files/triggerhappy.hotplug | 15 ++ utils/triggerhappy/files/triggerhappy.init | 10 4 files changed, 89 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..41092a6 --- /dev/null +++ b/utils/triggerhappy/Makefile @@ -0,0 +1,49 @@ +# +# 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:=execute commands when a key or switch is pressed, released or hold down + URL:=http://github.com/wertarbyte/triggerhappy +endef + +define Package/triggerhappy/description + triggerhappy - execute commands when a key or switched is pressed, or hold down +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..bcff574 --- /dev/null +++ b/utils/triggerhappy/files/triggerhappy-example.conf @@ -0,0 +1,15 @@ +# 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: +# +# +# 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
[OpenWrt-Devel] [PATCH] [packages] add triggerhappy hotkey daemon
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 --- 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: +# +# +# 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
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
Re: [OpenWrt-Devel] [PATCH] add input subsystem to hotplug rules
Dies schrieb Stefan Tomanek (stefan.tomanek+open...@wertarbyte.de): > This patch adds the input subsystem to the hotplug rules, making it possible > to > react on the addition of input devices (e.g. USB numpads). Any news about adding this small patch to the official repository? It shouldn't break anything and works fine on the systems I checked. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] add input subsystem to hotplug rules
Dies schrieb Jo-Philipp Wich (x...@subsignal.org): > Committed to trunk in r23994 and backfire in r23995 - thanks! Thank you, can you look into the addition of the triggerhappy package (<20101112101749.gs17...@zirkel.wertarbyte.de>) as well? It was the primary reason for introducing the additional hotplug handler. Greetings Stefan Tomanek ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] update triggerhappy package to version 0.1.4
--- utils/triggerhappy/Makefile |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/utils/triggerhappy/Makefile b/utils/triggerhappy/Makefile index 984708d..e9db1d9 100644 --- a/utils/triggerhappy/Makefile +++ b/utils/triggerhappy/Makefile @@ -6,8 +6,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=triggerhappy -PKG_VERSION:=0.1.3 -PKG_REV:=f7c42167127fb8377f99440f943ab863433b14b5 +PKG_VERSION:=0.1.4 +PKG_REV:=51b9c0906bbd73378a51ca0982bd4f8b6ca73b03 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz @@ -15,7 +15,6 @@ PKG_SOURCE_URL:=git://github.com/wertarbyte/triggerhappy PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_VERSION:=$(PKG_REV) -PKG_MD5SUM:=7da137a7d2ba1ce396231e821e68de4e include $(INCLUDE_DIR)/package.mk -- 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
Dies schrieb Xiangfu Liu (xiangf...@gmail.com): > -PKG_VERSION:=0.1.3 > -PKG_REV:=f7c42167127fb8377f99440f943ab863433b14b5 > +PKG_VERSION:=0.1.4 > +PKG_REV:=d5a041b18f010d4b1f4a33cfed00fcbe604e3a91 > PKG_RELEASE:=1 Due to some changes (and added features) this version is now designated 0.1.5, not 0.1.4 :-) ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] triggerhappy: update to 0.1.6
This patch upgrade the triggerhappy daemon to upstream version 0.1.6, which fixes several build and runtime issues. Signed-off-by: Stefan Tomanek --- utils/triggerhappy/Makefile |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/utils/triggerhappy/Makefile b/utils/triggerhappy/Makefile index 984708d..64deca9 100644 --- a/utils/triggerhappy/Makefile +++ b/utils/triggerhappy/Makefile @@ -6,8 +6,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=triggerhappy -PKG_VERSION:=0.1.3 -PKG_REV:=f7c42167127fb8377f99440f943ab863433b14b5 +PKG_VERSION:=0.1.6 +PKG_REV:=01bedc72451f8afd0c35649dd67c428c44a0f737 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz @@ -15,7 +15,6 @@ PKG_SOURCE_URL:=git://github.com/wertarbyte/triggerhappy PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_VERSION:=$(PKG_REV) -PKG_MD5SUM:=7da137a7d2ba1ce396231e821e68de4e include $(INCLUDE_DIR)/package.mk -- 1.7.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] triggerhappy: update to 0.1.6
Dies schrieb Florian Fainelli (flor...@openwrt.org): > I/home/florian/dev/openwrt/trunk/staging_dir/toolchain-mipsel_gcc-4.3.3+cs_uClibc-0.9.31/include > -c -o trigger.o trigger.c > make[3]: *** No rule to make target `evtable_EV.h', needed by `eventnames.o'. > Stop. I think the Makefile fails to locate ; to do this, the following command is run: echo '\#include ' | $(CC) $(CPPFLAGS) - M -E - | awk 'NR==1 {print $$2} Any idea why this might not yield the full path to the included file when run from the openwrt build system? ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] triggerhappy: update to 0.1.6
This patch upgrade the triggerhappy daemon to upstream version 0.1.6, which fixes several build and runtime issues. It also explicitly specifies the path to the header file which is needed during compilation. Signed-off-by: Stefan Tomanek --- utils/triggerhappy/Makefile |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/triggerhappy/Makefile b/utils/triggerhappy/Makefile index 984708d..a0bde02 100644 --- a/utils/triggerhappy/Makefile +++ b/utils/triggerhappy/Makefile @@ -6,8 +6,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=triggerhappy -PKG_VERSION:=0.1.3 -PKG_REV:=f7c42167127fb8377f99440f943ab863433b14b5 +PKG_VERSION:=0.1.6 +PKG_REV:=01bedc72451f8afd0c35649dd67c428c44a0f737 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz @@ -15,7 +15,6 @@ PKG_SOURCE_URL:=git://github.com/wertarbyte/triggerhappy PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_VERSION:=$(PKG_REV) -PKG_MD5SUM:=7da137a7d2ba1ce396231e821e68de4e include $(INCLUDE_DIR)/package.mk @@ -33,6 +32,7 @@ define Package/triggerhappy/description endef MAKE_FLAGS += \ + LINUX_INPUT_H=$(TOOLCHAIN_DIR)/include/linux/input.h \ $(TARGET_CONFIGURE_OPTS) \ $(1) -- 1.7.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] triggerhappy: update to 0.1.6
Dies schrieb Mirko Vogt (li...@nanl.de): > Committed in r24076, thanks. Thanks :) > Please attach patches as files next time, since inlining often screws > them up (in this case spaces <-> tabs). Although https://dev.openwrt.org/wiki/SubmittingPatches says otherwise? "Send a mail to openwrt-devel lists.openwrt.org with the following contents: [...] 4. Your actual patch, inline, not word wrapped or whitespace mangled. " ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] triggerhappy: update to 0.1.6
Dies schrieb Matthias Buecher / Germany (m...@maddes.net): > So if you are sure that the patch is not mangled by your mail client (no > wraps, no tabs to spaces), then inline is definitely preferred. > Maybe setting some options in your mail client will avoid this behaviour. Can you point me to the line where any mangling took place? I just checked the list reply of my own message, which looks completely fine to me, but when checking your reply, I noticed some tabs being replaced by spaces inside the quoted patch. I don't think mutt does any mangling, since the message itself is generated by "git format-patch" and sent as it is. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] [packages/triggerhappy] update Makefile for 0.2.2
Signed-off-by: Stefan Tomanek --- utils/triggerhappy/Makefile |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/triggerhappy/Makefile b/utils/triggerhappy/Makefile index a0bde02..724e91a 100644 --- a/utils/triggerhappy/Makefile +++ b/utils/triggerhappy/Makefile @@ -6,8 +6,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=triggerhappy -PKG_VERSION:=0.1.6 -PKG_REV:=01bedc72451f8afd0c35649dd67c428c44a0f737 +PKG_VERSION:=0.2.2 +PKG_REV:=08adbc415a901dff0f83f99ace5f710cac23e535 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -- 1.7.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] update package triggerhappy to version 0.3.0-1
Signed-off-by: Stefan Tomanek --- utils/triggerhappy/Makefile |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/triggerhappy/Makefile b/utils/triggerhappy/Makefile index a0bde02..23dc53b 100644 --- a/utils/triggerhappy/Makefile +++ b/utils/triggerhappy/Makefile @@ -6,8 +6,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=triggerhappy -PKG_VERSION:=0.1.6 -PKG_REV:=01bedc72451f8afd0c35649dd67c428c44a0f737 +PKG_VERSION:=0.3.0 +PKG_REV:=19f8b9ad3b33ee5f4c2c992caf0c794ac73fdc35 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -- 1.7.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] update package triggerhappy to version 0.3.0-1
Signed-off-by: Stefan Tomanek --- utils/triggerhappy/Makefile |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/triggerhappy/Makefile b/utils/triggerhappy/Makefile index b9569fd..c96b121 100644 --- a/utils/triggerhappy/Makefile +++ b/utils/triggerhappy/Makefile @@ -6,8 +6,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=triggerhappy -PKG_VERSION:=0.1.6 -PKG_REV:=01bedc72451f8afd0c35649dd67c428c44a0f737 +PKG_VERSION:=0.3.0 +PKG_REV:=19f8b9ad3b33ee5f4c2c992caf0c794ac73fdc35 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -- 1.7.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] update triggerhappy package to version 0.3.1-1
Signed-off-by: Stefan Tomanek --- utils/triggerhappy/Makefile |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/triggerhappy/Makefile b/utils/triggerhappy/Makefile index b9569fd..58b83b3 100644 --- a/utils/triggerhappy/Makefile +++ b/utils/triggerhappy/Makefile @@ -6,8 +6,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=triggerhappy -PKG_VERSION:=0.1.6 -PKG_REV:=01bedc72451f8afd0c35649dd67c428c44a0f737 +PKG_VERSION:=0.3.1 +PKG_REV:=168639e0c482ca1668e15c48aaa9ccef286c223a PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -- 1.7.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] update triggerhappy package to version 0.3.1-1
Dies schrieb Stefan Tomanek (stefan.tomanek+open...@wertarbyte.de): > Signed-off-by: Stefan Tomanek > --- > utils/triggerhappy/Makefile |4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/utils/triggerhappy/Makefile b/utils/triggerhappy/Makefile > index b9569fd..58b83b3 100644 > --- a/utils/triggerhappy/Makefile > +++ b/utils/triggerhappy/Makefile > @@ -6,8 +6,8 @@ > include $(TOPDIR)/rules.mk > > PKG_NAME:=triggerhappy > -PKG_VERSION:=0.1.6 > -PKG_REV:=01bedc72451f8afd0c35649dd67c428c44a0f737 > +PKG_VERSION:=0.3.1 > +PKG_REV:=168639e0c482ca1668e15c48aaa9ccef286c223a > PKG_RELEASE:=1 > > PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz > -- > 1.7.1 Hi, is there any trouble merging the above patch? I think I rebased it onto the latest HEAD, so it should apply cleanly and fix some bugs in the triggerhappy package. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] update triggerhappy package to version 0.3.2
this introduces several bugfixes Signed-off-by: Stefan Tomanek --- utils/triggerhappy/Makefile |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/triggerhappy/Makefile b/utils/triggerhappy/Makefile index 58b83b3..2f22fb1 100644 --- a/utils/triggerhappy/Makefile +++ b/utils/triggerhappy/Makefile @@ -6,8 +6,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=triggerhappy -PKG_VERSION:=0.3.1 -PKG_REV:=168639e0c482ca1668e15c48aaa9ccef286c223a +PKG_VERSION:=0.3.2 +PKG_REV:=c0cedabf8d5bd56ae4cb151ebe708d1ac6a3025d PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -- 1.7.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] [packages] triggerhappy: update to version 0.3.4
Signed-off-by: Stefan Tomanek --- utils/triggerhappy/Makefile |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/triggerhappy/Makefile b/utils/triggerhappy/Makefile index 5d07332..aa3ea19 100644 --- a/utils/triggerhappy/Makefile +++ b/utils/triggerhappy/Makefile @@ -6,8 +6,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=triggerhappy -PKG_VERSION:=0.3.3 -PKG_REV:=6ec420175771e14bebb522a2b682ff257b15810a +PKG_VERSION:=0.3.4 +PKG_REV:=cb3ed9ba849ff5926fa47fd1ae042fa0083edaf5 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -- 1.7.2.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] How to recognize if a default route is active
Dies schrieb Jo-Philipp Wich (x...@subsignal.org): > I'd suggest to use "ip route list exact 0.0.0.0/0" to find the device > and then the find_config() shell function to map the device to an uci > interface name. Just a remark: It is possible that this command does not return a default route even if one is present. One of my openwrt devices uses advanced and asymmetric routing, requiring that the default route is not configured in the default routing table, but in a separate one: r...@atto.zollstock.wertarbyte.de's password: root@atto:~# ip route list exact 0.0.0.0/0 root@atto:~# ip rule 0: from all lookup local 100:from all lookup main 105:from all fwmark 0xa lookup tunnel.gw 110:from all lookup ppp.gw 32766: from all lookup main 32767: from all lookup default root@atto:~# ip route list exact 0.0.0.0/0 table ppp.gw default dev ppp0 scope link root@atto:~# ip route list exact 0.0.0.0/0 table tunnel.gw default dev tun0 scope link ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel