[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] fixed a ubusd.c segment fault problem
oOn 18 June 2015 at 13:18, yangchao yangcha...@live.com wrote: hi gays : this is a patch for ubusd.c Please resend as a proper patch, using text/plain (not text/html), with a proper subject and commit message. See https://dev.openwrt.org/wiki/SubmittingPatches for details. -- Rafał ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] broken feeds/packages in 15.05-rc2
Hi, the following packages are still broken in CC-rc2 ERROR: package/feeds/packages/zmq failed to build. ERROR: package/feeds/packages/lzmq failed to build. ERROR: package/feeds/packages/umurmur failed to build (build variant: polarssl). ERROR: package/feeds/packages/tmux failed to build. ERROR: package/feeds/telephony/asterisk-11.x failed to build. ERROR: package/feeds/telephony/asterisk-1.8.x failed to build. ERROR: package/feeds/telephony/asterisk-g72x failed to build (build variant: asterisk11). ERROR: package/feeds/telephony/asterisk-g72x failed to build (build variant: asterisk13). ERROR: package/feeds/telephony/asterisk-g72x failed to build (build variant: asterisk18). ERROR: package/feeds/telephony/chan-sccp-b failed to build (build variant: asterisk11). ERROR: package/feeds/telephony/chan-sccp-b failed to build (build variant: asterisk18). ERROR: package/feeds/telephony/asterisk-11.x-chan-dongle failed to build. ERROR: package/feeds/packages/seafile-server failed to build. i have attached the build log for each one of them. John 15.05-CC-rc2-broken_packages.tar.bz2 Description: BZip2 compressed data ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] [package] ubus: fixed a segent fault problem
HI, allthis is a patch try to fix Signed-off-by:Yang Chao yangchao1p at live.comdiff --git a/ubusd.c b/ubusd.c index 8903105..ecf5bea 100644 --- a/ubusd.c +++ b/ubusd.c @@ -241,7 +241,7 @@ retry: fd_buf.fd = -1; - iov.iov_base = cl-hdrbuf + offset; + iov.iov_base = (char *)cl-hdrbuf + offset; iov.iov_len = sizeof(cl-hdrbuf) - offset; if (cl-pending_msg_fd 0) { yangcha...@live.com ___ 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
I first looked into this 4 years ago and finally figured it out 2 years ago ;-) https://forum.openwrt.org/viewtopic.php?pid=189700#p189700 There is no built-in way to keep those services installed but disabled. But there is a go-around that is used e.g. by luci-app-miniupnpd for miniupnpd: https://github.com/openwrt/luci/blob/master/applications/luci-app-upnp/root/etc/uci-defaults/luci-upnp Create an uci-defaults script in /etc/uci-defaults and disable the unwanted services there. Include that script as a custom file in the firmware flash, in buildroot/files/etc/uci-defaults uci-defaults scripts are run early in the first boot after flash, so the script will disable the services early. Normally uci-defaults scripts are deleted after a succesful run, but by setting a non-zero return value you can preserve the scripts even for further boots to maintain the disabling behaviour even if the user enables the service and reboots. uci-defaults scripts are difficult to see in a live system as the directory /etc/uci-defaults is empty, but you can find the scripts in /rom/etc/uci-defaults: root@OpenWrt:~# ls /etc/uci-defaults/ root@OpenWrt:~# ls /rom/etc/uci-defaults/ 00_uhttpd_ubus10-fstab luci-ddns 01_leds 10_migrate-shadow luci-sqm ... Docs at: http://wiki.openwrt.org/doc/uci#defaults On 18.6.2015 14:28, Stefan Tomanek wrote: 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
* Stefan Tomanek stefan.tomanek+open...@wertarbyte.de [18.06.2015 15:39]: 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. bye, bastian ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH openwrt 3/3] kernel: bridge, multicast-to-unicast: assign src after pskb_may_pull()
A call to pskb_may_pull() might reallocate skb-data. Therefore we should only assign the src-pointer after any potential reallocations. Signed-off-by: Linus Lüssing linus.luess...@c0d3.blue --- .../645-bridge_multicast_to_unicast.patch | 45 +++- .../645-bridge_multicast_to_unicast.patch | 45 +++- 2 files changed, 52 insertions(+), 38 deletions(-) diff --git a/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch b/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch index e8be1fd..83f2475 100644 --- a/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch +++ b/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch @@ -100,37 +100,40 @@ struct sk_buff *skb, u16 vid) { -+ const unsigned char *src = eth_hdr(skb)-h_source; ++ unsigned char *src; struct igmpv3_report *ih; struct igmpv3_grec *grec; int i; -@@ -1008,7 +1031,7 @@ static int br_ip4_multicast_igmp3_report +@@ -1008,7 +1031,8 @@ static int br_ip4_multicast_igmp3_report continue; } - err = br_ip4_multicast_add_group(br, port, group, vid); ++ src = eth_hdr(skb)-h_source; + err = br_ip4_multicast_add_group(br, port, group, vid, src); if (err) break; } -@@ -1022,6 +1045,7 @@ static int br_ip6_multicast_mld2_report( +@@ -1022,6 +1046,7 @@ static int br_ip6_multicast_mld2_report( struct sk_buff *skb, u16 vid) { -+ const unsigned char *src = eth_hdr(skb)-h_source; ++ unsigned char *src; struct icmp6hdr *icmp6h; struct mld2_grec *grec; int i; -@@ -1070,7 +1094,7 @@ static int br_ip6_multicast_mld2_report( +@@ -1069,8 +1094,9 @@ static int br_ip6_multicast_mld2_report( + continue; } ++ src = eth_hdr(skb)-h_source; err = br_ip6_multicast_add_group(br, port, grec-grec_mca, - vid); + vid, src); if (err) break; } -@@ -1407,7 +1431,8 @@ br_multicast_leave_group(struct net_brid +@@ -1407,7 +1433,8 @@ br_multicast_leave_group(struct net_brid struct net_bridge_port *port, struct br_ip *group, struct bridge_mcast_other_query *other_query, @@ -140,7 +143,7 @@ { struct net_bridge_mdb_htable *mdb; struct net_bridge_mdb_entry *mp; -@@ -1457,7 +1482,7 @@ br_multicast_leave_group(struct net_brid +@@ -1457,7 +1484,7 @@ br_multicast_leave_group(struct net_brid for (pp = mp-ports; (p = mlock_dereference(*pp, br)) != NULL; pp = p-next) { @@ -149,7 +152,7 @@ continue; rcu_assign_pointer(*pp, p-next); -@@ -1491,7 +1516,7 @@ br_multicast_leave_group(struct net_brid +@@ -1491,7 +1518,7 @@ br_multicast_leave_group(struct net_brid for (p = mlock_dereference(mp-ports, br); p != NULL; p = mlock_dereference(p-next, br)) { @@ -158,7 +161,7 @@ continue; if (!hlist_unhashed(p-mglist) -@@ -1509,8 +1534,8 @@ out: +@@ -1509,8 +1536,8 @@ out: static void br_ip4_multicast_leave_group(struct net_bridge *br, struct net_bridge_port *port, @@ -169,7 +172,7 @@ { struct br_ip br_group; struct bridge_mcast_own_query *own_query; -@@ -1525,14 +1550,14 @@ static void br_ip4_multicast_leave_group +@@ -1525,14 +1552,14 @@ static void br_ip4_multicast_leave_group br_group.vid = vid; br_multicast_leave_group(br, port, br_group, br-ip4_other_query, @@ -186,7 +189,7 @@ { struct br_ip br_group; struct bridge_mcast_own_query *own_query; -@@ -1547,7 +1572,7 @@ static void br_ip6_multicast_leave_group +@@ -1547,7 +1574,7 @@ static void br_ip6_multicast_leave_group br_group.vid = vid; br_multicast_leave_group(br, port, br_group, br-ip6_other_query, @@ -195,55 +198,59 @@ } #endif -@@ -1556,6 +1581,7 @@ static int br_multicast_ipv4_rcv(struct +@@ -1556,6 +1583,7 @@ static int br_multicast_ipv4_rcv(struct struct sk_buff *skb, u16 vid) { -+ const unsigned char *src = eth_hdr(skb)-h_source; ++ unsigned char *src; struct sk_buff *skb2 = skb; const struct iphdr *iph; struct igmphdr *ih; -@@ -1629,7 +1655,7 @@ static int br_multicast_ipv4_rcv(struct +@@ -1629,7 +1657,8 @@ static int br_multicast_ipv4_rcv(struct
[OpenWrt-Devel] [PATCH netifd 1/2] bridge: Fix multicast_to_unicast feature by hairpin+isolate
All IGMP and MLD versions suffer from a specific limitation (from a snooping switch perspective): Report suppression. Once a listener hears an IGMPv2/3 or MLDv1 report for the same group itself participates in then it might (if this listener is an IGMPv3 or MLDv2 listener) or will (if this is an IGMPv1/2 or MLDv1 listener) refrain from sending its own report. Therefore we might currently miss such surpressing listeners as they won't receive the multicast packet with the mangled, unicasted destination. Fixing this by first isolating the STAs and giving the bridge more control over traffic forwarding. E.g. refraining to forward listener reports to other STAs. For broadcast and unicast traffic to an STA on the same AP, the hairpin feature of the bridge will reflect such traffic back to the AP interface. However, if the AP interface is actually configured to isolate STAs, then hairpin is kept disabled. Signed-off-by: Linus Lüssing linus.luess...@c0d3.blue --- device.c |9 + device.h |4 system-linux.c | 31 +-- wireless.c | 12 +++- wireless.h |1 + 5 files changed, 50 insertions(+), 7 deletions(-) diff --git a/device.c b/device.c index dd2823d..776829d 100644 --- a/device.c +++ b/device.c @@ -46,6 +46,7 @@ static const struct blobmsg_policy dev_attrs[__DEV_ATTR_MAX] = { [DEV_ATTR_NEIGHREACHABLETIME] = { .name = neighreachabletime, .type = BLOBMSG_TYPE_INT32 }, [DEV_ATTR_RPS] = { .name = rps, .type = BLOBMSG_TYPE_BOOL }, [DEV_ATTR_XPS] = { .name = xps, .type = BLOBMSG_TYPE_BOOL }, + [DEV_ATTR_MULTICAST_TO_UNICAST] = { .name = multicast_to_unicast, .type = BLOBMSG_TYPE_BOOL }, }; const struct uci_blob_param_list device_attr_list = { @@ -169,6 +170,7 @@ device_merge_settings(struct device *dev, struct device_settings *n) s-neigh4reachabletime : os-neigh4reachabletime; n-neigh6reachabletime = s-flags DEV_OPT_NEIGHREACHABLETIME ? s-neigh6reachabletime : os-neigh6reachabletime; + n-multicast_to_unicast = s-multicast_to_unicast; n-flags = s-flags | os-flags; } @@ -259,6 +261,11 @@ device_init_settings(struct device *dev, struct blob_attr **tb) else s-xps = default_ps; + if ((cur = tb[DEV_ATTR_MULTICAST_TO_UNICAST])) { + s-multicast_to_unicast = blobmsg_get_bool(cur); + s-flags |= DEV_OPT_MULTICAST_TO_UNICAST; + } + device_set_disabled(dev, disabled); } @@ -863,6 +870,8 @@ device_dump_status(struct blob_buf *b, struct device *dev) blobmsg_add_u32(b, neigh4reachabletime, st.neigh4reachabletime); blobmsg_add_u32(b, neigh6reachabletime, st.neigh6reachabletime); } + if (st.flags DEV_OPT_MULTICAST_TO_UNICAST) + blobmsg_add_u8(b, multicast_to_unicast, st.multicast_to_unicast); } s = blobmsg_open_table(b, statistics); diff --git a/device.h b/device.h index 3001f10..55ef1cf 100644 --- a/device.h +++ b/device.h @@ -40,6 +40,7 @@ enum { DEV_ATTR_NEIGHREACHABLETIME, DEV_ATTR_RPS, DEV_ATTR_XPS, + DEV_ATTR_MULTICAST_TO_UNICAST, __DEV_ATTR_MAX, }; @@ -80,6 +81,7 @@ enum { DEV_OPT_NEIGHREACHABLETIME = (1 9), DEV_OPT_RPS = (1 10), DEV_OPT_XPS = (1 11), + DEV_OPT_MULTICAST_TO_UNICAST= (1 12), }; /* events broadcasted to all users of a device */ @@ -135,6 +137,7 @@ struct device_settings { unsigned int neigh6reachabletime; bool rps; bool xps; + bool multicast_to_unicast; }; /* @@ -167,6 +170,7 @@ struct device { bool iface_config; bool default_config; bool wireless; + bool wireless_isolate; struct interface *config_iface; diff --git a/system-linux.c b/system-linux.c index 6dc9acd..9e21ab0 100644 --- a/system-linux.c +++ b/system-linux.c @@ -310,6 +310,16 @@ static void system_set_neigh6reachabletime(struct device *dev, const char *val) system_set_dev_sysctl(/proc/sys/net/ipv6/neigh/%s/base_reachable_time_ms, dev-ifname, val); } +static void system_bridge_set_multicast_to_unicast(struct device *dev, const char *val) +{ + system_set_dev_sysctl(/sys/class/net/%s/brport/multicast_to_unicast, dev-ifname, val); +} + +static void system_bridge_set_hairpin_mode(struct device *dev, const char *val) +{ + system_set_dev_sysctl(/sys/class/net/%s/brport/hairpin_mode, dev-ifname, val); +} + static int system_get_sysctl(const char *path, char *buf, const size_t buf_sz) { int fd = -1, ret = -1; @@ -545,16 +555,25 @@ static char *system_get_bridge(const char *name, char *buf, int buflen) return path + 1; } -static void system_bridge_set_wireless(const char *bridge, const char *dev) +static void
[OpenWrt-Devel] [PATCH] Fixes regarding bridge multicast-to-unicast feature
Hi, Here are a few patches to fix the issues the multicast-to-unicast feature of the bridge has: IGMP/MLD report suppression could lead to multicast packet loss. Also see ticket #17625 [0]. As previously discussed on this mailing list, AP-isolation together with bridge-hairpinning is a way to make the multicast-to-unicast feature usable even if listeners potentially suppressing reports are present: That way the bridge will get all reports and will have full control on where to forward them. For instance *not* to other STAs (unless there is a multicast router). Furthermore [PATCH netifd 1/2] introduces a netifd option to disable the multicast-to-unicast feature. [PATCH netifd 2/2] is not related to this issue but introduces a handy option (which I would like to make use of for IGMP/MLD domain segmentation). The OpenWRT specific patches should be applied after the netifd patches arrived in OpenWRT. Cheers, Linus [0]: https://dev.openwrt.org/ticket/17625 ___ 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 netifd 2/2] bridge: Allow setting multicast_router option
The multicast_router option of a bridge allows to control the forwarding behaviour of multicast packets independant of the listener state: * 0: Only forward if specific listener is present * 1 (default): Forward if specific listener or a multicast router was detected (currently only learned via query messages, no MRD support yet) * 2: Always forward any multicast traffic on this port Since MRD is not mandated you might end up with silent multicast routers (e.g. if your link has more than one multicast router; only one can become the selected, noisy querier). Here you might need a manual configuration option like the multicast_router option. Other scenarios where this can be useful are for instance: * Segmentation of IGMP/MLD domains together with ebtables * Dedicated bridge port for monitoring/debugging purposes Signed-off-by: Linus Lüssing linus.luess...@c0d3.blue --- device.c | 12 device.h |3 +++ system-linux.c | 17 + 3 files changed, 32 insertions(+) diff --git a/device.c b/device.c index 776829d..bf643ef 100644 --- a/device.c +++ b/device.c @@ -47,6 +47,7 @@ static const struct blobmsg_policy dev_attrs[__DEV_ATTR_MAX] = { [DEV_ATTR_RPS] = { .name = rps, .type = BLOBMSG_TYPE_BOOL }, [DEV_ATTR_XPS] = { .name = xps, .type = BLOBMSG_TYPE_BOOL }, [DEV_ATTR_MULTICAST_TO_UNICAST] = { .name = multicast_to_unicast, .type = BLOBMSG_TYPE_BOOL }, + [DEV_ATTR_MULTICAST_ROUTER] = { .name = multicast_router, .type = BLOBMSG_TYPE_INT32 }, }; const struct uci_blob_param_list device_attr_list = { @@ -171,6 +172,7 @@ device_merge_settings(struct device *dev, struct device_settings *n) n-neigh6reachabletime = s-flags DEV_OPT_NEIGHREACHABLETIME ? s-neigh6reachabletime : os-neigh6reachabletime; n-multicast_to_unicast = s-multicast_to_unicast; + n-multicast_router = s-multicast_router; n-flags = s-flags | os-flags; } @@ -266,6 +268,14 @@ device_init_settings(struct device *dev, struct blob_attr **tb) s-flags |= DEV_OPT_MULTICAST_TO_UNICAST; } + if ((cur = tb[DEV_ATTR_MULTICAST_ROUTER])) { + s-multicast_router = blobmsg_get_u32(cur); + if (s-multicast_router = 0 s-multicast_router = 2) + s-flags |= DEV_OPT_MULTICAST_ROUTER; + else + DPRINTF(Invalid value: %d - (Use 0: never, 1: learn, 2: always)\n, blobmsg_get_u32(cur)); + } + device_set_disabled(dev, disabled); } @@ -872,6 +882,8 @@ device_dump_status(struct blob_buf *b, struct device *dev) } if (st.flags DEV_OPT_MULTICAST_TO_UNICAST) blobmsg_add_u8(b, multicast_to_unicast, st.multicast_to_unicast); + if (st.flags DEV_OPT_MULTICAST_ROUTER) + blobmsg_add_u32(b, multicast_router, st.multicast_router); } s = blobmsg_open_table(b, statistics); diff --git a/device.h b/device.h index 55ef1cf..a487466 100644 --- a/device.h +++ b/device.h @@ -41,6 +41,7 @@ enum { DEV_ATTR_RPS, DEV_ATTR_XPS, DEV_ATTR_MULTICAST_TO_UNICAST, + DEV_ATTR_MULTICAST_ROUTER, __DEV_ATTR_MAX, }; @@ -82,6 +83,7 @@ enum { DEV_OPT_RPS = (1 10), DEV_OPT_XPS = (1 11), DEV_OPT_MULTICAST_TO_UNICAST= (1 12), + DEV_OPT_MULTICAST_ROUTER= (1 13), }; /* events broadcasted to all users of a device */ @@ -138,6 +140,7 @@ struct device_settings { bool rps; bool xps; bool multicast_to_unicast; + unsigned int multicast_router; }; /* diff --git a/system-linux.c b/system-linux.c index 9e21ab0..eb4b682 100644 --- a/system-linux.c +++ b/system-linux.c @@ -320,6 +320,13 @@ static void system_bridge_set_hairpin_mode(struct device *dev, const char *val) system_set_dev_sysctl(/sys/class/net/%s/brport/hairpin_mode, dev-ifname, val); } +static void system_bridge_set_multicast_router(struct device *dev, const char *val, bool bridge) +{ + system_set_dev_sysctl(bridge ? /sys/class/net/%s/bridge/multicast_router : + /sys/class/net/%s/brport/multicast_router, + dev-ifname, val); +} + static int system_get_sysctl(const char *path, char *buf, const size_t buf_sz) { int fd = -1, ret = -1; @@ -584,6 +591,11 @@ int system_bridge_addif(struct device *bridge, struct device *dev) if (dev-wireless) system_bridge_set_wireless(dev); + if (dev-settings.flags DEV_OPT_MULTICAST_ROUTER) { + snprintf(buf, sizeof(buf), %i, dev-settings.multicast_router); + system_bridge_set_multicast_router(dev, buf, false); + } + return ret; } @@ -834,6 +846,11 @@ int system_bridge_addbr(struct device *bridge, struct bridge_config
[OpenWrt-Devel] [PATCH openwrt 1/3] hostapd: Always isolate if brport-multicast_to_unicast is enabled
For the multicast-to-unicast feature of a bridge to function correctly, it is necessary that all STAs are always isolated on the AP level. The bridge will take care of reflecting packets back to the AP interface if necessary and/or no STA isolation wanted by using the hairpin feature of the bridge. Signed-off-by: Linus Lüssing linus.luess...@c0d3.blue --- package/network/services/hostapd/files/netifd.sh | 15 +++ 1 file changed, 15 insertions(+) diff --git a/package/network/services/hostapd/files/netifd.sh b/package/network/services/hostapd/files/netifd.sh index 23d2e7e..74b2d02 100644 --- a/package/network/services/hostapd/files/netifd.sh +++ b/package/network/services/hostapd/files/netifd.sh @@ -1,3 +1,6 @@ +. /lib/network/config.sh +. /lib/config/uci.sh + wpa_supplicant_add_rate() { local var=$1 local val=$(($2 / 1000)) @@ -176,6 +179,9 @@ hostapd_set_bss_options() { local bss_conf local wep_rekey wpa_group_rekey wpa_pair_rekey wpa_master_rekey wpa_key_mgmt + local bridge_section= + local mcast_to_ucast=1 + json_get_vars \ wep_rekey wpa_group_rekey wpa_pair_rekey wpa_master_rekey \ maxassoc max_inactivity disassoc_low_ack isolate auth_cache \ @@ -193,9 +199,18 @@ hostapd_set_bss_options() { set_default wmm 1 set_default uapsd 1 + if [ -n $network_bridge ]; then + bridge_section=$(find_config $network_bridge) + fi + if [ -n $bridge_section ]; then + mcast_to_ucast=$(uci_get_state network $bridge_section mcast_to_ucast 1) + fi + append bss_conf ctrl_interface=/var/run/hostapd if [ $isolate -gt 0 ]; then append bss_conf ap_isolate=$isolate $N + elif [ -n $bridge_section -a $mcast_to_ucast -gt 0 ]; then + append bss_conf ap_isolate=1 $N fi if [ $maxassoc -gt 0 ]; then append bss_conf max_num_sta=$maxassoc $N -- 1.7.10.4 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v3] base-files: add /etc/profile.d support
OpenWrt should support an optinal /etc/profile.d directory like most other Linux distributions. This allows packages to install their own scripts into /etc/profile.d/. This is the second version, which includes suggestions from the mailing-list. --- package/base-files/files/etc/profile | 10 ++ 1 file changed, 10 insertions(+) diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile index 3dd58e1..d7129c3 100644 --- a/package/base-files/files/etc/profile +++ b/package/base-files/files/etc/profile @@ -14,3 +14,13 @@ export PS1='\u@\h:\w\$ ' [ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; } [ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; } + +[ -z $FAILSAFE ] { + if [ -d /etc/profile.d ]; then +for i in /etc/profile.d/*.sh ; do + if [ -r $i ]; then +. $i + fi +done + fi +} -- 2.4.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 3/4] swconfig: swlib.c: free portmaps in swlib_free()
From: Alexandru Ardelean a...@ocedo.com Signed-off-by: Alexandru Ardelean ardeleana...@gmail.com --- package/network/config/swconfig/src/swlib.c | 13 + package/network/config/swconfig/src/swlib.h | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/package/network/config/swconfig/src/swlib.c b/package/network/config/swconfig/src/swlib.c index f74c093..1e0a7db 100644 --- a/package/network/config/swconfig/src/swlib.c +++ b/package/network/config/swconfig/src/swlib.c @@ -755,12 +755,25 @@ swlib_free_attributes(struct switch_attr **head) *head = NULL; } +static void +swlib_free_port_map(struct switch_dev *dev) +{ + int i; + if (!dev || !dev-maps) + return; + + for (i=0; i dev-ports; i++) + free(dev-maps[i].segment); + free(dev-maps); +} + void swlib_free(struct switch_dev *dev) { swlib_free_attributes(dev-ops); swlib_free_attributes(dev-port_ops); swlib_free_attributes(dev-vlan_ops); + swlib_free_port_map(dev); free(dev-name); free(dev-alias); free(dev); diff --git a/package/network/config/swconfig/src/swlib.h b/package/network/config/swconfig/src/swlib.h index 28bdd7f..2b42c14 100644 --- a/package/network/config/swconfig/src/swlib.h +++ b/package/network/config/swconfig/src/swlib.h @@ -158,7 +158,7 @@ struct switch_port { struct switch_portmap { unsigned int virt; - const char *segment; + char *segment; }; /** -- 2.1.4 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] ar71xx: add support for tp-link wr740n v5.0 (EU)
On 06/18/2015 06:54 PM, valent.turko...@gmail.com wrote: Daniel thank you! Who will add V5 so it gets build? OpenWrt developers of course :) I tested my little patch, it works. Cheers, Valent. On 8 June 2015 at 17:47, Daniel Petre daniel.pe...@posteo.net wrote: TP-Link ships wr740n v5.0 to Romania (so probably everywhere except China) with 4 MB flash and 32 MB memory (confirmed by their local support). This patch adds support for the v5.0 clone of v4, i just tested it on my own v5.0 router and it works. Signed-off-by: Daniel Petre daniel.pe...@posteo.net Index: openwrt/target/linux/ar71xx/image/Makefile === --- openwrt/target/linux/ar71xx/image/Makefile (revision 45921) +++ openwrt/target/linux/ar71xx/image/Makefile (working copy) @@ -443,6 +443,14 @@ CONSOLE := ttyATH0,115200 endef +define Device/tl-wr740n-v5 +$(Device/tplink-4mlzma) +BOARDNAME := TL-WR741ND-v4 +DEVICE_PROFILE := TLWR740 +TPLINK_HWID := 0x0745 +CONSOLE := ttyATH0,115200 +endef + define Device/tl-wr741nd-v1 $(Device/tplink-4m) BOARDNAME := TL-WR741ND @@ -472,7 +480,7 @@ TPLINK_HWID := 0x07430002 CONSOLE := ttyATH0,115200 endef -TARGET_DEVICES += tl-wr740n-v4 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr743nd-v2 +TARGET_DEVICES += tl-wr740n-v4 tl-wr740n-v5 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr743nd-v2 define Device/tl-wr841n-v8 $(Device/tplink-4mlzma) ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 3/3] ar71xx: add profile and build image for EnGenius EPG5000.
Signed-off-by: Christian Beier c...@shoutrlabs.com --- target/linux/ar71xx/generic/profiles/engenius.mk | 12 target/linux/ar71xx/image/Makefile | 2 ++ 2 files changed, 14 insertions(+) diff --git a/target/linux/ar71xx/generic/profiles/engenius.mk b/target/linux/ar71xx/generic/profiles/engenius.mk index b42c5cc..7ea93e3 100644 --- a/target/linux/ar71xx/generic/profiles/engenius.mk +++ b/target/linux/ar71xx/generic/profiles/engenius.mk @@ -39,3 +39,15 @@ define Profile/ESR1750/Description endef $(eval $(call Profile,ESR1750)) + + +define Profile/EPG5000 +NAME:=EnGenius EPG5000 +PACKAGES:=kmod-usb-core kmod-usb2 kmod-usb-storage kmod-ath10k wpad-mini +endef + +define Profile/EPG5000/Description +Package set optimized for the EnGenius EPG5000 +endef + +$(eval $(call Profile,EPG5000)) diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile index 21d0d66..5e5e6a0 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -1139,6 +1139,7 @@ cameo_ap94_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware) cameo_ap94_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,7808k(firmware),64k(caldata)ro,64k@0x66(caldata_orig),6208k@0x5(firmware_orig) esr900_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k@0x4(firmware) esr1750_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k@0x4(firmware) +epg5000_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k@0x4(firmware) ew-dorin_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),3712k(firmware),64k(art) ew-dorin_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro f9k1115v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),14464k(rootfs),1408k(kernel),64k(nvram)ro,64k(envram)ro,64k(art)ro,15872k@0x5(firmware) @@ -2001,6 +2002,7 @@ $(eval $(call SingleProfile,CameoAP94,64kraw,DLRTDEV01,dlrtdev01,DIR-825-B1,ttyS $(eval $(call SingleProfile,EnGenius,64k,ESR900,esr900,ESR900,ttyS0,115200,$$(esr900_mtdlayout),KRuImage,,0x4e)) $(eval $(call SingleProfile,EnGenius,64k,ESR1750,esr1750,ESR1750,ttyS0,115200,$$(esr1750_mtdlayout),KRuImage,,0x61)) +$(eval $(call SingleProfile,EnGenius,64k,EPG5000,epg5000,EPG5000,ttyS0,115200,$$(epg5000_mtdlayout),KRuImage,,0x71)) $(eval $(call SingleProfile,HiWiFi,64k,HIWIFI_HC6361,hiwifi-hc6361,HiWiFi-HC6361,ttyATH0,115200,$$(hiwifi_hc6361_mtdlayout),KRuImage)) -- 2.1.4 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 4/4] swconfig: swlib.c: free name and description of attributes
From: Alexandru Ardelean a...@ocedo.com Signed-off-by: Alexandru Ardelean ardeleana...@gmail.com --- package/network/config/swconfig/src/swlib.c | 2 ++ package/network/config/swconfig/src/swlib.h | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package/network/config/swconfig/src/swlib.c b/package/network/config/swconfig/src/swlib.c index 1e0a7db..dae603c 100644 --- a/package/network/config/swconfig/src/swlib.c +++ b/package/network/config/swconfig/src/swlib.c @@ -749,6 +749,8 @@ swlib_free_attributes(struct switch_attr **head) while (a) { next = a-next; + free(a-name); + free(a-description); free(a); a = next; } diff --git a/package/network/config/swconfig/src/swlib.h b/package/network/config/swconfig/src/swlib.h index 2b42c14..7edece3 100644 --- a/package/network/config/swconfig/src/swlib.h +++ b/package/network/config/swconfig/src/swlib.h @@ -146,8 +146,8 @@ struct switch_attr { int atype; int id; int type; - const char *name; - const char *description; + char *name; + char *description; struct switch_attr *next; }; -- 2.1.4 ___ 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
Hi guys, Le 18 juin 2015 17:18, Stefan Tomanek stefan.tomanek+open...@wertarbyte.de a écrit : 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} While you're at it, please also handle backup (not only sysupgrade) Thanks in advance Etienne ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 2/4] swconfig: swlib.c: remove const qualifier for val.s since this is supposed to be free'd
From: Alexandru Ardelean a...@ocedo.com Signed-off-by: Alexandru Ardelean ardeleana...@gmail.com --- package/network/config/swconfig/src/swlib.c | 2 +- package/network/config/swconfig/src/swlib.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/config/swconfig/src/swlib.c b/package/network/config/swconfig/src/swlib.c index 334d148..f74c093 100644 --- a/package/network/config/swconfig/src/swlib.c +++ b/package/network/config/swconfig/src/swlib.c @@ -363,7 +363,7 @@ int swlib_set_attr_string(struct switch_dev *dev, struct switch_attr *a, int por val.value.i = atoi(str); break; case SWITCH_TYPE_STRING: - val.value.s = str; + val.value.s = (char *)str; break; case SWITCH_TYPE_PORTS: ports = alloca(sizeof(struct switch_port) * dev-ports); diff --git a/package/network/config/swconfig/src/swlib.h b/package/network/config/swconfig/src/swlib.h index bb2ebd8..28bdd7f 100644 --- a/package/network/config/swconfig/src/swlib.h +++ b/package/network/config/swconfig/src/swlib.h @@ -135,7 +135,7 @@ struct switch_val { int err; int port_vlan; union { - const char *s; + char *s; int i; struct switch_port *ports; } value; -- 2.1.4 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 1/3] ar71xx: add kernel support for EnGenius EPG5000.
Signed-off-by: Christian Beier c...@shoutrlabs.com --- target/linux/ar71xx/config-3.18| 1 + .../ar71xx/files/arch/mips/ath79/mach-epg5000.c| 178 + .../718-MIPS-ath79-add-EPG5000-support.patch | 39 + 3 files changed, 218 insertions(+) create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-epg5000.c create mode 100644 target/linux/ar71xx/patches-3.18/718-MIPS-ath79-add-EPG5000-support.patch diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18 index 543b77e..2fb3525 100644 --- a/target/linux/ar71xx/config-3.18 +++ b/target/linux/ar71xx/config-3.18 @@ -57,6 +57,7 @@ CONFIG_ATH79_MACH_EAP300V2=y CONFIG_ATH79_MACH_EAP7660D=y CONFIG_ATH79_MACH_EL_M150=y CONFIG_ATH79_MACH_EL_MINI=y +CONFIG_ATH79_MACH_EPG5000=y CONFIG_ATH79_MACH_ESR1750=y CONFIG_ATH79_MACH_ESR900=y CONFIG_ATH79_MACH_EW_DORIN=y diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-epg5000.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-epg5000.c new file mode 100644 index 000..b049f5d --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-epg5000.c @@ -0,0 +1,178 @@ +/* + * EnGenius EPG5000 board support + * + * Copyright (c) 2014 Jon Suphammer j...@suphammer.net + * Copyright (c) 2015 Christian Beier c...@shoutrlabs.com + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include linux/platform_device.h +#include linux/ar8216_platform.h + +#include asm/mach-ath79/ar71xx_regs.h + +#include common.h +#include pci.h +#include dev-ap9x-pci.h +#include dev-gpio-buttons.h +#include dev-eth.h +#include dev-leds-gpio.h +#include dev-m25p80.h +#include dev-usb.h +#include dev-wmac.h +#include machtypes.h +#include nvram.h + +#define EPG5000_GPIO_LED_WLAN_5G 23 +#define EPG5000_GPIO_LED_WLAN_2G 13 +#define EPG5000_GPIO_LED_POWER_AMBER 2 +#define EPG5000_GPIO_LED_WPS_AMBER 22 +#define EPG5000_GPIO_LED_WPS_BLUE 19 + +#define EPG5000_GPIO_BTN_WPS 16 +#define EPG5000_GPIO_BTN_RESET 17 + +#define EPG5000_KEYS_POLL_INTERVAL 20 /* msecs */ +#define EPG5000_KEYS_DEBOUNCE_INTERVAL (3 * EPG5000_KEYS_POLL_INTERVAL) + +#define EPG5000_CALDATA_ADDR 0x1fff +#define EPG5000_WMAC_CALDATA_OFFSET0x1000 +#define EPG5000_PCIE_CALDATA_OFFSET0x5000 + +#define EPG5000_NVRAM_ADDR 0x1f03 +#define EPG5000_NVRAM_SIZE 0x1 + +static struct gpio_led epg5000_leds_gpio[] __initdata = { + { + .name = epg5000:amber:power, + .gpio = EPG5000_GPIO_LED_POWER_AMBER, + .active_low = 1, + }, + { + .name = epg5000:blue:wps, + .gpio = EPG5000_GPIO_LED_WPS_BLUE, + .active_low = 1, + }, + { + .name = epg5000:amber:wps, + .gpio = EPG5000_GPIO_LED_WPS_AMBER, + .active_low = 1, + }, + { + .name = epg5000:blue:wlan-2g, + .gpio = EPG5000_GPIO_LED_WLAN_2G, + .active_low = 1, + }, + { + .name = epg5000:blue:wlan-5g, + .gpio = EPG5000_GPIO_LED_WLAN_5G, + .active_low = 1, + } +}; + +static struct gpio_keys_button epg5000_gpio_keys[] __initdata = { + { + .desc = WPS button, + .type = EV_KEY, + .code = KEY_WPS_BUTTON, + .debounce_interval = EPG5000_KEYS_DEBOUNCE_INTERVAL, + .gpio = EPG5000_GPIO_BTN_WPS, + .active_low = 1, + }, + { + .desc = Reset button, + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = EPG5000_KEYS_DEBOUNCE_INTERVAL, + .gpio = EPG5000_GPIO_BTN_RESET, + .active_low = 1, + }, +}; + +static struct ar8327_pad_cfg epg5000_ar8327_pad0_cfg = { + .mode = AR8327_PAD_MAC_RGMII, + .txclk_delay_en = true, + .rxclk_delay_en = true, + .txclk_delay_sel = AR8327_CLK_DELAY_SEL2, + .rxclk_delay_sel = AR8327_CLK_DELAY_SEL2, + .mac06_exchange_en = true, +}; + +static struct ar8327_platform_data epg5000_ar8327_data = { + .pad0_cfg = epg5000_ar8327_pad0_cfg, + .port0_cfg = { + .force_link = 1, + .speed = AR8327_PORT_SPEED_1000, + .duplex = 1, + .txpause = 1, + .rxpause = 1, + }, +}; + +static struct mdio_board_info epg5000_mdio0_info[] = { + { + .bus_id = ag71xx-mdio.0, + .phy_addr = 0, + .platform_data =
[OpenWrt-Devel] [PATCH 2/3] ar71xx: add user-space support for EnGenius EPG5000.
Signed-off-by: Christian Beier c...@shoutrlabs.com --- target/linux/ar71xx/base-files/etc/diag.sh | 3 +++ target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 3 ++- target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 +++ target/linux/ar71xx/base-files/lib/upgrade/platform.sh | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index 0553251..8af4ae5 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -89,6 +89,9 @@ get_status_led() { gl-inet) status_led=gl-connect:green:lan ;; + epg5000) + status_led=epg5000:amber:power + ;; esr1750) status_led=esr1750:amber:power ;; diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network index f5c6865..23d0be5 100644 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network @@ -30,7 +30,8 @@ wlr8100) ucidef_add_switch_vlan switch0 2 0t 1 ;; -esr1750) +esr1750 |\ +epg5000) ucidef_set_interfaces_lan_wan eth0.1 eth0.2 ucidef_add_switch switch0 1 1 ucidef_add_switch_vlan switch0 1 0t 2 3 4 5 diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index b13be1e..722af51 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -430,6 +430,9 @@ ar71xx_board_detect() { name=gl-inet gl_inet_board_detect ;; + *EnGenius EPG5000) + name=epg5000 + ;; *EnGenius ESR1750) name=esr1750 ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index 3dbd91c..1908e5b 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -208,6 +208,7 @@ platform_check_image() { dir-825-c1 | \ dir-835-a1 | \ dragino2 | \ + epg5000 | \ esr1750 | \ esr900 | \ ew-dorin | \ -- 2.1.4 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 1/4] swconfig: swlib.c: free device name and alias
From: Alexandru Ardelean a...@ocedo.com Signed-off-by: Alexandru Ardelean ardeleana...@gmail.com --- package/network/config/swconfig/src/swlib.c | 2 ++ package/network/config/swconfig/src/swlib.h | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package/network/config/swconfig/src/swlib.c b/package/network/config/swconfig/src/swlib.c index 1222502..334d148 100644 --- a/package/network/config/swconfig/src/swlib.c +++ b/package/network/config/swconfig/src/swlib.c @@ -761,6 +761,8 @@ swlib_free(struct switch_dev *dev) swlib_free_attributes(dev-ops); swlib_free_attributes(dev-port_ops); swlib_free_attributes(dev-vlan_ops); + free(dev-name); + free(dev-alias); free(dev); if (--refcount == 0) diff --git a/package/network/config/swconfig/src/swlib.h b/package/network/config/swconfig/src/swlib.h index 016f74b..bb2ebd8 100644 --- a/package/network/config/swconfig/src/swlib.h +++ b/package/network/config/swconfig/src/swlib.h @@ -116,8 +116,8 @@ struct uci_package; struct switch_dev { int id; char dev_name[IFNAMSIZ]; - const char *name; - const char *alias; + char *name; + char *alias; int ports; int vlans; int cpu_port; -- 2.1.4 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 0/3] [RFC] ar71xx: Add support for EnGenius EPG5000
Hi list, This patch series adds support for the EnGenius EPG5000, the successor of the ESR1750. That is, both devices are *very* similar internally, to the point that the EPG5000 works flawlessly with an ESR1750 image AFAICT. One important difference thought is the product id that's needed for flashing them .dlf images from the OEM firmware. In fact, both are so similar that mach-epg5000.c is simply a copy of mach-esr1750.c with s/esr1750/epg5000/. Please comment. Cheers, Christian Christian Beier (3): ar71xx: add kernel support for EnGenius EPG5000. ar71xx: add user-space support for EnGenius EPG5000. ar71xx: add profile and build image for EnGenius EPG5000. target/linux/ar71xx/base-files/etc/diag.sh | 3 + .../ar71xx/base-files/etc/uci-defaults/02_network | 3 +- target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 + .../ar71xx/base-files/lib/upgrade/platform.sh | 1 + target/linux/ar71xx/config-3.18| 1 + .../ar71xx/files/arch/mips/ath79/mach-epg5000.c| 178 + target/linux/ar71xx/generic/profiles/engenius.mk | 12 ++ target/linux/ar71xx/image/Makefile | 2 + .../718-MIPS-ath79-add-EPG5000-support.patch | 39 + 9 files changed, 241 insertions(+), 1 deletion(-) create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-epg5000.c create mode 100644 target/linux/ar71xx/patches-3.18/718-MIPS-ath79-add-EPG5000-support.patch -- 2.1.4 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] ar71xx: add support for tp-link wr740n v5.0 (EU)
Daniel thank you! Daniel can you please share firmware you have build so I can join in testing. I still don't see V5 images being build in trunk. Who will add V5 so it gets build? Cheers, Valent. On 8 June 2015 at 17:47, Daniel Petre daniel.pe...@posteo.net wrote: TP-Link ships wr740n v5.0 to Romania (so probably everywhere except China) with 4 MB flash and 32 MB memory (confirmed by their local support). This patch adds support for the v5.0 clone of v4, i just tested it on my own v5.0 router and it works. Signed-off-by: Daniel Petre daniel.pe...@posteo.net Index: openwrt/target/linux/ar71xx/image/Makefile === --- openwrt/target/linux/ar71xx/image/Makefile (revision 45921) +++ openwrt/target/linux/ar71xx/image/Makefile (working copy) @@ -443,6 +443,14 @@ CONSOLE := ttyATH0,115200 endef +define Device/tl-wr740n-v5 +$(Device/tplink-4mlzma) +BOARDNAME := TL-WR741ND-v4 +DEVICE_PROFILE := TLWR740 +TPLINK_HWID := 0x0745 +CONSOLE := ttyATH0,115200 +endef + define Device/tl-wr741nd-v1 $(Device/tplink-4m) BOARDNAME := TL-WR741ND @@ -472,7 +480,7 @@ TPLINK_HWID := 0x07430002 CONSOLE := ttyATH0,115200 endef -TARGET_DEVICES += tl-wr740n-v4 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr743nd-v2 +TARGET_DEVICES += tl-wr740n-v4 tl-wr740n-v5 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr743nd-v2 define Device/tl-wr841n-v8 $(Device/tplink-4mlzma) ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ 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
Can anyone supply any different ideas or provide some feedback? I have solved this (or something similar) in my builds with an additional AUTOENABLE flags in init scripts. IMHO except for critical services (like network...) other packages should not be automatically enabled when installed since they probably need to be configured first anyway. For instance, installing something like openswan (or including it in firmware image because ipsec modules are quite large) should not load entire ipsec stack by default because it might not be configured or used anyway. The modified init script looks like: --- a/packages/net/openswan/files/ipsec.init +++ b/packages/net/openswan/files/ipsec.init @@ -31,6 +31,7 @@ # KLIPS is the kernel half of it, Pluto is the user-level management daemon. START=60 +AUTOENABLE=no EXTRA_COMMANDS=status EXTRA_HELP= status Show the status of the service Now, since my list of packages is fairly static, I have only explicitly disabled AUTOENABLE for services I don't want starting by default (like ipsec) - AUTOENABLE defaults to 'yes' if not present in the init script. In contrast, using something like this in OpenWRT, there might be a list of services that should always be enabled by default with the rest needing to be manually enabled by the administrator (thus defaulting AUTOENABLE to 'no'). You could build customized images with dropbear and firewall services having AUTOENABLE=no. This idea solves: - no unneeded services started after fresh firmware install (before being configured) - backups (every service that has been configured is also explicitly enabled with symlink in /overlay) - sysupgrade (if /overlay/etc/rc.d is preserved) My current patches are against AA, if this idea seems acceptable I can prepare something for CC or trunk... Regards, Saso Slavicic ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] ar71xx: add support for tp-link wr740n v5.0 (EU)
Daniel thank you for this patch, we are organising a wifi workshop for spreading free and open mesh network and without support for these affordable router we couldn't do it! So thanks a lot, and thanks a lot to all OpenWrt developers, all of you guys rock! On 18 June 2015 at 19:00, Daniel Petre daniel.pe...@posteo.net wrote: On 06/18/2015 06:54 PM, valent.turko...@gmail.com wrote: Daniel thank you! Who will add V5 so it gets build? OpenWrt developers of course :) I tested my little patch, it works. Cheers, Valent. On 8 June 2015 at 17:47, Daniel Petre daniel.pe...@posteo.net wrote: TP-Link ships wr740n v5.0 to Romania (so probably everywhere except China) with 4 MB flash and 32 MB memory (confirmed by their local support). This patch adds support for the v5.0 clone of v4, i just tested it on my own v5.0 router and it works. Signed-off-by: Daniel Petre daniel.pe...@posteo.net Index: openwrt/target/linux/ar71xx/image/Makefile === --- openwrt/target/linux/ar71xx/image/Makefile (revision 45921) +++ openwrt/target/linux/ar71xx/image/Makefile (working copy) @@ -443,6 +443,14 @@ CONSOLE := ttyATH0,115200 endef +define Device/tl-wr740n-v5 +$(Device/tplink-4mlzma) +BOARDNAME := TL-WR741ND-v4 +DEVICE_PROFILE := TLWR740 +TPLINK_HWID := 0x0745 +CONSOLE := ttyATH0,115200 +endef + define Device/tl-wr741nd-v1 $(Device/tplink-4m) BOARDNAME := TL-WR741ND @@ -472,7 +480,7 @@ TPLINK_HWID := 0x07430002 CONSOLE := ttyATH0,115200 endef -TARGET_DEVICES += tl-wr740n-v4 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr743nd-v2 +TARGET_DEVICES += tl-wr740n-v4 tl-wr740n-v5 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr743nd-v2 define Device/tl-wr841n-v8 $(Device/tplink-4mlzma) ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] b53 switch driver memory leak and reset gpio pin initialization fix
Hi Fedor, please don't top post. On Sat, Jun 13, 2015 at 2:31 PM, blmink blm...@mink.su wrote: Hi, Jonas I inserted trace points (pr_info) at functions in b53_common and figured out that driver behave wrong. Please have a look at this: ~~~cut~~~ root@(none):/# uname -a Linux (none) 4.0.4 #1 SMP Sat Jun 13 02:59:36 MSK 2015 mips64 GNU/Linux root@(none):/# root@(none):/# ifconfig eth0 up [ 15.561304] b53_common: b53_switch_alloc [ 15.565265] b53_common: b53_switch_register [ 15.569960] b53_common: b53_switch_init [ 15.650583] b53_common: found switch: BCM53115, rev 8 [ 15.659538] eth0: 1000 Mbps Full duplex, port 0 [ 15.664439] eth1: 1000 Mbps Full duplex, port 1, queue 1 root@(none):/# root@(none):/# root@(none):/# ifconfig eth0 down [ 42.697656] eth0: Link down [ 42.700742] eth0: 1000 Mbps Full duplex, port 0, queue 0 root@(none):/# root@(none):/# ifconfig eth0 down root@(none):/# ifconfig eth0 up [ 49.145311] b53_common: b53_switch_alloc [ 49.149267] b53_common: b53_switch_register [ 49.153972] b53_common: b53_switch_init [ 49.160932] Broadcom B53 (1) 800118001800:1e: failed to register switch: -16 ifconfig: SIOCSIFFLAGS: No such device root@(none):/# reboot ~~~cut~~~ We can see that ifconfig up calls b53_switch_alloc which calls devm_kzalloc in sequence. b53_switch_alloc is called by following sequence: ifconfig up -- b53_mdio driver probe/register -- b53_phy_config_init -- b53_switch_alloc Your analysis isn't quite correct. Probe is called from mdio_bus_register - mdio_bus_scan - device_add - b53_phy_probe (independend of any ethernet devices). Config_init is called from phy_connect - phy_hw_init - b53_phy_config_init. Driver removes never (in case of ifconfig down either) and it do not free memory. So, in our example we have b53_switch_alloc called twice in a row. As for switch gpio reset.. failed to register switch: -16 is from devm_gpio_request_one(). -16 is EBUSY (Device or resource busy). My system is D-Link DSR-1000 (Cavium Octeon MIPS64), I have added support for it. But things described above affect any platform. No, it is dependent on the way the ethernet driver works / interacts with the phy subsystem. To use a phy, there are two setup calls and two remove calls; phy_connect/phy_disconnect and phy_start/phy_stop. The issue you are seeing is only seen with ethernet drivers that do the phy_connect in their start (ifup), but not seen with drivers that do it in their probe callback. That's why I said that the already alloc'd/registered check in _config_init is the only valid part of this patch. The other possibility would be moving the allocation/registration to the driver probe, but that would mean that we would lose the ethX alias for the switch, which might still be used by some configurations. Please also see comments below. 13.06.2015 01:57, Jonas Gorski пишет: Hi, On Fri, Jun 12, 2015 at 8:16 PM, Fedor Konstantinov blm...@mink.su wrote: Memory and switch reset gpio pin must be allocated on switch/module init and freed on removal. At least they should not be allocated 2 or more times in a row. Signed-off-by: Fedor Konstantinov blm...@mink.su --- Comments: Following cmd sequence calls b53_switch_init() twice, so causes leak of memory. Last ifconfig will fail also on targets which support switch reset gpio pin, because devm_gpio_request_one() will be called twice in a row. ifconfig eth0 up ifconfig eth0 down ifconfig eth0 up On what platform? This also requires a better explanation why this is the correct fix. These affect any platform. As I explained above, it does not affect any platform. mmap/spi/srab drivers were not tested yet because I don't have such hardware. --- .../generic/files/drivers/net/phy/b53/b53_common.c | 19 +++ .../generic/files/drivers/net/phy/b53/b53_mdio.c | 6 + .../generic/files/drivers/net/phy/b53/b53_mmap.c | 28 +- .../generic/files/drivers/net/phy/b53/b53_priv.h | 7 +++--- .../generic/files/drivers/net/phy/b53/b53_spi.c| 20 .../generic/files/drivers/net/phy/b53/b53_srab.c | 28 +- 6 files changed, 88 insertions(+), 20 deletions(-) diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c index 47b5a8b..2e2f6aa 100644 --- a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c +++ b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c @@ -1362,6 +1362,12 @@ struct b53_device *b53_switch_alloc(struct device *base, struct b53_io_ops *ops, } EXPORT_SYMBOL(b53_switch_alloc); +void b53_switch_free(struct device *dev, struct b53_device *priv) +{ + devm_kfree(dev, priv); +} +EXPORT_SYMBOL(b53_switch_free); + int b53_switch_detect(struct b53_device *dev) { u32 id32; @@ -1452,6 +1458,19 @@ int
Re: [OpenWrt-Devel] Lantiq xrx200 - switch rtl8367rb controlled via builtin mdio (not gpio sck/sda!) in EasyBox 904xDSL
Hi, On Sun, Jun 14, 2015 at 11:10 PM, Arnold Schulz arny...@gmx.net wrote: Hi everyone, for fun I have put efforts to solve some mysteries of the EasyBox 904xDSL. (here thank you Sylwester and Martin B. for feedback). Currently code in driver/net/phy/rtl8366_smi.c is used to control rtl836x chips via bitbanging two gpio lines. This does not work for the 904 xDSL. Disassembling code from the rtl8367rb.ko (oem firmware) shows that the rtl8367rb is controlled via mdio registers at 0xBE10B120~128. I'm pretty sure I identified all gpio usage in rt8367rb.ko. There is one switch hw reset line (io41). Pin io42 and io43 are setup once (AltSel1/0:=1/0; no open drain; Dir:=output for io43) and then left alone, I guess to be driven by internal mdio logic responding to 0xBE10B120~128. Access to the switch' registers looks somehow cumbersome, e.g. u32 RTL83XX_SMI_READ(u32 addr) { ifx_vr9_mdio_write(0, 0x1D, 0x); ifx_vr9_mdio_write(0, 0x1F, 0xE); ifx_vr9_mdio_write(0, 0x1D, 0x); ifx_vr9_mdio_write(0, 0x17, addr 0x) ifx_vr9_mdio_write(0, 0x1D, 0x); ifx_vr9_mdio_write(0, 0x15, 1); ifx_vr9_mdio_write(0, 0x1D, 0x); return ifx_vr9_mdio_read(0, 0x19); } So many more bits are banged over the bus as the code in rtl8366_smi.c does. Me wondering: there must be a chip between, which relays control info to the rtl8367rb? There is no special chip, the RTL8367 provides several means of accessing the chip registers; using MDIO registers is one of them. It also understands SPI (likely using different pins though). Regards Jonas ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] opkg.conf as preserved config file in sysupgrade is creating problems (especially after package signing)
/etc/opkg.conf has been declared a config file and is thus preserved in an sysupgrade. https://dev.openwrt.org/browser/trunk/package/system/opkg/Makefile#L65 After the package list signing has been enabled, that is really hurting with upgrading: the old opkg.conf gets preseverd and points to the old version's repo. If user doesn't realise that and the build's signing key has changed, the user gets practically locked out of opkg update, as package list signature check will fail. Apparently 15.05-rc2 did not include luci (at least not all the platforms), so there are severeal forum discussions bugs about rc2 without luci + unability to install luci. For example: https://forum.openwrt.org/viewtopic.php?pid=280016#p280016 https://forum.openwrt.org/viewtopic.php?id=58016 https://dev.openwrt.org/ticket/19853 Earlier the problem has been more hidden, as e.g. Luci from rc1 does not differ that much from rc2, and installing the old version has not hurt. Now the signature check removes that possibility, especially when switching between release to snapshot builds, (or possibly between difeerent releases if different keys are used). My proposal to developers is to remove the config file status from opkg.conf. Then a new opkg.conf would be installed along a new firmware and it would point to the correct binary repo for the current firmware. That would improve the user experience of an average user, who doesn't really care about deeper system innards. Overwriting the user's opkg.conf may hurt some users, but probably a small minority of experienced users, so I would Other possibility could be divide opkg.conf into two: a build-specific default download repo list (to be overwritten in sysupgrade) and a user-specific config file with config options and possible additional download locations (to be preserved). Any opinions? ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] lantiq DSL drivers / firmware info
Hi Flo, On Thu, Jun 18, 2015 at 10:59 AM, Florian Eckert eckert.flor...@googlemail.com wrote: I have the new source packages for lantiq dsl stuffs. This are the new packages rom UGW-6.1. As far as I know these are the *latest* driver versions. Do you have a link to those packages (or a link to some GPL source which includes them)? Regards, Martin ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] libusb-compat: fix build with musl
Hi Álvaro, I see. The proper place to fix it is flashrom, it needs to include sys/types.h before including libusb headers and its Makefile needs to define -D_GNU_SOURCE or -std=gnu99 Regards, Jow ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] lantiq DSL drivers / firmware info
Hello, I have the new source packages for lantiq dsl stuffs. This are the new packages rom UGW-6.1. I don´t know the differences in the new packages! Martin Blumenstingl [xdarklight] on github - UGW-6.1 lib_ifxos-1.5.14.tar.gz - lib_ifxos-1.5.19.tar.gz ltq-vdsl-vr9-mei-1.4.1.tar.gz - drv_mei_cpe-1.4.8.4.tar.gz ltq-vdsl-vr9-4.15.2.tar.gz - drv_dsl_cpe_api_vrx-4.16.2.4.tar.gz ltq-vdsl-app-4.15.2 - drv_dsl_cpe_api_vrx-4.16.2.4.tar.gz [2] https://github.com/xdarklight/drv_mei_cpe [3] https://github.com/xdarklight/drv_dsl_cpe_api_vrx [4] https://github.com/xdarklight/lib_ifxos [5] https://github.com/xdarklight/dsl_cpe_control_vrx Kind regards Flo ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] opkg.conf as preserved config file in sysupgrade is creating problems (especially after package signing)
* Hannu Nyman hannu.ny...@iki.fi [18.06.2015 11:06]: Other possibility could be divide opkg.conf into two: a build-specific default download repo list (to be overwritten in sysupgrade) and a user-specific config file with config options and possible additional download locations (to be preserved). IMHO this is a good idea. A solution can be to have /var/opkg.conf (in ramdisk) and let symlink /etc/opkg.conf to it. the one in the ramdisk is dynamically built from /etc/opkg.conf (buildspecific) and /etc/opkg_user.conf or just patching opkg for loading both (ATM it only supports 1 conffile) bye, bastian ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel