From 0374526a8eddd7221fd5acca0811662e9291d215 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 19 Nov 2019 23:36:20 +0100 Subject: [PATCH 001/105] kernel: remove obsolete kernel 4.9 patch files --- ...d-support-for-ICMP-IGMP-type-matches.patch | 248 ------------------ 1 file changed, 248 deletions(-) diff --git a/patches/openwrt/0005-kernel-ebtables-add-support-for-ICMP-IGMP-type-matches.patch b/patches/openwrt/0005-kernel-ebtables-add-support-for-ICMP-IGMP-type-matches.patch index b21691ac..70d93dc2 100644 --- a/patches/openwrt/0005-kernel-ebtables-add-support-for-ICMP-IGMP-type-matches.patch +++ b/patches/openwrt/0005-kernel-ebtables-add-support-for-ICMP-IGMP-type-matches.patch @@ -252,251 +252,3 @@ index 0000000000000000000000000000000000000000..35b93adc802c2850cd6ee218c3d7d6f6 +-- +2.16.2 + -diff --git a/target/linux/generic/backport-4.9/096-0001-ebtables-add-support-for-matching-ICMP-type-and-code.patch b/target/linux/generic/backport-4.9/096-0001-ebtables-add-support-for-matching-ICMP-type-and-code.patch -new file mode 100644 -index 0000000000000000000000000000000000000000..db82fd6b69b3c4e279f39db7ca4b415498457e75 ---- /dev/null -+++ b/target/linux/generic/backport-4.9/096-0001-ebtables-add-support-for-matching-ICMP-type-and-code.patch -@@ -0,0 +1,141 @@ -+From: Matthias Schiffer -+Date: Sat, 3 Mar 2018 11:55:21 +0100 -+Subject: [PATCH 1/2] ebtables: add support for matching ICMP type and code -+ -+We already have ICMPv6 type/code matches. This adds support for IPv4 ICMP -+matches in the same way. -+ -+Signed-off-by: Matthias Schiffer -+--- -+ include/uapi/linux/netfilter_bridge/ebt_ip.h | 13 +++++++-- -+ net/bridge/netfilter/ebt_ip.c | 43 +++++++++++++++++++++------- -+ 2 files changed, 43 insertions(+), 13 deletions(-) -+ -+diff --git a/include/uapi/linux/netfilter_bridge/ebt_ip.h b/include/uapi/linux/netfilter_bridge/ebt_ip.h -+index c4bbc41b0ea4..63a2860ae1e3 100644 -+--- a/include/uapi/linux/netfilter_bridge/ebt_ip.h -++++ b/include/uapi/linux/netfilter_bridge/ebt_ip.h -+@@ -23,8 +23,9 @@ -+ #define EBT_IP_PROTO 0x08 -+ #define EBT_IP_SPORT 0x10 -+ #define EBT_IP_DPORT 0x20 -++#define EBT_IP_ICMP 0x40 -+ #define EBT_IP_MASK (EBT_IP_SOURCE | EBT_IP_DEST | EBT_IP_TOS | EBT_IP_PROTO |\ -+- EBT_IP_SPORT | EBT_IP_DPORT ) -++ EBT_IP_SPORT | EBT_IP_DPORT | EBT_IP_ICMP) -+ #define EBT_IP_MATCH "ip" -+ -+ /* the same values are used for the invflags */ -+@@ -37,8 +38,14 @@ struct ebt_ip_info { -+ __u8 protocol; -+ __u8 bitmask; -+ __u8 invflags; -+- __u16 sport[2]; -+- __u16 dport[2]; -++ union { -++ __u16 sport[2]; -++ __u8 icmp_type[2]; -++ }; -++ union { -++ __u16 dport[2]; -++ __u8 icmp_code[2]; -++ }; -+ }; -+ -+ #endif -+diff --git a/net/bridge/netfilter/ebt_ip.c b/net/bridge/netfilter/ebt_ip.c -+index d06968bdf5ec..e4fc77072b27 100644 -+--- a/net/bridge/netfilter/ebt_ip.c -++++ b/net/bridge/netfilter/ebt_ip.c -+@@ -19,9 +19,15 @@ -+ #include -+ #include -+ -+-struct tcpudphdr { -+- __be16 src; -+- __be16 dst; -++union pkthdr { -++ struct { -++ __be16 src; -++ __be16 dst; -++ } tcpudphdr; -++ struct { -++ u8 type; -++ u8 code; -++ } icmphdr; -+ }; -+ -+ static bool -+@@ -30,8 +36,8 @@ ebt_ip_mt(const struct sk_buff *skb, struct xt_action_param *par) -+ const struct ebt_ip_info *info = par->matchinfo; -+ const struct iphdr *ih; -+ struct iphdr _iph; -+- const struct tcpudphdr *pptr; -+- struct tcpudphdr _ports; -++ const union pkthdr *pptr; -++ union pkthdr _pkthdr; -+ -+ ih = skb_header_pointer(skb, 0, sizeof(_iph), &_iph); -+ if (ih == NULL) -+@@ -50,29 +56,38 @@ ebt_ip_mt(const struct sk_buff *skb, struct xt_action_param *par) -+ if (info->bitmask & EBT_IP_PROTO) { -+ if (NF_INVF(info, EBT_IP_PROTO, info->protocol != ih->protocol)) -+ return false; -+- if (!(info->bitmask & EBT_IP_DPORT) && -+- !(info->bitmask & EBT_IP_SPORT)) -++ if (!(info->bitmask & (EBT_IP_DPORT | EBT_IP_SPORT | -++ EBT_IP_ICMP))) -+ return true; -+ if (ntohs(ih->frag_off) & IP_OFFSET) -+ return false; -++ -++ /* min icmp headersize is 4, so sizeof(_pkthdr) is ok. */ -+ pptr = skb_header_pointer(skb, ih->ihl*4, -+- sizeof(_ports), &_ports); -++ sizeof(_pkthdr), &_pkthdr); -+ if (pptr == NULL) -+ return false; -+ if (info->bitmask & EBT_IP_DPORT) { -+- u32 dst = ntohs(pptr->dst); -++ u32 dst = ntohs(pptr->tcpudphdr.dst); -+ if (NF_INVF(info, EBT_IP_DPORT, -+ dst < info->dport[0] || -+ dst > info->dport[1])) -+ return false; -+ } -+ if (info->bitmask & EBT_IP_SPORT) { -+- u32 src = ntohs(pptr->src); -++ u32 src = ntohs(pptr->tcpudphdr.src); -+ if (NF_INVF(info, EBT_IP_SPORT, -+ src < info->sport[0] || -+ src > info->sport[1])) -+ return false; -+ } -++ if ((info->bitmask & EBT_IP_ICMP) && -++ NF_INVF(info, EBT_IP_ICMP, -++ pptr->icmphdr.type < info->icmp_type[0] || -++ pptr->icmphdr.type > info->icmp_type[1] || -++ pptr->icmphdr.code < info->icmp_code[0] || -++ pptr->icmphdr.code > info->icmp_code[1])) -++ return false; -+ } -+ return true; -+ } -+@@ -101,6 +116,14 @@ static int ebt_ip_mt_check(const struct xt_mtchk_param *par) -+ return -EINVAL; -+ if (info->bitmask & EBT_IP_SPORT && info->sport[0] > info->sport[1]) -+ return -EINVAL; -++ if (info->bitmask & EBT_IP_ICMP) { -++ if ((info->invflags & EBT_IP_PROTO) || -++ info->protocol != IPPROTO_ICMP) -++ return -EINVAL; -++ if (info->icmp_type[0] > info->icmp_type[1] || -++ info->icmp_code[0] > info->icmp_code[1]) -++ return -EINVAL; -++ } -+ return 0; -+ } -+ -+-- -+2.16.2 -+ -diff --git a/target/linux/generic/backport-4.9/096-0002-ebtables-add-support-for-matching-IGMP-type.patch b/target/linux/generic/backport-4.9/096-0002-ebtables-add-support-for-matching-IGMP-type.patch -new file mode 100644 -index 0000000000000000000000000000000000000000..5750b612fc0f322e0a257f3229b5b698328b428b ---- /dev/null -+++ b/target/linux/generic/backport-4.9/096-0002-ebtables-add-support-for-matching-IGMP-type.patch -@@ -0,0 +1,95 @@ -+From: Matthias Schiffer -+Date: Sat, 3 Mar 2018 12:02:21 +0100 -+Subject: [PATCH 2/2] ebtables: add support for matching IGMP type -+ -+We already have ICMPv6 type/code matches (which can be used to distinguish -+different types of MLD packets). Add support for IPv4 IGMP matches in the -+same way. -+ -+Signed-off-by: Matthias Schiffer -+--- -+ include/uapi/linux/netfilter_bridge/ebt_ip.h | 4 +++- -+ net/bridge/netfilter/ebt_ip.c | 19 +++++++++++++++++-- -+ 2 files changed, 20 insertions(+), 3 deletions(-) -+ -+diff --git a/include/uapi/linux/netfilter_bridge/ebt_ip.h b/include/uapi/linux/netfilter_bridge/ebt_ip.h -+index 63a2860ae1e3..ae5d4d108418 100644 -+--- a/include/uapi/linux/netfilter_bridge/ebt_ip.h -++++ b/include/uapi/linux/netfilter_bridge/ebt_ip.h -+@@ -24,8 +24,9 @@ -+ #define EBT_IP_SPORT 0x10 -+ #define EBT_IP_DPORT 0x20 -+ #define EBT_IP_ICMP 0x40 -++#define EBT_IP_IGMP 0x80 -+ #define EBT_IP_MASK (EBT_IP_SOURCE | EBT_IP_DEST | EBT_IP_TOS | EBT_IP_PROTO |\ -+- EBT_IP_SPORT | EBT_IP_DPORT | EBT_IP_ICMP) -++ EBT_IP_SPORT | EBT_IP_DPORT | EBT_IP_ICMP | EBT_IP_IGMP) -+ #define EBT_IP_MATCH "ip" -+ -+ /* the same values are used for the invflags */ -+@@ -41,6 +42,7 @@ struct ebt_ip_info { -+ union { -+ __u16 sport[2]; -+ __u8 icmp_type[2]; -++ __u8 igmp_type[2]; -+ }; -+ union { -+ __u16 dport[2]; -+diff --git a/net/bridge/netfilter/ebt_ip.c b/net/bridge/netfilter/ebt_ip.c -+index e4fc77072b27..57fbb13cb8e0 100644 -+--- a/net/bridge/netfilter/ebt_ip.c -++++ b/net/bridge/netfilter/ebt_ip.c -+@@ -28,6 +28,9 @@ union pkthdr { -+ u8 type; -+ u8 code; -+ } icmphdr; -++ struct { -++ u8 type; -++ } igmphdr; -+ }; -+ -+ static bool -+@@ -57,12 +60,12 @@ ebt_ip_mt(const struct sk_buff *skb, struct xt_action_param *par) -+ if (NF_INVF(info, EBT_IP_PROTO, info->protocol != ih->protocol)) -+ return false; -+ if (!(info->bitmask & (EBT_IP_DPORT | EBT_IP_SPORT | -+- EBT_IP_ICMP))) -++ EBT_IP_ICMP | EBT_IP_IGMP))) -+ return true; -+ if (ntohs(ih->frag_off) & IP_OFFSET) -+ return false; -+ -+- /* min icmp headersize is 4, so sizeof(_pkthdr) is ok. */ -++ /* min icmp/igmp headersize is 4, so sizeof(_pkthdr) is ok. */ -+ pptr = skb_header_pointer(skb, ih->ihl*4, -+ sizeof(_pkthdr), &_pkthdr); -+ if (pptr == NULL) -+@@ -88,6 +91,11 @@ ebt_ip_mt(const struct sk_buff *skb, struct xt_action_param *par) -+ pptr->icmphdr.code < info->icmp_code[0] || -+ pptr->icmphdr.code > info->icmp_code[1])) -+ return false; -++ if ((info->bitmask & EBT_IP_IGMP) && -++ NF_INVF(info, EBT_IP_IGMP, -++ pptr->igmphdr.type < info->igmp_type[0] || -++ pptr->igmphdr.type > info->igmp_type[1])) -++ return false; -+ } -+ return true; -+ } -+@@ -124,6 +132,13 @@ static int ebt_ip_mt_check(const struct xt_mtchk_param *par) -+ info->icmp_code[0] > info->icmp_code[1]) -+ return -EINVAL; -+ } -++ if (info->bitmask & EBT_IP_IGMP) { -++ if ((info->invflags & EBT_IP_PROTO) || -++ info->protocol != IPPROTO_IGMP) -++ return -EINVAL; -++ if (info->igmp_type[0] > info->igmp_type[1]) -++ return -EINVAL; -++ } -+ return 0; -+ } -+ -+-- -+2.16.2 -+ From 02cbe0b794ea2608952b42767a791d60d2b860d4 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 19 Nov 2019 23:43:37 +0100 Subject: [PATCH 002/105] kernel: refresh patches --- ...d-support-for-ICMP-IGMP-type-matches.patch | 34 ++++++------------- 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/patches/openwrt/0005-kernel-ebtables-add-support-for-ICMP-IGMP-type-matches.patch b/patches/openwrt/0005-kernel-ebtables-add-support-for-ICMP-IGMP-type-matches.patch index 70d93dc2..37698460 100644 --- a/patches/openwrt/0005-kernel-ebtables-add-support-for-ICMP-IGMP-type-matches.patch +++ b/patches/openwrt/0005-kernel-ebtables-add-support-for-ICMP-IGMP-type-matches.patch @@ -6,10 +6,10 @@ Signed-off-by: Matthias Schiffer diff --git a/target/linux/generic/backport-4.14/096-0001-ebtables-add-support-for-matching-ICMP-type-and-code.patch b/target/linux/generic/backport-4.14/096-0001-ebtables-add-support-for-matching-ICMP-type-and-code.patch new file mode 100644 -index 0000000000000000000000000000000000000000..9e4d90fb3b8e2c91e4adf0e0efdb3f4575b5027d +index 0000000000000000000000000000000000000000..fe9c479338a7b597be649c761c70a63085b51c5f --- /dev/null +++ b/target/linux/generic/backport-4.14/096-0001-ebtables-add-support-for-matching-ICMP-type-and-code.patch -@@ -0,0 +1,141 @@ +@@ -0,0 +1,134 @@ +From: Matthias Schiffer +Date: Sat, 3 Mar 2018 11:55:21 +0100 +Subject: [PATCH 1/2] ebtables: add support for matching ICMP type and code @@ -23,8 +23,6 @@ index 0000000000000000000000000000000000000000..9e4d90fb3b8e2c91e4adf0e0efdb3f45 + net/bridge/netfilter/ebt_ip.c | 43 +++++++++++++++++++++------- + 2 files changed, 43 insertions(+), 13 deletions(-) + -+diff --git a/include/uapi/linux/netfilter_bridge/ebt_ip.h b/include/uapi/linux/netfilter_bridge/ebt_ip.h -+index 8e462fb1983f..4ed7fbb0a482 100644 +--- a/include/uapi/linux/netfilter_bridge/ebt_ip.h ++++ b/include/uapi/linux/netfilter_bridge/ebt_ip.h +@@ -24,8 +24,9 @@ @@ -55,8 +53,6 @@ index 0000000000000000000000000000000000000000..9e4d90fb3b8e2c91e4adf0e0efdb3f45 + }; + + #endif -+diff --git a/net/bridge/netfilter/ebt_ip.c b/net/bridge/netfilter/ebt_ip.c -+index 2b46c50abce0..8cb8f8395768 100644 +--- a/net/bridge/netfilter/ebt_ip.c ++++ b/net/bridge/netfilter/ebt_ip.c +@@ -19,9 +19,15 @@ @@ -78,7 +74,7 @@ index 0000000000000000000000000000000000000000..9e4d90fb3b8e2c91e4adf0e0efdb3f45 + }; + + static bool -+@@ -30,8 +36,8 @@ ebt_ip_mt(const struct sk_buff *skb, struct xt_action_param *par) ++@@ -30,8 +36,8 @@ ebt_ip_mt(const struct sk_buff *skb, str + const struct ebt_ip_info *info = par->matchinfo; + const struct iphdr *ih; + struct iphdr _iph; @@ -89,7 +85,7 @@ index 0000000000000000000000000000000000000000..9e4d90fb3b8e2c91e4adf0e0efdb3f45 + + ih = skb_header_pointer(skb, 0, sizeof(_iph), &_iph); + if (ih == NULL) -+@@ -50,29 +56,38 @@ ebt_ip_mt(const struct sk_buff *skb, struct xt_action_param *par) ++@@ -50,29 +56,38 @@ ebt_ip_mt(const struct sk_buff *skb, str + if (info->bitmask & EBT_IP_PROTO) { + if (NF_INVF(info, EBT_IP_PROTO, info->protocol != ih->protocol)) + return false; @@ -133,7 +129,7 @@ index 0000000000000000000000000000000000000000..9e4d90fb3b8e2c91e4adf0e0efdb3f45 + } + return true; + } -+@@ -101,6 +116,14 @@ static int ebt_ip_mt_check(const struct xt_mtchk_param *par) ++@@ -101,6 +116,14 @@ static int ebt_ip_mt_check(const struct + return -EINVAL; + if (info->bitmask & EBT_IP_SPORT && info->sport[0] > info->sport[1]) + return -EINVAL; @@ -148,15 +144,12 @@ index 0000000000000000000000000000000000000000..9e4d90fb3b8e2c91e4adf0e0efdb3f45 + return 0; + } + -+-- -+2.16.2 -+ diff --git a/target/linux/generic/backport-4.14/096-0002-ebtables-add-support-for-matching-IGMP-type.patch b/target/linux/generic/backport-4.14/096-0002-ebtables-add-support-for-matching-IGMP-type.patch new file mode 100644 -index 0000000000000000000000000000000000000000..35b93adc802c2850cd6ee218c3d7d6f6c53bba29 +index 0000000000000000000000000000000000000000..4c8144834d87c58ff90363cdc2f2933194e54fdc --- /dev/null +++ b/target/linux/generic/backport-4.14/096-0002-ebtables-add-support-for-matching-IGMP-type.patch -@@ -0,0 +1,95 @@ +@@ -0,0 +1,88 @@ +From: Matthias Schiffer +Date: Sat, 3 Mar 2018 12:02:21 +0100 +Subject: [PATCH 2/2] ebtables: add support for matching IGMP type @@ -171,8 +164,6 @@ index 0000000000000000000000000000000000000000..35b93adc802c2850cd6ee218c3d7d6f6 + net/bridge/netfilter/ebt_ip.c | 19 +++++++++++++++++-- + 2 files changed, 20 insertions(+), 3 deletions(-) + -+diff --git a/include/uapi/linux/netfilter_bridge/ebt_ip.h b/include/uapi/linux/netfilter_bridge/ebt_ip.h -+index 4ed7fbb0a482..46d6261370b0 100644 +--- a/include/uapi/linux/netfilter_bridge/ebt_ip.h ++++ b/include/uapi/linux/netfilter_bridge/ebt_ip.h +@@ -25,8 +25,9 @@ @@ -194,8 +185,6 @@ index 0000000000000000000000000000000000000000..35b93adc802c2850cd6ee218c3d7d6f6 + }; + union { + __u16 dport[2]; -+diff --git a/net/bridge/netfilter/ebt_ip.c b/net/bridge/netfilter/ebt_ip.c -+index 8cb8f8395768..ffaa8ce2e724 100644 +--- a/net/bridge/netfilter/ebt_ip.c ++++ b/net/bridge/netfilter/ebt_ip.c +@@ -28,6 +28,9 @@ union pkthdr { @@ -208,7 +197,7 @@ index 0000000000000000000000000000000000000000..35b93adc802c2850cd6ee218c3d7d6f6 + }; + + static bool -+@@ -57,12 +60,12 @@ ebt_ip_mt(const struct sk_buff *skb, struct xt_action_param *par) ++@@ -57,12 +60,12 @@ ebt_ip_mt(const struct sk_buff *skb, str + if (NF_INVF(info, EBT_IP_PROTO, info->protocol != ih->protocol)) + return false; + if (!(info->bitmask & (EBT_IP_DPORT | EBT_IP_SPORT | @@ -223,7 +212,7 @@ index 0000000000000000000000000000000000000000..35b93adc802c2850cd6ee218c3d7d6f6 + pptr = skb_header_pointer(skb, ih->ihl*4, + sizeof(_pkthdr), &_pkthdr); + if (pptr == NULL) -+@@ -88,6 +91,11 @@ ebt_ip_mt(const struct sk_buff *skb, struct xt_action_param *par) ++@@ -88,6 +91,11 @@ ebt_ip_mt(const struct sk_buff *skb, str + pptr->icmphdr.code < info->icmp_code[0] || + pptr->icmphdr.code > info->icmp_code[1])) + return false; @@ -235,7 +224,7 @@ index 0000000000000000000000000000000000000000..35b93adc802c2850cd6ee218c3d7d6f6 + } + return true; + } -+@@ -124,6 +132,13 @@ static int ebt_ip_mt_check(const struct xt_mtchk_param *par) ++@@ -124,6 +132,13 @@ static int ebt_ip_mt_check(const struct + info->icmp_code[0] > info->icmp_code[1]) + return -EINVAL; + } @@ -249,6 +238,3 @@ index 0000000000000000000000000000000000000000..35b93adc802c2850cd6ee218c3d7d6f6 + return 0; + } + -+-- -+2.16.2 -+ From fe41ba71217a2cfa71bcd379c6e311e8e7c5270e Mon Sep 17 00:00:00 2001 From: David Bauer Date: Wed, 20 Nov 2019 13:39:22 +0100 Subject: [PATCH 003/105] ath79-generic: add support for devolo WiFi pro 1200i (#1871) --- docs/user/supported_devices.rst | 6 +++++- targets/ath79-generic | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index 250d51d6..20f795fe 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -183,6 +183,10 @@ ar71xx-tiny [#deprecated]_ ath79-generic -------------- +* devolo + + - WiFi pro 1200i + * TP-Link - Archer C6 (v2) @@ -382,4 +386,4 @@ Footnotes .. [#eva_ramboot] For instructions on how to flash AVM NAND devices, see the respective - commit which added support in OpenWrt. \ No newline at end of file + commit which added support in OpenWrt. diff --git a/targets/ath79-generic b/targets/ath79-generic index 22470632..1e585620 100644 --- a/targets/ath79-generic +++ b/targets/ath79-generic @@ -5,6 +5,12 @@ local ATH10K_PACKAGES_QCA9888 = { '-ath10k-firmware-qca9888-ct', } +-- devolo + +device('devolo-wifi-pro-1200i', 'devolo_dvl1200i', { + factory = false, +}) + -- TP-Link device('tp-link-archer-c6-v2', 'tplink_archer-c6-v2', { From 3ca6abe7b149255143f7b6b05cde9a20308491da Mon Sep 17 00:00:00 2001 From: David Bauer Date: Wed, 20 Nov 2019 13:46:18 +0100 Subject: [PATCH 004/105] ath79-generic: add support for OCEDO Raccoon (#1869) --- docs/user/supported_devices.rst | 4 ++++ package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac | 2 ++ targets/ath79-generic | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index 20f795fe..1ea887c7 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -187,6 +187,10 @@ ath79-generic - WiFi pro 1200i + * OCEDO + + - Raccoon + * TP-Link - Archer C6 (v2) diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac b/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac index 600a147f..5520a81a 100755 --- a/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac +++ b/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac @@ -50,6 +50,8 @@ elseif platform.match('ar71xx', 'generic', {'archer-c5', 'archer-c58-v1', table.insert(try_files, 1, '/sys/class/net/eth1/address') elseif platform.match('ar71xx', 'nand', {'hiveap-121'}) then table.insert(try_files, 1, '/sys/class/net/eth0/address') +elseif platform.match('ath79', 'generic', {'ocedo,raccoon'}) then + table.insert(try_files, 1, '/sys/class/net/eth0/address') elseif platform.match('ipq40xx', 'generic', {'avm,fritzbox-4040', 'openmesh,a42', 'openmesh,a62'}) then table.insert(try_files, 1, '/sys/class/net/eth0/address') diff --git a/targets/ath79-generic b/targets/ath79-generic index 1e585620..994ba3a1 100644 --- a/targets/ath79-generic +++ b/targets/ath79-generic @@ -11,6 +11,12 @@ device('devolo-wifi-pro-1200i', 'devolo_dvl1200i', { factory = false, }) +-- OCEDO + +device('ocedo-raccoon', 'ocedo_raccoon', { + factory = false, +}) + -- TP-Link device('tp-link-archer-c6-v2', 'tplink_archer-c6-v2', { From 9b4d59c5e0e17725f1ae1cc3531cab19fb1c50b8 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 20 Nov 2019 14:17:52 +0100 Subject: [PATCH 005/105] modules: update OpenWrt ca3339c0fc ipq40xx: fix build error 75d11f665c mac80211: backport upstream fixes dd284c6c57 toolchain/gcc: bump to 7.5.0 3c5c49af8b kernel: bump 4.14 to 4.14.154 17d8e47d35 mac80211: Adapt to changes to skb_get_hash_perturb() 67957cd807 mac80211: brcmfmac: fix PCIe reset crash and WARNING compile-tested: ipq40xx-generic, ath79-generic --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index cfd3a689..ffa2c159 100644 --- a/modules +++ b/modules @@ -2,7 +2,7 @@ GLUON_FEEDS='packages routing luci gluon' OPENWRT_REPO=https://git.openwrt.org/openwrt/openwrt.git OPENWRT_BRANCH=openwrt-19.07 -OPENWRT_COMMIT=a8b293598f181f358ba8ac988ef75a97064792e0 +OPENWRT_COMMIT=ca3339c0fc8a86e805beb09a1f230d318cedb9a6 PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git PACKAGES_PACKAGES_BRANCH=openwrt-19.07 From e30b0092bb00ea51d3d08838b6ab0c401095fc3a Mon Sep 17 00:00:00 2001 From: David Bauer Date: Wed, 20 Nov 2019 16:21:25 +0100 Subject: [PATCH 006/105] ath79-generic: add missing ath10k packages The devolo WiFi pro 1200i lost it's ath10k package definitions while rebasing, thus selecting the wrong package set. Fix it by adding the correct firmware and driver. --- targets/ath79-generic | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/targets/ath79-generic b/targets/ath79-generic index 994ba3a1..7c3a3990 100644 --- a/targets/ath79-generic +++ b/targets/ath79-generic @@ -1,3 +1,10 @@ +local ATH10K_PACKAGES_QCA9880 = { + 'kmod-ath10k', + '-kmod-ath10k-ct', + 'ath10k-firmware-qca988x', + '-ath10k-firmware-qca988x-ct', +} + local ATH10K_PACKAGES_QCA9888 = { 'kmod-ath10k', '-kmod-ath10k-ct', @@ -8,6 +15,7 @@ local ATH10K_PACKAGES_QCA9888 = { -- devolo device('devolo-wifi-pro-1200i', 'devolo_dvl1200i', { + packages = ATH10K_PACKAGES_QCA9880, factory = false, }) From ee917a7ea97aa2fc49b9110f200444b01230b6be Mon Sep 17 00:00:00 2001 From: Simon Terzenbach Date: Wed, 20 Nov 2019 14:20:27 +0100 Subject: [PATCH 007/105] ath79-generic: add support for devolo WiFi pro 1750i --- docs/user/supported_devices.rst | 1 + targets/ath79-generic | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index 1ea887c7..aa8fce1e 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -186,6 +186,7 @@ ath79-generic * devolo - WiFi pro 1200i + - WiFi pro 1750i * OCEDO diff --git a/targets/ath79-generic b/targets/ath79-generic index 7c3a3990..d5f18b8e 100644 --- a/targets/ath79-generic +++ b/targets/ath79-generic @@ -19,6 +19,11 @@ device('devolo-wifi-pro-1200i', 'devolo_dvl1200i', { factory = false, }) +device('devolo-wifi-pro-1750i', 'devolo_dvl1750i', { + packages = ATH10K_PACKAGES_QCA9880, + factory = false, +}) + -- OCEDO device('ocedo-raccoon', 'ocedo_raccoon', { From 4e3f1053da325cb26cac1b69f8e7b561c34e84a9 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Fri, 22 Nov 2019 01:45:00 +0100 Subject: [PATCH 008/105] ath79-generic: add support for devolo WiFi pro 1750c (#1875) --- docs/user/supported_devices.rst | 1 + targets/ath79-generic | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index aa8fce1e..5feaa2b1 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -186,6 +186,7 @@ ath79-generic * devolo - WiFi pro 1200i + - WiFi pro 1750c - WiFi pro 1750i * OCEDO diff --git a/targets/ath79-generic b/targets/ath79-generic index d5f18b8e..ba169e4e 100644 --- a/targets/ath79-generic +++ b/targets/ath79-generic @@ -19,6 +19,11 @@ device('devolo-wifi-pro-1200i', 'devolo_dvl1200i', { factory = false, }) +device('devolo-wifi-pro-1750c', 'devolo_dvl1750c', { + packages = ATH10K_PACKAGES_QCA9880, + factory = false, +}) + device('devolo-wifi-pro-1750i', 'devolo_dvl1750i', { packages = ATH10K_PACKAGES_QCA9880, factory = false, From c3e764d1df580e46815b49c4a4a6f280c83772c3 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 22 Nov 2019 22:45:19 +0100 Subject: [PATCH 009/105] modules: update OpenWrt base 6160f773fef2 ipq40xx: add support for AVM FRITZ!Repeater 1200 63b1e8f8d226 ipq-wifi: add AVM FRITZ!Repeater 1200 bdf 496489ea95af uboot-fritz4040: update to latest HEAD e30ca0d90a98 mac80211: update to version 4.19.85 b1ef0e443720 layerscape: Fix kernel patch ad0463c2e875 kernel: Add missing configuration option b0adf79c9e7c firewall: update to latest Git HEAD b41619592792 firewall: update to latest git HEAD 3685f86cefac cns3xxx: use proper macros for defining partition regions db345220b485 kernel: bump 4.14 to 4.14.155 538ca42ddad8 wireless-regdb: fix build when python2 from package feeds exists 2751c5c75219 wireless-regdb: fix patch fuzz d6ecadb05c2b wireless-regdb: fix Makefile indentation 0a4071b550eb wireless-regdb: set PKGARCH:=all e8d528af7e91 wireless-regdb: prefer python provided by make variable 53d8de0207e8 wireless-regdb: Make it build with python2 f2ef9b4feafe wireless-regdb: update to 2019.06.03 8fac0b398c34 ar71xx: fix buttons for TP-Link TL-WDR4900 v2 3c65c47ce6fd ar71xx: fix LED setup for TL-WDR4900 v2 b6c80f85cb7b ramips: set uImage name of WeVO 11AC NAS and W2914NS v2 e945c43142ab ar71xx: fix MAC address setup for TL-WDR4900 v2 8a21bc36229d ar71xx: fix MAC addresses for Archer C5 v1, C7 v1/v2, WDR4900 v2 --- modules | 2 +- ...wifi-add-AVM-FRITZ-Repeater-1200-bdf.patch | 87 ---- ...-support-for-AVM-FRITZ-Repeater-1200.patch | 374 ------------------ 3 files changed, 1 insertion(+), 462 deletions(-) delete mode 100644 patches/openwrt/0006-ipq-wifi-add-AVM-FRITZ-Repeater-1200-bdf.patch delete mode 100644 patches/openwrt/0007-ipq40xx-add-support-for-AVM-FRITZ-Repeater-1200.patch diff --git a/modules b/modules index ffa2c159..1a3cb66b 100644 --- a/modules +++ b/modules @@ -2,7 +2,7 @@ GLUON_FEEDS='packages routing luci gluon' OPENWRT_REPO=https://git.openwrt.org/openwrt/openwrt.git OPENWRT_BRANCH=openwrt-19.07 -OPENWRT_COMMIT=ca3339c0fc8a86e805beb09a1f230d318cedb9a6 +OPENWRT_COMMIT=6160f773fef2e204065a398abdd1504913a1bf8e PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git PACKAGES_PACKAGES_BRANCH=openwrt-19.07 diff --git a/patches/openwrt/0006-ipq-wifi-add-AVM-FRITZ-Repeater-1200-bdf.patch b/patches/openwrt/0006-ipq-wifi-add-AVM-FRITZ-Repeater-1200-bdf.patch deleted file mode 100644 index 6b4e48b6..00000000 --- a/patches/openwrt/0006-ipq-wifi-add-AVM-FRITZ-Repeater-1200-bdf.patch +++ /dev/null @@ -1,87 +0,0 @@ -From: David Bauer -Date: Sat, 21 Sep 2019 18:59:28 +0200 -Subject: ipq-wifi: add AVM FRITZ!Repeater 1200 bdf - -Signed-off-by: David Bauer - -diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile -index 922064b7f78b80670cdb1ec7e9f86ede224cb7fb..eb7c2df1aa36ded7774a772c8a7e02b2acb81b40 100644 ---- a/package/firmware/ipq-wifi/Makefile -+++ b/package/firmware/ipq-wifi/Makefile -@@ -27,6 +27,7 @@ ALLWIFIBOARDS:= \ - alfa-network_ap120c-ac \ - asus_map-ac2200 \ - avm_fritzbox-7530 \ -+ avm_fritzrepeater-1200 \ - avm_fritzrepeater-3000 \ - engenius_eap1300 \ - engenius_ens620ext \ -@@ -98,6 +99,7 @@ endef - $(eval $(call generate-ipq-wifi-package,alfa-network_ap120c-ac,ALFA Network AP120C-AC)) - $(eval $(call generate-ipq-wifi-package,asus_map-ac2200,ASUS MAP-AC2200)) - $(eval $(call generate-ipq-wifi-package,avm_fritzbox-7530,AVM FRITZ!Box 7530)) -+$(eval $(call generate-ipq-wifi-package,avm_fritzrepeater-1200,AVM FRITZRepeater 1200)) - $(eval $(call generate-ipq-wifi-package,avm_fritzrepeater-3000,AVM FRITZ!Repeater 3000)) - $(eval $(call generate-ipq-wifi-package,engenius_eap1300,EnGenius EAP1300)) - $(eval $(call generate-ipq-wifi-package,engenius_ens620ext,EnGenius ENS620EXT)) -diff --git a/package/firmware/ipq-wifi/board-avm_fritzrepeater-1200.qca4019 b/package/firmware/ipq-wifi/board-avm_fritzrepeater-1200.qca4019 -new file mode 100644 -index 0000000000000000000000000000000000000000..d78a49d4dbf3fc22c40a83d052fc7c55542ff8e3 -GIT binary patch -literal 24332 -zcmeHPTTl~O8a_d8Dk`0XTL?`^xFjwK5Lk^61wv#JXn|o7A-XOgCAEojsjSAdzHD5LPbzhtuaj -zf1m&S|M|L;bocql=Nak3^a4dfe6~=Qo1QNRH8nK=N_`x$1wal<*^#>KrIlr|Wi@Ky -zfl9Sjs4m|gZ*G;rhrZ_&fp;V_X{i1$*df_f%X1=mOm0zK)D6Oy12@}Ne@iaIN -z2ad^!oA9U6z?$Rqq(Wl+&4a)LlmM{K$De2dxaB6o+84eYi9nD@3AEI@MvulP*S_ -z?YC}bNDd%hGX{&oq}y5?$9?ExTw)|*X10X^+eBeo3as3c_3Jlobj!g(XRZU=r!Z+d -z#);F$BK8@)8kuNs*Qk}M)K?SzZO!GXY~{8`qy4Abb?VQRTON%;txlb<{OwyPx9y -z+I&DIhuyCCw?o%#3IEYV|Al6)Dqj+Bafq?c?*px7C?DuzzngNf$HQ@JC7|SZX3NX^ -zWU%VXEKU5Lz|`?8b!}VAqjs~hAC4aG%{o;sd7y&^cp<&_HPyE@M_>7$utCw93 -zFNgr3(L6jnXvB8S8ZR#|Z;SYhbT*YJo}I|!Gb1B;@GpuR5y9g|aJhw^zQA&YVmBJq -zSX2Z$I~y7b3b0HGSij!en+zopMDe)XaM)n_{O9evcL7i%ZG17RnN_Fn`n^2}Wh8OeA|Q -zL$c5;Q5KelrXdPcjEY6#=VBxoO%^3%@n}3EL1&UM4mnn5a*|4CvZB;E$Hx^&7%1a4 -z0|`Y#MWI**n(;aV$wsq9*;pc)_&O0uK~qF27SI>>H)+!4YV-+7lYU(Qm0asTD -zT!#dFE2G -zML^+%L;QlE0&60_rDR*`r|U%@1f(SaV4x$kKq#G-`l6-g`yxOJq@HO20e^oiXaOJr -z@DRwOg2WpxX_)L$WK|wl{<2+j$EC? -z@(POfm6TT+IxqHI9vmJSzcqR9;a`6E@rC<4Y}WDIyK-GNy@7ch6r;CUS3=EepqQ-9 -zx(aGu|HQ;?))i3qL3HY|^3h#3r@_if)Ri^koWlJFJG!r2$L~)4&6&QkP??<#^Bogm -zqihiyV*>d*If9{>2*czc>0J^cMWrGsmb75^*RxUG(E`PR2ujZsXCgWDE#fW64!Ww3 -zc+DNd`aNf@m&+}VyWIN(m$~;?H;o2~_f4Hrow9cAVsh`(n1jrh4*$==4i=}4v9U3y`{wR|$J$2b?swI)DwlMr -zNxO1-EJ2i9Nt^0JAwVHOA+TH#C@E1DlH7Yb-G2i)3pcs&kN!Th=|Po6{vHxaeErjcm)iC-je` -z-bZ0Y!~^e#FKliv?9>l^cub!$RpXd3!N8twGgaZ)MzJAm>aMX{f4DeP5;b)jA2#SU -z#S%90|6-SWV)$UX%hZgkjA;hp^d*xX-)oc^;_yl1phi=iBZ-~*v+;tyrdTH75Dv!P -zm>4kKXF7==GUge!PY;;R;MK<6dLjO;pJ>Zr!R826n!RL7#y%n?qp2OQ(#wk@r-w}Eah+keW(WSAp;yzO -zQ1C;i?inwcQwk?iy3)so5qeBt;Rp0P6fEf4hO6~5MJWC!4i9T5oGTm!x#mn_lMF>o!SAV29TOu&s#rq68O|Bx6j39t1oi{b% -zMS8Ju;WY@=^|cV?^LFssZj^ZVh7bKCX2LqWxV -z?P^k`3Znypz3yB(R+S|a$At!;A1v%hILgs%%6WRT`a)VuR87eKXMO6ttufI-06ZEv -zTCK)7*Ul7_pNo_2e*?sCpKeq(UOsy%V2iBkxy00chvmpFWE#Q`3JZCZt-NhKBYqoN|= -zAN&;#4lg2t8&T-BWPXWbE-&6nz4u+Pb^Ez7tknCp3l_rx{FI48V15X=O8i*pe)G$A -z#duNNd&rAlMBe^V;@LaOWvQRYBal;1a^Mj&kDlPzuWJ>w$RSsL^EPfeS;7x*-exXW -z{XG-RTzY~}@6)ml7NYjzn7Q`^-`-2`PcsLfhoXC`4QZBPsoig>KXZAF}U%I -zjjc1zz199HdG|zYihDo1G&c{8;@-~#G|FXZBjC!Ku`|BCt$k_Fa{k#--227;*8KJH -F{|7QKi|GIW - -literal 0 -HcmV?d00001 - diff --git a/patches/openwrt/0007-ipq40xx-add-support-for-AVM-FRITZ-Repeater-1200.patch b/patches/openwrt/0007-ipq40xx-add-support-for-AVM-FRITZ-Repeater-1200.patch deleted file mode 100644 index c080a09a..00000000 --- a/patches/openwrt/0007-ipq40xx-add-support-for-AVM-FRITZ-Repeater-1200.patch +++ /dev/null @@ -1,374 +0,0 @@ -From: David Bauer -Date: Tue, 10 Sep 2019 21:07:23 +0200 -Subject: ipq40xx: add support for AVM FRITZ!Repeater 1200 - -Signed-off-by: David Bauer - -diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network -index 6a7b09cc603a245e98c37305c1f25c2cc11694ae..01825b8bac46eec6325de00396d96307c946f975 100755 ---- a/target/linux/ipq40xx/base-files/etc/board.d/02_network -+++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network -@@ -39,10 +39,7 @@ ipq40xx_setup_interfaces() - ucidef_add_switch "switch0" \ - "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan" - ;; -- avm,fritzrepeater-3000|\ -- compex,wpj428) -- ucidef_set_interface_lan "eth0 eth1" -- ;; -+ avm,fritzrepeater-1200|\ - engenius,eap1300|\ - meraki,mr33|\ - netgear,ex6100v2|\ -@@ -50,6 +47,10 @@ ipq40xx_setup_interfaces() - zyxel,wre6606) - ucidef_set_interface_lan "eth0" - ;; -+ avm,fritzrepeater-3000|\ -+ compex,wpj428) -+ ucidef_set_interface_lan "eth0 eth1" -+ ;; - glinet,gl-b1300) - ucidef_set_interfaces_lan_wan "eth0" "eth1" - ucidef_add_switch "switch0" \ -diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata -index 5f7e5f4923f19ecd78a981be55230cfcd3779146..b0035ce8a394b6e87d7d89b9f55a6ec7c66e448e 100644 ---- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata -+++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata -@@ -148,6 +148,7 @@ case "$FIRMWARE" in - /usr/bin/fritz_cal_extract -i 1 -s 0x400 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader_config") - ;; - avm,fritzbox-7530 |\ -+ avm,fritzrepeater-1200 |\ - avm,fritzrepeater-3000) - /usr/bin/fritz_cal_extract -i 1 -s 0x3C000 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader0") || \ - /usr/bin/fritz_cal_extract -i 1 -s 0x3C800 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader0") || \ -@@ -209,6 +210,7 @@ case "$FIRMWARE" in - /usr/bin/fritz_cal_extract -i 1 -s 0x400 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader_config") - ;; - avm,fritzbox-7530 |\ -+ avm,fritzrepeater-1200 |\ - avm,fritzrepeater-3000) - /usr/bin/fritz_cal_extract -i 1 -s 0x3C800 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader0") || \ - /usr/bin/fritz_cal_extract -i 1 -s 0x3D000 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader0") || \ -diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh -index 2abafabbd0589c07bcd2ceee766d3d7675ba9716..a7b7da1bf378f7cc19e960c497bc52efb3bae4fb 100644 ---- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh -+++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh -@@ -49,6 +49,7 @@ platform_do_upgrade() { - 8dev,jalapeno |\ - alfa-network,ap120c-ac |\ - avm,fritzbox-7530 |\ -+ avm,fritzrepeater-1200 |\ - avm,fritzrepeater-3000 |\ - qxwlan,e2600ac-c2) - nand_do_upgrade "$1" -diff --git a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4019-fritzrepeater-1200.dts b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4019-fritzrepeater-1200.dts -new file mode 100644 -index 0000000000000000000000000000000000000000..4d02f8a8384f386c92c70ef24b677ee95058a1bf ---- /dev/null -+++ b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4019-fritzrepeater-1200.dts -@@ -0,0 +1,262 @@ -+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT -+ -+#include "qcom-ipq4019.dtsi" -+#include -+#include -+#include -+ -+/ { -+ model = "AVM FRITZ!Repeater 1200"; -+ compatible = "avm,fritzrepeater-1200"; -+ -+ aliases { -+ led-boot = &power_green; -+ led-failsafe = &power_red; -+ led-running = &power_green; -+ led-upgrade = &power_red; -+ }; -+ -+ soc { -+ mdio@90000 { -+ status = "okay"; -+ pinctrl-0 = <&mdio_pins>; -+ pinctrl-names = "default"; -+ }; -+ -+ tcsr@1949000 { -+ compatible = "qcom,tcsr"; -+ reg = <0x1949000 0x100>; -+ qcom,wifi_glb_cfg = ; -+ }; -+ -+ ess_tcsr@1953000 { -+ compatible = "qcom,tcsr"; -+ reg = <0x1953000 0x1000>; -+ qcom,ess-interface-select = ; -+ }; -+ -+ tcsr@1957000 { -+ compatible = "qcom,tcsr"; -+ reg = <0x1957000 0x100>; -+ qcom,wifi_noc_memtype_m0_m2 = ; -+ }; -+ -+ crypto@8e3a000 { -+ status = "okay"; -+ }; -+ -+ watchdog@b017000 { -+ status = "okay"; -+ }; -+ -+ ess-switch@c000000 { -+ switch_mac_mode = <0x3>; /* mac mode for RGMII RMII */ -+ switch_lan_bmp = <0x0>; /* lan port bitmap */ -+ switch_wan_bmp = <0x10>; /* wan port bitmap */ -+ }; -+ -+ edma@c080000 { -+ status = "okay"; -+ phy-mode = "rgmii-rxid"; -+ qcom,num_gmac = <1>; -+ qcom,single-phy; -+ }; -+ }; -+ -+ key { -+ compatible = "gpio-keys"; -+ -+ wps { -+ label = "WPS button"; -+ gpios = <&tlmm 10 GPIO_ACTIVE_LOW>; -+ linux,code = ; -+ }; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ -+ power_red: power_red { -+ label = "fritzwlan-1200:red:power"; -+ gpios = <&tlmm 50 GPIO_ACTIVE_LOW>; -+ }; -+ -+ power_green: power_green { -+ label = "fritzwlan-1200:green:power"; -+ gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>; -+ }; -+ -+ power_yellow { -+ label = "fritzwlan-1200:yellow:power"; -+ gpios = <&tlmm 49 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+}; -+ -+&tlmm { -+ serial_0_pins: serial_pinmux { -+ mux { -+ pins = "gpio16", "gpio17"; -+ function = "blsp_uart0"; -+ bias-disable; -+ }; -+ }; -+ -+ nand_pins: nand_pins { -+ pullups { -+ pins = "gpio53", "gpio58", "gpio59"; -+ function = "qpic"; -+ bias-pull-up; -+ }; -+ -+ pulldowns { -+ pins = "gpio54", "gpio55", "gpio56", -+ "gpio57", "gpio60", "gpio61", -+ "gpio62", "gpio63", "gpio64", -+ "gpio65", "gpio66", "gpio67", -+ "gpio68", "gpio69"; -+ function = "qpic"; -+ bias-pull-down; -+ }; -+ }; -+ -+ mdio_pins: mdio_pinmux { -+ mux_1 { -+ pins = "gpio6"; -+ function = "mdio"; -+ bias-pull-up; -+ }; -+ mux_2 { -+ pins = "gpio7"; -+ function = "mdc"; -+ bias-pull-up; -+ }; -+ }; -+ -+ phy-reset { -+ line-name = "PHY-reset"; -+ gpios = <19 GPIO_ACTIVE_HIGH>; -+ gpio-hog; -+ output-high; -+ }; -+ -+ phy-reset-2 { -+ line-name = "PHY-reset-2"; -+ gpios = <47 GPIO_ACTIVE_HIGH>; -+ gpio-hog; -+ output-high; -+ }; -+}; -+ -+&nand { -+ pinctrl-0 = <&nand_pins>; -+ pinctrl-names = "default"; -+ status = "okay"; -+ -+ nand@0 { -+ partitions { -+ compatible = "fixed-partitions"; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ -+ partition@0 { -+ label = "SBL1"; -+ reg = <0x000000 0x80000>; -+ read-only; -+ }; -+ -+ partition@80000 { -+ label = "MIBIB"; -+ reg = <0x080000 0x80000>; -+ read-only; -+ }; -+ -+ partition@100000 { -+ label = "QSEE"; -+ reg = <0x100000 0x80000>; -+ read-only; -+ }; -+ -+ partition@180000 { -+ label = "CDT"; -+ reg = <0x180000 0x40000>; -+ read-only; -+ }; -+ -+ partition@1c0000 { -+ label = "QSEE_B"; -+ reg = <0x1c0000 0x80000>; -+ read-only; -+ }; -+ -+ partition@240000 { -+ label = "urlader0"; -+ reg = <0x240000 0x40000>; -+ read-only; -+ }; -+ -+ partition@280000 { -+ label = "urlader1"; -+ reg = <0x280000 0x40000>; -+ read-only; -+ }; -+ -+ partition@2c0000 { -+ label = "nand-tffs"; -+ reg = <0x2c0000 0x840000>; -+ read-only; -+ }; -+ -+ partition@b00000 { -+ /* 'kernel1' in AVM firmware */ -+ label = "uboot0"; -+ reg = <0xb00000 0x400000>; -+ }; -+ -+ partition@f00000 { -+ /* 'kernel2' in AVM firmware */ -+ label = "uboot1"; -+ reg = <0xf00000 0x400000>; -+ }; -+ -+ partition@1300000 { -+ label = "ubi"; -+ reg = <0x1300000 0x6d00000>; -+ }; -+ }; -+ }; -+}; -+ -+&cryptobam { -+ status = "okay"; -+}; -+ -+&blsp_dma { -+ status = "okay"; -+}; -+ -+&blsp1_uart1 { -+ pinctrl-0 = <&serial_0_pins>; -+ pinctrl-names = "default"; -+ status = "okay"; -+}; -+ -+&qpic_bam { -+ status = "okay"; -+}; -+ -+&wifi0 { -+ status = "okay"; -+ qcom,ath10k-calibration-variant = "AVM-FRITZRepeater-1200"; -+}; -+ -+&wifi1 { -+ status = "okay"; -+ qcom,ath10k-calibration-variant = "AVM-FRITZRepeater-1200"; -+}; -+ -+&gmac0 { -+ qcom,phy_mdio_addr = <0>; -+ qcom,poll_required = <1>; -+ vlan_tag = <0 0x20>; -+}; -diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile -index 3a9b58de4f01f17ac9df368729035d630eb32b04..bdbbcbe851e60ee5a445c576a870a87a46c57fee 100644 ---- a/target/linux/ipq40xx/image/Makefile -+++ b/target/linux/ipq40xx/image/Makefile -@@ -138,6 +138,15 @@ define Device/avm_fritzbox-7530 - endef - TARGET_DEVICES += avm_fritzbox-7530 - -+define Device/avm_fritzrepeater-1200 -+ $(call Device/FitImageLzma) -+ DEVICE_DTS := qcom-ipq4019-fritzrepeater-1200 -+ DEVICE_TITLE := AVM Fritz!Repeater 1200 -+ DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand ipq-wifi-avm_fritzrepeater-1200 -+ IMAGES := sysupgrade.bin -+endef -+TARGET_DEVICES += avm_fritzrepeater-1200 -+ - define Device/avm_fritzrepeater-3000 - $(call Device/FitImageLzma) - DEVICE_DTS := qcom-ipq4019-fritzrepeater-3000 -diff --git a/target/linux/ipq40xx/patches-4.14/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-4.14/901-arm-boot-add-dts-files.patch -index bb539155e98b75df5dd88e39f6405af5a82e0320..f7efd415f1f1c000867793b3b133e44b3e50b0fd 100644 ---- a/target/linux/ipq40xx/patches-4.14/901-arm-boot-add-dts-files.patch -+++ b/target/linux/ipq40xx/patches-4.14/901-arm-boot-add-dts-files.patch -@@ -10,7 +10,7 @@ Signed-off-by: John Crispin - - --- a/arch/arm/boot/dts/Makefile - +++ b/arch/arm/boot/dts/Makefile --@@ -697,7 +697,30 @@ dtb-$(CONFIG_ARCH_QCOM) += \ -+@@ -697,7 +697,31 @@ dtb-$(CONFIG_ARCH_QCOM) += \ - qcom-apq8074-dragonboard.dtb \ - qcom-apq8084-ifc6540.dtb \ - qcom-apq8084-mtp.dtb \ -@@ -30,6 +30,7 @@ Signed-off-by: John Crispin - + qcom-ipq4019-a62.dtb \ - + qcom-ipq4019-ap.dk04.1-c1.dtb \ - + qcom-ipq4019-fritzbox-7530.dtb \ -++ qcom-ipq4019-fritzrepeater-1200.dtb \ - + qcom-ipq4019-fritzrepeater-3000.dtb \ - + qcom-ipq4019-linksys_ea8300.dtb \ - + qcom-ipq4019-map-ac2200.dtb \ From 51a36abc6f662ef6ea36e57f1573c5994a453f7f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 23 Nov 2019 14:34:31 +0100 Subject: [PATCH 010/105] modules: update OpenWrt base 15ce616c2de7 build: add PKG_SOURCE_URL_FILE support 436dbf12aa73 kernel: nf_conntrack_rtcache: fix cleanup on netns delete and rmmod b177b180bbdb mac80211: add default value for noscan e68d589e7b8c e2fsprogs: Fix CVE-2019-5094 in libsupport --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 1a3cb66b..91301f1c 100644 --- a/modules +++ b/modules @@ -2,7 +2,7 @@ GLUON_FEEDS='packages routing luci gluon' OPENWRT_REPO=https://git.openwrt.org/openwrt/openwrt.git OPENWRT_BRANCH=openwrt-19.07 -OPENWRT_COMMIT=6160f773fef2e204065a398abdd1504913a1bf8e +OPENWRT_COMMIT=15ce616c2de797259cc125f1ece5f2358ea4bd5a PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git PACKAGES_PACKAGES_BRANCH=openwrt-19.07 From 154567dfdd8dd1f87da18cd48800e015de6f8508 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 23 Nov 2019 16:43:48 +0100 Subject: [PATCH 011/105] openwrt: Revert "kernel: nf_conntrack_rtcache: fix cleanup on netns delete and rmmod" --- ...ix-cleanup-on-netns-delete-and-rmmod.patch | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 patches/openwrt/0006-Revert-kernel-nf_conntrack_rtcache-fix-cleanup-on-netns-delete-and-rmmod.patch diff --git a/patches/openwrt/0006-Revert-kernel-nf_conntrack_rtcache-fix-cleanup-on-netns-delete-and-rmmod.patch b/patches/openwrt/0006-Revert-kernel-nf_conntrack_rtcache-fix-cleanup-on-netns-delete-and-rmmod.patch new file mode 100644 index 00000000..77470bf9 --- /dev/null +++ b/patches/openwrt/0006-Revert-kernel-nf_conntrack_rtcache-fix-cleanup-on-netns-delete-and-rmmod.patch @@ -0,0 +1,63 @@ +From: Matthias Schiffer +Date: Sat, 23 Nov 2019 16:43:00 +0100 +Subject: Revert "kernel: nf_conntrack_rtcache: fix cleanup on netns delete and rmmod" + +This reverts commit 436dbf12aa7381bd6db1b03b36be5a73df386eb4. + +https://bugs.openwrt.org/index.php?do=details&task_id=2624 + +Signed-off-by: Matthias Schiffer + +diff --git a/target/linux/generic/backport-4.14/020-backport_netfilter_rtcache.patch b/target/linux/generic/backport-4.14/020-backport_netfilter_rtcache.patch +index d745a970269061c56ef92677db0e85e96207f58b..8a6fba4307c2f7f7384f7274f39cf54c1a0ea7ae 100644 +--- a/target/linux/generic/backport-4.14/020-backport_netfilter_rtcache.patch ++++ b/target/linux/generic/backport-4.14/020-backport_netfilter_rtcache.patch +@@ -127,7 +127,7 @@ Signed-off-by: Florian Westphal + # netlink interface for nf_conntrack + --- /dev/null + +++ b/net/netfilter/nf_conntrack_rtcache.c +-@@ -0,0 +1,440 @@ ++@@ -0,0 +1,428 @@ + +/* route cache for netfilter. + + * + + * (C) 2014 Red Hat GmbH +@@ -444,11 +444,6 @@ Signed-off-by: Florian Westphal + + .destroy = nf_conn_rtcache_destroy, + +}; + + +-+static int __net_init rtcache_net_init(struct net *net) +-+{ +-+ return nf_register_net_hooks(net, rtcache_ops, ARRAY_SIZE(rtcache_ops)); +-+} +-+ + +static void __net_exit rtcache_net_exit(struct net *net) + +{ + + /* remove hooks so no new connections get rtcache extension */ +@@ -456,7 +451,6 @@ Signed-off-by: Florian Westphal + +} + + + +static struct pernet_operations rtcache_ops_net_ops = { +-+ .init = rtcache_net_init, + + .exit = rtcache_net_exit, + +}; + + +@@ -537,11 +531,6 @@ Signed-off-by: Florian Westphal + + synchronize_net(); + + + + unregister_netdevice_notifier(&nf_rtcache_notifier); +-+ unregister_pernet_subsys(&rtcache_ops_net_ops); +-+ for_each_net(net) +-+ nf_unregister_net_hooks(net, rtcache_ops, ARRAY_SIZE(rtcache_ops)); +-+ +-+ synchronize_net(); + + + + rtnl_lock(); + + +@@ -558,7 +547,6 @@ Signed-off-by: Florian Westphal + + } + + + + rtnl_unlock(); +-+ + + synchronize_net(); + + nf_ct_extend_unregister(&rtcache_extend); + +} From 2864799c37d796bf10089c6a337f98dc97e004c8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 23 Nov 2019 15:13:57 +0100 Subject: [PATCH 012/105] modules: update OpenWrt packages 5b2010ce80af samba4: add UCI option 'disable_async_io' e6564936ecac cifsd: update to git (2019-11-22) fd254a04c857 bind: update to version 9.14.8 (security fix) db06f7ee2a9d nextdns: Update version 1.1.5 + add per host config option d1bab6ef8aa2 nnn: Add a new package 52515c819e75 unbound: Update to version 1.9.5 ff0e3bf71980 cifsd: add package cifsd [backport] ffbe240f0fa5 knot: update to version 2.9.1 6106619bdef2 travelmate: update 1.5.3 2969a1842d10 django: bump to version 1.11.26 58dd5a94ba6f adblock: update 3.8.11 f28dfa39ea8d haproxy: Update HAProxy to v2.0.9 a907174c3ab2 prometheus-node-exporter-lua: bump version 928915f4a62b prometheus-node-exporter-lua: an unavaliable wifi interface may have stopped the scraper from functioning 0e69b1473372 prometheus-node-exporter-lua: respawn the process 56e0861f7766 prometheus-node-exporter-lua: add a config reload trigger ee353e6036c7 prometheus-node-exporter-lua: switch config to openwrt interface names 6c42cc8f6df7 nextdns: update to 1.1.3 87e9963eba9f dcwapd: Update init script to use procd 1f417d7ed01f python-zope-interface: Update to 4.7.1, refresh patch 87ccd3ddbd1f python-twisted: Update to 19.10.0, refresh patches 7504b410a677 python-pyasn1: Update to 0.4.8 1feef55c9423 acme: Add dependency on luci-compat for luci-app-acme a25797e58d95 acme: Update to upstream 2.8.3 bbaed850a3ce acme: Log acme.sh command invocation d71c1fbe0d7c acme: depends on gnu-wget b151af8f45ca acme: Update to 2.8.1 71e06448ede2 wget: provides gnu-wget 0031c874683a ttyd: update to 1.5.2 and add init script 56a8ebb769a3 ttyd: update to 1.5.1 f00d0a018525 boost: Fix fiber compilation for mips 6371fc55d98d boost: Remove several host libraries 6002ef66b5fe boost: Remove thread dependency from context 35a9ef61ea06 nextdns: add DNS over HTTPS with NextDNS integration c1575ecf5cf8 banip: update 0.3.10 0f67fc96d855 mwan3: sync PKG_RELEASE number and PKG_VERSION with master 62c9688adcd3 mwan3: Add missing IPs to wanb aa5a583869e7 mwan3: update version to 2.8.0 e842ea394197 mwan3: add netifd up info to mwan3 ubus status output f20b96e4a5c4 mwan3: add enabled info to mwan3 ubus status 0c25f7a51c1b mwan3: add interface uptime netifd value to ubus mwan3 status output 3371703487ac mwan3: rename downtime to offline aa05eb448b76 mwan3: rename uptime to online 2a64b3a44090 collectd: remove the patch scaling ping_droprate from 0-1 to 0-100 84756e7f60ac mwan3: Fix json_load fails with some data 168c2928f96f io: Add TARGET_LDFLAGS to fix PIE 0441927b246b io: Fix printing 4 bytes memory on 64 bit systems 1f082d84dd7a io: Open /dev/mem with O_SYNC for uncached access 39001de7b042 pcre: remove unnecessary dependency on C++ lib e91e3fd6ad87 ntpd: Fix libevent dependencies daebf4aba9bb python-six: Update to 1.13.0 aa4c5e7de6cf Revert "Revert "perl-www-curl: curl 7.66.0 compatibility"" c75917c8a927 banip: update 0.3.9 49e57eadb3d6 banIP: update 0.3.8 1fc8c2c4eaed adblock: update 3.8.10 e0ca91a2fe48 knot: update to version 2.9.0 734a005187dd knot: update to version 2.8.4 145bd2d19eaf dovecot: update to 2.3.8 f7cc8ad37b82 libedit: update to 20191025-3.1 50dfcd79f543 dnscrypt-proxy2: Update to version 2.0.29 a6f026ff5b87 python-zipp: fix python-more-itertools dependency 0faf7bfcc23e python-zipp: add new package e9748d34f5ab bind: Update to version 9.14.7 91da56a94211 perl: fixed host compilation of static perl on MacOS bb00671ad423 libmaxminddb: update to version 1.4.2 d60dbbed2c18 clamav: Update to version 0.101.4 c58d563120d1 haproxy: Rework hotplug script for HAProxy 98a4cd0fd83f haproxy: Update patches for HAProxy v2.0.8 ec6cd9b9c395 Revert "perl-www-curl: curl 7.66.0 compatibility" 522aea0cadf5 Revert "haproxy: Update patches for HAProxy v2.0.8" 22bcd9e78467 Revert "haproxy: Rework hotplug script for HAProxy" 7a1f32f704e8 banip: update 0.3.7 848589d758f0 banip: update 0.3.6 7401166ea88b banip: update 0.3.5 be9e82b01710 travelmate: update 1.5.2 fff155b2bf7f adblock: update 3.8.9 bc89112c27bb adblock: update 3.8.8 32a8209c55c7 samba4: update to 4.9.15 349d73b2c39d sqm-scripts: Add required new depends for luci-app-sqm 5c51d658cf52 sqm-scripts: Bump to v1.4.0 94c4c1304a58 libarchive: update to version 3.4.0 6d5e468f2d12 circleci: skip compiling packages not enabled ef4de15df800 build: only install changed packages 3f3c613ac5bb btrfs-progs: Update to version 5.3.1 bfcdf4e202d3 syslog-ng: Update to version 3.24.1 6f6c5d17c0f9 youtube-dl: Update to version 2019.10.29 af20f836e000 youtube-dl: Update to version 2019.10.22 e31921f2af1c net: seahub: remove inexistent deps e1d9652edc9d python-cffi: Update to 1.13.2 07835fc26e2b golang: Update to 1.13.4 3d4c934584df sispmctl: Reduce ipk size 248c3d01faed sispmctl: Update to 4.2 c7bd76919fb4 libgphoto2: libgphoto2_port.pc needed by dev 22ab1fcefe47 telldus-core: Doxygen in-file was not found. 42c85958fdc9 treewide: Replace MD5SUM with HASH 5bc62e00aa8f vim/host: fix build failures c9ee50d19009 haproxy: Rework hotplug script for HAProxy 76a2da3fd413 haproxy: Update patches for HAProxy v2.0.8 58ed21040c1f python,python3: Add PYPI_SOURCE_NAME to pypi.mk c8113fcd05d4 google-authenticator-libpam: fix install section 866b42c60ea6 python,python3: Add pypi makefile 4900b2cb2d7a adblock: update 3.8.7 0d146c23175f https-dns-proxy: implement dnsmasq integration 807c557cf9b7 django: bump to version 1.11.25 4574e8fcb98a python-cffi: bump to version 1.13.1 --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 91301f1c..b2f090c2 100644 --- a/modules +++ b/modules @@ -6,7 +6,7 @@ OPENWRT_COMMIT=15ce616c2de797259cc125f1ece5f2358ea4bd5a PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git PACKAGES_PACKAGES_BRANCH=openwrt-19.07 -PACKAGES_PACKAGES_COMMIT=702c655874db358706b7858445b06dba09c90cd6 +PACKAGES_PACKAGES_COMMIT=d4aa51b2462504f9ede0e9217547f77199306543 PACKAGES_ROUTING_REPO=https://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_BRANCH=openwrt-19.07 From b97e355e149dd6e0d5e3b095ffeb01da74de1646 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 23 Nov 2019 15:18:14 +0100 Subject: [PATCH 013/105] modules: update Gluon packages 83dbdbcb7b6f luasrcdiet: update Makefile to openwrt/packages version 0371952ab0fa luasrcdiet: add package (moved from luci-base package) dced4023f5a2 micrond: move to openwrt packages feed --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index b2f090c2..f7577353 100644 --- a/modules +++ b/modules @@ -17,4 +17,4 @@ PACKAGES_LUCI_BRANCH=openwrt-19.07 PACKAGES_LUCI_COMMIT=7542d02cd23208ca2ed89ea5341d323ca3dc4e58 PACKAGES_GLUON_REPO=https://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=de7b228cae72e87f2dfb3eed5b0354bd7cec4ca7 +PACKAGES_GLUON_COMMIT=83dbdbcb7b6f1d9eab144423b82ee9ffa4c9bc69 From 911ed5263d707993b474f300e5ab48c36c76dad8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 23 Nov 2019 15:10:46 +0100 Subject: [PATCH 014/105] Refresh OpenWrt package patches --- ...ort-for-alternative-rc.d-directories.patch | 31 +++++-------------- ...or-custom-format-strings-for-doubles.patch | 21 +++++-------- 2 files changed, 14 insertions(+), 38 deletions(-) diff --git a/patches/openwrt/0001-procd-add-support-for-alternative-rc.d-directories.patch b/patches/openwrt/0001-procd-add-support-for-alternative-rc.d-directories.patch index db29794d..be6f38e8 100644 --- a/patches/openwrt/0001-procd-add-support-for-alternative-rc.d-directories.patch +++ b/patches/openwrt/0001-procd-add-support-for-alternative-rc.d-directories.patch @@ -4,10 +4,10 @@ Subject: procd: add support for alternative rc.d directories diff --git a/package/system/procd/patches/0001-Add-support-for-alternative-rc.d-directories.patch b/package/system/procd/patches/0001-Add-support-for-alternative-rc.d-directories.patch new file mode 100644 -index 0000000000000000000000000000000000000000..bc2434200364b46f1db4c2eec22c4e8b973844d5 +index 0000000000000000000000000000000000000000..16d3179f05c64b7178f883745294c64a27127775 --- /dev/null +++ b/package/system/procd/patches/0001-Add-support-for-alternative-rc.d-directories.patch -@@ -0,0 +1,97 @@ +@@ -0,0 +1,80 @@ +From 03a2bc70e4260ec9f669391c47b9a7a9ecd0b75d Mon Sep 17 00:00:00 2001 +Message-Id: <03a2bc70e4260ec9f669391c47b9a7a9ecd0b75d.1407329621.git.mschiffer@universe-factory.net> +From: Matthias Schiffer @@ -19,21 +19,10 @@ index 0000000000000000000000000000000000000000..bc2434200364b46f1db4c2eec22c4e8b + rcS.c | 2 +- + 2 files changed, 39 insertions(+), 1 deletion(-) + -+diff --git a/initd/preinit.c b/initd/preinit.c -+index fb94527..8b832a7 100644 +--- a/initd/preinit.c ++++ b/initd/preinit.c -+@@ -12,6 +12,8 @@ -+ * GNU General Public License for more details. -+ */ -+ -++#define _GNU_SOURCE -++ -+ #include -+ #include -+ #include -+@@ -46,6 +48,35 @@ check_dbglvl(void) -+ debug = lvl; ++@@ -87,12 +87,42 @@ fail: ++ free(command); + } + ++static char* @@ -68,15 +57,14 @@ index 0000000000000000000000000000000000000000..bc2434200364b46f1db4c2eec22c4e8b + static void + spawn_procd(struct uloop_process *proc, int ret) + { -+@@ -53,6 +84,7 @@ spawn_procd(struct uloop_process *proc, int ret) ++ char *wdt_fd = watchdog_fd(); + char *argv[] = { "/sbin/procd", NULL}; -+ struct stat s; + char dbg[2]; ++ char *rc_d_path; + + if (plugd_proc.pid > 0) + kill(plugd_proc.pid, SIGKILL); -+@@ -72,6 +104,12 @@ spawn_procd(struct uloop_process *proc, int ret) ++@@ -112,6 +142,12 @@ spawn_procd(struct uloop_process *proc, + setenv("DBGLVL", dbg, 1); + } + @@ -89,11 +77,9 @@ index 0000000000000000000000000000000000000000..bc2434200364b46f1db4c2eec22c4e8b + execvp(argv[0], argv); + } + -+diff --git a/rcS.c b/rcS.c -+index 0e1b0ba..1b00831 100644 +--- a/rcS.c ++++ b/rcS.c -+@@ -150,7 +150,7 @@ int rcS(char *pattern, char *param, void (*q_empty)(struct runqueue *)) ++@@ -184,7 +184,7 @@ int rcS(char *pattern, char *param, void + q.empty_cb = q_empty; + q.max_running_tasks = 1; + @@ -102,6 +88,3 @@ index 0000000000000000000000000000000000000000..bc2434200364b46f1db4c2eec22c4e8b + } + + int rc(const char *file, char *param) -+-- -+2.0.4 -+ diff --git a/patches/openwrt/0003-libjson-c-Add-support-for-custom-format-strings-for-doubles.patch b/patches/openwrt/0003-libjson-c-Add-support-for-custom-format-strings-for-doubles.patch index 662d8960..a5960219 100644 --- a/patches/openwrt/0003-libjson-c-Add-support-for-custom-format-strings-for-doubles.patch +++ b/patches/openwrt/0003-libjson-c-Add-support-for-custom-format-strings-for-doubles.patch @@ -4,10 +4,10 @@ Subject: libjson-c: Add support for custom format strings for doubles diff --git a/package/libs/libjson-c/patches/002-custom-format-string.patch b/package/libs/libjson-c/patches/002-custom-format-string.patch new file mode 100644 -index 0000000000000000000000000000000000000000..2f454c560ff78c1edd4654b9651f0e6299bd5e6f +index 0000000000000000000000000000000000000000..b67433a7baf37654a17fa5036c4266b33bdda9f2 --- /dev/null +++ b/package/libs/libjson-c/patches/002-custom-format-string.patch -@@ -0,0 +1,98 @@ +@@ -0,0 +1,91 @@ +From 21dc5dc92bd56f5f4dc2c90b9ea6bf1e1407714e Mon Sep 17 00:00:00 2001 +From: Jan-Philipp Litza +Date: Fri, 6 May 2016 16:12:44 +0200 @@ -20,11 +20,9 @@ index 0000000000000000000000000000000000000000..2f454c560ff78c1edd4654b9651f0e62 + json_object.h | 28 ++++++++++++++++++++++++++++ + 2 files changed, 34 insertions(+), 6 deletions(-) + -+diff --git a/json_object.c b/json_object.c -+index 7d60884..46701e7 100644 +--- a/json_object.c ++++ b/json_object.c -+@@ -55,7 +55,6 @@ static struct json_object* json_object_new(enum json_type o_type); ++@@ -55,7 +55,6 @@ static struct json_object* json_object_n + static json_object_to_json_string_fn json_object_object_to_json_string; + static json_object_to_json_string_fn json_object_boolean_to_json_string; + static json_object_to_json_string_fn json_object_int_to_json_string; @@ -32,7 +30,7 @@ index 0000000000000000000000000000000000000000..2f454c560ff78c1edd4654b9651f0e62 + static json_object_to_json_string_fn json_object_string_to_json_string; + static json_object_to_json_string_fn json_object_array_to_json_string; + -+@@ -644,10 +643,10 @@ int64_t json_object_get_int64(const struct json_object *jso) ++@@ -560,10 +559,10 @@ int64_t json_object_get_int64(struct jso + + /* json_object_double */ + @@ -47,7 +45,7 @@ index 0000000000000000000000000000000000000000..2f454c560ff78c1edd4654b9651f0e62 + { + char buf[128], *p, *q; + int size; -+@@ -663,7 +662,8 @@ static int json_object_double_to_json_string(struct json_object* jso, ++@@ -579,7 +578,8 @@ static int json_object_double_to_json_st + else + size = snprintf(buf, sizeof(buf), "-Infinity"); + else @@ -57,11 +55,9 @@ index 0000000000000000000000000000000000000000..2f454c560ff78c1edd4654b9651f0e62 + + p = strchr(buf, ','); + if (p) { -+diff --git a/json_object.h b/json_object.h -+index 2bce454..a89de44 100644 +--- a/json_object.h ++++ b/json_object.h -+@@ -614,6 +614,9 @@ extern int64_t json_object_get_int64(const struct json_object *obj); ++@@ -515,6 +515,9 @@ extern int64_t json_object_get_int64(str + /* double type methods */ + + /** Create a new empty json_object of type json_type_double @@ -71,7 +67,7 @@ index 0000000000000000000000000000000000000000..2f454c560ff78c1edd4654b9651f0e62 + * @param d the double + * @returns a json_object of type json_type_double + */ -+@@ -642,6 +645,31 @@ extern struct json_object* json_object_new_double(double d); ++@@ -543,6 +546,31 @@ extern struct json_object* json_object_n + */ + extern struct json_object* json_object_new_double_s(double d, const char *ds); + @@ -103,6 +99,3 @@ index 0000000000000000000000000000000000000000..2f454c560ff78c1edd4654b9651f0e62 + /** Get the double floating point value of a json_object + * + * The type is coerced to a double if the passed object is not a double. -+-- -+2.7.4 -+ From 23fd9cd0f9ea4bbd1d3b28ad5ec42206e30870a2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 23 Nov 2019 14:35:45 +0100 Subject: [PATCH 015/105] gluon-web: import po2lmo tool from luci-base The code is slightly cleaned up to fix compiler warnings. --- package/gluon-web/Makefile | 15 ++ package/gluon-web/src/Makefile | 2 + package/gluon-web/src/gluon-po2lmo.c | 256 +++++++++++++++++++++++++++ package/gluon-web/src/template_lmo.c | 11 +- package/gluon-web/src/template_lmo.h | 9 + package/gluon.mk | 3 +- 6 files changed, 285 insertions(+), 11 deletions(-) create mode 100644 package/gluon-web/src/gluon-po2lmo.c diff --git a/package/gluon-web/Makefile b/package/gluon-web/Makefile index 8585a493..decc9c84 100644 --- a/package/gluon-web/Makefile +++ b/package/gluon-web/Makefile @@ -6,6 +6,7 @@ PKG_VERSION:=1 PKG_INSTALL:=1 include ../gluon.mk +include $(INCLUDE_DIR)/host-build.mk define Package/gluon-web TITLE:=Minimal Lua web framework derived from LuCI @@ -24,4 +25,18 @@ define Package/gluon-web/config $(foreach lang,$(GLUON_SUPPORTED_LANGS),$(call lang-config,$(lang))) endef +define Host/Prepare + $(CP) ./src/* $(HOST_BUILD_DIR) +endef + +define Host/Compile + $(call Host/Compile/Default,gluon-po2lmo) +endef + +define Host/Install + $(INSTALL_DIR) $(1)/bin + $(INSTALL_BIN) $(HOST_BUILD_DIR)/gluon-po2lmo $(1)/bin/ +endef + $(eval $(call BuildPackageGluon,gluon-web)) +$(eval $(call HostBuild)) diff --git a/package/gluon-web/src/Makefile b/package/gluon-web/src/Makefile index 90b952f0..b8b66ef1 100644 --- a/package/gluon-web/src/Makefile +++ b/package/gluon-web/src/Makefile @@ -9,6 +9,8 @@ clean: parser.so: template_parser.o template_utils.o template_lmo.o template_lualib.o $(CC) $(LDFLAGS) -shared -o $@ $^ +gluon-po2lmo: gluon-po2lmo.o template_lmo.o + compile: parser.so install: compile diff --git a/package/gluon-web/src/gluon-po2lmo.c b/package/gluon-web/src/gluon-po2lmo.c new file mode 100644 index 00000000..259651c9 --- /dev/null +++ b/package/gluon-web/src/gluon-po2lmo.c @@ -0,0 +1,256 @@ +/* + * lmo - Lua Machine Objects - PO to LMO conversion tool + * + * Copyright (C) 2009-2012 Jo-Philipp Wich + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "template_lmo.h" + +#include +#include +#include +#include +#include + + +__attribute__((noreturn)) +static void die(const char *msg) +{ + fprintf(stderr, "Error: %s\n", msg); + exit(1); +} + +__attribute__((noreturn)) +static void usage(const char *name) +{ + fprintf(stderr, "Usage: %s input.po output.lmo\n", name); + exit(1); +} + +static void print(const void *ptr, size_t size, size_t nmemb, FILE *stream) +{ + if( fwrite(ptr, size, nmemb, stream) == 0 ) + die("Failed to write stdout"); +} + +static ssize_t extract_string(const char *src, char *dest, size_t len) +{ + size_t pos = 0; + int esc = 0; + int off = -1; + + for( pos = 0; (pos < strlen(src)) && (pos < len); pos++ ) + { + if( (off == -1) && (src[pos] == '"') ) + { + off = pos + 1; + } + else if( off >= 0 ) + { + if( esc == 1 ) + { + switch (src[pos]) + { + case '"': + case '\\': + off++; + break; + } + dest[pos-off] = src[pos]; + esc = 0; + } + else if( src[pos] == '\\' ) + { + dest[pos-off] = src[pos]; + esc = 1; + } + else if( src[pos] != '"' ) + { + dest[pos-off] = src[pos]; + } + else + { + dest[pos-off] = '\0'; + break; + } + } + } + + return (off > -1) ? (ssize_t) strlen(dest) : -1; +} + +static int cmp_index(const void *a, const void *b) +{ + uint32_t x = ((const lmo_entry_t *)a)->key_id; + uint32_t y = ((const lmo_entry_t *)b)->key_id; + + if (x < y) + return -1; + else if (x > y) + return 1; + + return 0; +} + +static void print_uint32(uint32_t x, FILE *out) +{ + uint32_t y = htonl(x); + print(&y, sizeof(uint32_t), 1, out); +} + +static void print_index(void *array, int n, FILE *out) +{ + lmo_entry_t *e; + + qsort(array, n, sizeof(*e), cmp_index); + + for (e = array; n > 0; n--, e++) + { + print_uint32(e->key_id, out); + print_uint32(e->val_id, out); + print_uint32(e->offset, out); + print_uint32(e->length, out); + } +} + +int main(int argc, char *argv[]) +{ + char line[4096]; + char key[4096]; + char val[4096]; + char tmp[4096]; + int state = 0; + int offset = 0; + int length = 0; + int n_entries = 0; + void *array = NULL; + lmo_entry_t *entry = NULL; + uint32_t key_id, val_id; + + FILE *in; + FILE *out; + + if( (argc != 3) || ((in = fopen(argv[1], "r")) == NULL) || ((out = fopen(argv[2], "w")) == NULL) ) + usage(argv[0]); + + memset(line, 0, sizeof(key)); + memset(key, 0, sizeof(val)); + memset(val, 0, sizeof(val)); + + while( (NULL != fgets(line, sizeof(line), in)) || (state >= 2 && feof(in)) ) + { + if( state == 0 && strstr(line, "msgid \"") == line ) + { + switch(extract_string(line, key, sizeof(key))) + { + case -1: + die("Syntax error in msgid"); + case 0: + state = 1; + break; + default: + state = 2; + } + } + else if( state == 1 || state == 2 ) + { + if( strstr(line, "msgstr \"") == line || state == 2 ) + { + switch(extract_string(line, val, sizeof(val))) + { + case -1: + state = 4; + break; + default: + state = 3; + } + } + else + { + switch(extract_string(line, tmp, sizeof(tmp))) + { + case -1: + state = 2; + break; + default: + strcat(key, tmp); + } + } + } + else if( state == 3 ) + { + switch(extract_string(line, tmp, sizeof(tmp))) + { + case -1: + state = 4; + break; + default: + strcat(val, tmp); + } + } + + if( state == 4 ) + { + if( strlen(key) > 0 && strlen(val) > 0 ) + { + key_id = sfh_hash(key, strlen(key)); + val_id = sfh_hash(val, strlen(val)); + + if( key_id != val_id ) + { + n_entries++; + array = realloc(array, n_entries * sizeof(lmo_entry_t)); + entry = (lmo_entry_t *)array + n_entries - 1; + + if (!array) + die("Out of memory"); + + entry->key_id = key_id; + entry->val_id = val_id; + entry->offset = offset; + entry->length = strlen(val); + + length = strlen(val) + ((4 - (strlen(val) % 4)) % 4); + + print(val, length, 1, out); + offset += length; + } + } + + state = 0; + memset(key, 0, sizeof(key)); + memset(val, 0, sizeof(val)); + } + + memset(line, 0, sizeof(line)); + } + + print_index(array, n_entries, out); + + if( offset > 0 ) + { + print_uint32(offset, out); + fsync(fileno(out)); + fclose(out); + } + else + { + fclose(out); + unlink(argv[2]); + } + + fclose(in); + return(0); +} diff --git a/package/gluon-web/src/template_lmo.c b/package/gluon-web/src/template_lmo.c index 0a86bbc9..062497b3 100644 --- a/package/gluon-web/src/template_lmo.c +++ b/package/gluon-web/src/template_lmo.c @@ -25,20 +25,11 @@ #include #include #include -#include #include #include #include -struct lmo_entry { - uint32_t key_id; - uint32_t val_id; - uint32_t offset; - uint32_t length; -} __attribute__((packed)); - - static inline uint16_t get_le16(const void *data) { const uint8_t *d = data; return (((uint16_t)d[1]) << 8) | d[0]; @@ -56,7 +47,7 @@ static inline uint32_t get_be32(const void *data) { * Hash function from http://www.azillionmonkeys.com/qed/hash.html * Copyright (C) 2004-2008 by Paul Hsieh */ -static uint32_t sfh_hash(const void *input, size_t len) +uint32_t sfh_hash(const void *input, size_t len) { const uint8_t *data = input; uint32_t hash = len, tmp; diff --git a/package/gluon-web/src/template_lmo.h b/package/gluon-web/src/template_lmo.h index 4af6cac1..f381c7c1 100644 --- a/package/gluon-web/src/template_lmo.h +++ b/package/gluon-web/src/template_lmo.h @@ -22,8 +22,15 @@ #include #include +#include +struct lmo_entry { + uint32_t key_id; + uint32_t val_id; + uint32_t offset; + uint32_t length; +} __attribute__((packed)); typedef struct lmo_entry lmo_entry_t; @@ -37,6 +44,8 @@ struct lmo_catalog { typedef struct lmo_catalog lmo_catalog_t; +uint32_t sfh_hash(const void *input, size_t len); + bool lmo_load(lmo_catalog_t *cat, const char *file); void lmo_unload(lmo_catalog_t *cat); bool lmo_translate(const lmo_catalog_t *cat, const char *key, size_t keylen, const char **out, size_t *outlen); diff --git a/package/gluon.mk b/package/gluon.mk index 90aeabc9..4aae8f71 100644 --- a/package/gluon.mk +++ b/package/gluon.mk @@ -31,6 +31,7 @@ GLUON_I18N_CONFIG := $(foreach lang,$(GLUON_SUPPORTED_LANGS),CONFIG_GLUON_WEB_LA GLUON_ENABLED_LANGS := en $(foreach lang,$(GLUON_SUPPORTED_LANGS),$(if $(CONFIG_GLUON_WEB_LANG_$(lang)),$(lang))) ifneq ($(wildcard ./i18n/.),) + PKG_BUILD_DEPENDS += gluon-web/host PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) endif @@ -40,7 +41,7 @@ define GluonBuildI18N for lang in $$(GLUON_ENABLED_LANGS); do \ if [ -e $(1)/$$$$lang.po ]; then \ rm -f $$(PKG_BUILD_DIR)/i18n/$$$$lang.lmo; \ - po2lmo $(1)/$$$$lang.po $$(PKG_BUILD_DIR)/i18n/$$$$lang.lmo; \ + gluon-po2lmo $(1)/$$$$lang.po $$(PKG_BUILD_DIR)/i18n/$$$$lang.lmo; \ fi; \ done endef From 43b1368b70384b1b96cefb4d92ceb04fb9a714cd Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 23 Nov 2019 15:19:39 +0100 Subject: [PATCH 016/105] gluon.mk: depend on luasrcdiet/host instead of luci-base/host We don't use anything else from luci-base anymore. --- package/gluon.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package/gluon.mk b/package/gluon.mk index 4aae8f71..7246a318 100644 --- a/package/gluon.mk +++ b/package/gluon.mk @@ -1,8 +1,7 @@ GLUON_MK := $(abspath $(lastword $(MAKEFILE_LIST))) PKG_FILE_DEPENDS += $(GLUON_MK) -# Dependencies for LuaSrcDiet -PKG_BUILD_DEPENDS += luci-base/host +PKG_BUILD_DEPENDS += luasrcdiet/host ifneq ($(wildcard ./src/respondd.c),) PKG_BUILD_DEPENDS += respondd From b69b9043f4d5bdbb6fa7f586ef484f6a44c94705 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 23 Nov 2019 15:20:40 +0100 Subject: [PATCH 017/105] modules: remove LuCI feed --- modules | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules b/modules index f7577353..56755d56 100644 --- a/modules +++ b/modules @@ -1,4 +1,4 @@ -GLUON_FEEDS='packages routing luci gluon' +GLUON_FEEDS='packages routing gluon' OPENWRT_REPO=https://git.openwrt.org/openwrt/openwrt.git OPENWRT_BRANCH=openwrt-19.07 @@ -12,9 +12,5 @@ PACKAGES_ROUTING_REPO=https://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_BRANCH=openwrt-19.07 PACKAGES_ROUTING_COMMIT=8d5ee29f088e9dfaa49dc74573edb1919f14dbf4 -PACKAGES_LUCI_REPO=https://github.com/openwrt/luci.git -PACKAGES_LUCI_BRANCH=openwrt-19.07 -PACKAGES_LUCI_COMMIT=7542d02cd23208ca2ed89ea5341d323ca3dc4e58 - PACKAGES_GLUON_REPO=https://github.com/freifunk-gluon/packages.git PACKAGES_GLUON_COMMIT=83dbdbcb7b6f1d9eab144423b82ee9ffa4c9bc69 From 4ee5f3590bccb7da3a014386f77c94bbb9b40e7d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 23 Nov 2019 18:56:44 +0100 Subject: [PATCH 018/105] gluon-respondd: fix format string type mismatches --- package/gluon-respondd/src/respondd.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/package/gluon-respondd/src/respondd.c b/package/gluon-respondd/src/respondd.c index b0b74936..04010c68 100644 --- a/package/gluon-respondd/src/respondd.c +++ b/package/gluon-respondd/src/respondd.c @@ -230,8 +230,8 @@ static struct json_object * get_stat(void) { } if (!strcmp(label, "cpu")) { - unsigned long long user, nice, system, idle, iowait, irq, softirq; - if (sscanf(line, "%*s %"SCNu64" %"SCNu64" %"SCNu64" %"SCNu64" %"SCNu64" %"SCNu64" %"SCNu64, + int64_t user, nice, system, idle, iowait, irq, softirq; + if (sscanf(line, "%*s %"SCNd64" %"SCNd64" %"SCNd64" %"SCNd64" %"SCNd64" %"SCNd64" %"SCNd64, &user, &nice, &system, &idle, &iowait, &irq, &softirq) != 7) goto invalid_stat_format; @@ -247,26 +247,26 @@ static struct json_object * get_stat(void) { json_object_object_add(stat, "cpu", cpu); } else if (!strcmp(label, "ctxt")) { - unsigned long long ctxt; - if (sscanf(line, "%*s %"SCNu64, &ctxt) != 1) + int64_t ctxt; + if (sscanf(line, "%*s %"SCNd64, &ctxt) != 1) goto invalid_stat_format; json_object_object_add(stat, "ctxt", json_object_new_int64(ctxt)); } else if (!strcmp(label, "intr")) { - unsigned long long total_intr; - if (sscanf(line, "%*s %"SCNu64, &total_intr) != 1) + int64_t total_intr; + if (sscanf(line, "%*s %"SCNd64, &total_intr) != 1) goto invalid_stat_format; json_object_object_add(stat, "intr", json_object_new_int64(total_intr)); } else if (!strcmp(label, "softirq")) { - unsigned long long total_softirq; - if (sscanf(line, "%*s %"SCNu64, &total_softirq) != 1) + int64_t total_softirq; + if (sscanf(line, "%*s %"SCNd64, &total_softirq) != 1) goto invalid_stat_format; json_object_object_add(stat, "softirq", json_object_new_int64(total_softirq)); } else if (!strcmp(label, "processes")) { - unsigned long long processes; - if (sscanf(line, "%*s %"SCNu64, &processes) != 1) + int64_t processes; + if (sscanf(line, "%*s %"SCNd64, &processes) != 1) goto invalid_stat_format; json_object_object_add(stat, "processes", json_object_new_int64(processes)); From 00b46f0662dfda2204f3d8d8fa9e0be6bc177c01 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 23 Nov 2019 22:44:39 +0100 Subject: [PATCH 019/105] modules: update OpenWrt base f97d2351e2c1 ath79: remove ath10k drivers from Archer C7 v1 profile 7c321e00dd19 kernel: nf_conntrack_rtcache: fix WARNING on rmmod 2a2f9ffe81ce kernel: nf_conntrack_rtcache: fix WARNING on forward path --- modules | 2 +- ...ix-cleanup-on-netns-delete-and-rmmod.patch | 63 ------------------- 2 files changed, 1 insertion(+), 64 deletions(-) delete mode 100644 patches/openwrt/0006-Revert-kernel-nf_conntrack_rtcache-fix-cleanup-on-netns-delete-and-rmmod.patch diff --git a/modules b/modules index 56755d56..fa4c1435 100644 --- a/modules +++ b/modules @@ -2,7 +2,7 @@ GLUON_FEEDS='packages routing gluon' OPENWRT_REPO=https://git.openwrt.org/openwrt/openwrt.git OPENWRT_BRANCH=openwrt-19.07 -OPENWRT_COMMIT=15ce616c2de797259cc125f1ece5f2358ea4bd5a +OPENWRT_COMMIT=f97d2351e2c1282cdfa0e5126bd6eef56d0e8252 PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git PACKAGES_PACKAGES_BRANCH=openwrt-19.07 diff --git a/patches/openwrt/0006-Revert-kernel-nf_conntrack_rtcache-fix-cleanup-on-netns-delete-and-rmmod.patch b/patches/openwrt/0006-Revert-kernel-nf_conntrack_rtcache-fix-cleanup-on-netns-delete-and-rmmod.patch deleted file mode 100644 index 77470bf9..00000000 --- a/patches/openwrt/0006-Revert-kernel-nf_conntrack_rtcache-fix-cleanup-on-netns-delete-and-rmmod.patch +++ /dev/null @@ -1,63 +0,0 @@ -From: Matthias Schiffer -Date: Sat, 23 Nov 2019 16:43:00 +0100 -Subject: Revert "kernel: nf_conntrack_rtcache: fix cleanup on netns delete and rmmod" - -This reverts commit 436dbf12aa7381bd6db1b03b36be5a73df386eb4. - -https://bugs.openwrt.org/index.php?do=details&task_id=2624 - -Signed-off-by: Matthias Schiffer - -diff --git a/target/linux/generic/backport-4.14/020-backport_netfilter_rtcache.patch b/target/linux/generic/backport-4.14/020-backport_netfilter_rtcache.patch -index d745a970269061c56ef92677db0e85e96207f58b..8a6fba4307c2f7f7384f7274f39cf54c1a0ea7ae 100644 ---- a/target/linux/generic/backport-4.14/020-backport_netfilter_rtcache.patch -+++ b/target/linux/generic/backport-4.14/020-backport_netfilter_rtcache.patch -@@ -127,7 +127,7 @@ Signed-off-by: Florian Westphal - # netlink interface for nf_conntrack - --- /dev/null - +++ b/net/netfilter/nf_conntrack_rtcache.c --@@ -0,0 +1,440 @@ -+@@ -0,0 +1,428 @@ - +/* route cache for netfilter. - + * - + * (C) 2014 Red Hat GmbH -@@ -444,11 +444,6 @@ Signed-off-by: Florian Westphal - + .destroy = nf_conn_rtcache_destroy, - +}; - + --+static int __net_init rtcache_net_init(struct net *net) --+{ --+ return nf_register_net_hooks(net, rtcache_ops, ARRAY_SIZE(rtcache_ops)); --+} --+ - +static void __net_exit rtcache_net_exit(struct net *net) - +{ - + /* remove hooks so no new connections get rtcache extension */ -@@ -456,7 +451,6 @@ Signed-off-by: Florian Westphal - +} - + - +static struct pernet_operations rtcache_ops_net_ops = { --+ .init = rtcache_net_init, - + .exit = rtcache_net_exit, - +}; - + -@@ -537,11 +531,6 @@ Signed-off-by: Florian Westphal - + synchronize_net(); - + - + unregister_netdevice_notifier(&nf_rtcache_notifier); --+ unregister_pernet_subsys(&rtcache_ops_net_ops); --+ for_each_net(net) --+ nf_unregister_net_hooks(net, rtcache_ops, ARRAY_SIZE(rtcache_ops)); --+ --+ synchronize_net(); - + - + rtnl_lock(); - + -@@ -558,7 +547,6 @@ Signed-off-by: Florian Westphal - + } - + - + rtnl_unlock(); --+ - + synchronize_net(); - + nf_ct_extend_unregister(&rtcache_extend); - +} From abf46c5f4260dac20ce33338d9ebb67544c7e887 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 23 Nov 2019 23:36:33 +0100 Subject: [PATCH 020/105] gluon-mesh-babel: fix compilation of respondd provider Adjust for changed libbabelhelper API. --- package/gluon-mesh-babel/src/respondd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/gluon-mesh-babel/src/respondd.c b/package/gluon-mesh-babel/src/respondd.c index d82ce6af..80c4f970 100644 --- a/package/gluon-mesh-babel/src/respondd.c +++ b/package/gluon-mesh-babel/src/respondd.c @@ -241,7 +241,7 @@ static struct json_object * get_babel_neighbours(void) { if (!neighbours) return NULL; - babelhelper_readbabeldata(&bhelper_ctx, (void*)neighbours, handle_neighbour); + babelhelper_readbabeldata(&bhelper_ctx, "dump", (void*)neighbours, handle_neighbour); return(neighbours); } @@ -593,7 +593,7 @@ static struct json_object * respondd_provider_statistics(void) { json_object_object_add(ret, "clients", get_clients()); json_object_object_add(ret, "traffic", get_traffic()); - babelhelper_readbabeldata(&bhelper_ctx, (void*)ret, handle_route_addgw_nexthop ); + babelhelper_readbabeldata(&bhelper_ctx, "dump", (void*)ret, handle_route_addgw_nexthop ); return ret; } From f715a58fdbd9b6f11b70bbc34162a114d869e542 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 24 Nov 2019 00:53:54 +0100 Subject: [PATCH 021/105] gluon-mesh-batman-adv: remove obsolete no_rebroadcast setting --- .../files/lib/netifd/proto/gluon_bat0.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/package/gluon-mesh-batman-adv/files/lib/netifd/proto/gluon_bat0.sh b/package/gluon-mesh-batman-adv/files/lib/netifd/proto/gluon_bat0.sh index aaf9c908..97cd343a 100755 --- a/package/gluon-mesh-batman-adv/files/lib/netifd/proto/gluon_bat0.sh +++ b/package/gluon-mesh-batman-adv/files/lib/netifd/proto/gluon_bat0.sh @@ -30,11 +30,6 @@ proto_gluon_bat0_renew() { read data echo bat0 > "/sys/class/net/$dev/batman_adv/mesh_iface" - - ! [ "$(echo "$data" | jsonfilter -e "@.transitive")" = 'true' ] - transitive=$? - - (echo "$transitive" > "/sys/class/net/$dev/batman_adv/no_rebroadcast") 2>/dev/null done lock -u /var/lock/gluon_bat0.lock From b4101e54e0122099619b70310456ef5dca0bd2c1 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 24 Nov 2019 01:10:59 +0100 Subject: [PATCH 022/105] gluon-mesh-batman-adv: remove remaining deprecated sysfs usage While we're at it, also slightly optimize proto_gluon_bat0_renew. --- .../core/mesh/teardown.d/70-gluon-mesh-batman-adv | 2 +- .../files/lib/netifd/proto/gluon_bat0.sh | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/package/gluon-mesh-batman-adv/files/lib/gluon/core/mesh/teardown.d/70-gluon-mesh-batman-adv b/package/gluon-mesh-batman-adv/files/lib/gluon/core/mesh/teardown.d/70-gluon-mesh-batman-adv index 355b89b0..a8850f18 100755 --- a/package/gluon-mesh-batman-adv/files/lib/gluon/core/mesh/teardown.d/70-gluon-mesh-batman-adv +++ b/package/gluon-mesh-batman-adv/files/lib/gluon/core/mesh/teardown.d/70-gluon-mesh-batman-adv @@ -1,5 +1,5 @@ #!/bin/sh lock /var/lock/gluon_bat0.lock -(echo 'none' > "/sys/class/net/$IFNAME/batman_adv/mesh_iface") 2>/dev/null +batctl interface del "$IFNAME" 2>/dev/null lock -u /var/lock/gluon_bat0.lock diff --git a/package/gluon-mesh-batman-adv/files/lib/netifd/proto/gluon_bat0.sh b/package/gluon-mesh-batman-adv/files/lib/netifd/proto/gluon_bat0.sh index 97cd343a..f5c54ea3 100755 --- a/package/gluon-mesh-batman-adv/files/lib/netifd/proto/gluon_bat0.sh +++ b/package/gluon-mesh-batman-adv/files/lib/netifd/proto/gluon_bat0.sh @@ -22,15 +22,9 @@ proto_gluon_bat0_renew() { lock /var/lock/gluon_bat0.lock - local ifdump="$(ubus call network.interface dump)" - - echo "$ifdump" | jsonfilter \ - -e "@.interface[@.proto='gluon_mesh' && @.up=true]['device','data']" \ - | while read dev; do - read data - - echo bat0 > "/sys/class/net/$dev/batman_adv/mesh_iface" - done + ubus call network.interface dump | jsonfilter \ + -e "@.interface[@.proto='gluon_mesh' && @.up=true].device" \ + | xargs -r -n 1 batctl interface add lock -u /var/lock/gluon_bat0.lock } From caf2dd037ba4b560a0794ce87d6a230e7a6cbcf8 Mon Sep 17 00:00:00 2001 From: lemoer Date: Sun, 24 Nov 2019 01:15:18 +0100 Subject: [PATCH 023/105] gluon-status-page: add gateway_nexthop to status page statistics --- .../lib/gluon/status-page/view/status-page.html | 1 + package/gluon-status-page/i18n/de.po | 3 +++ .../gluon-status-page/i18n/gluon-status-page.pot | 3 +++ .../gluon-status-page/javascript/status-page.js | 14 ++++++++++++++ 4 files changed, 21 insertions(+) diff --git a/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html b/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html index 6e18b010..641c79aa 100644 --- a/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html +++ b/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html @@ -136,6 +136,7 @@ <%:RAM%><%= statistics('memory', 'memory') %> <%:Filesystem%><%= statistics('rootfs_usage', 'percent') %> <%:Gateway%><%= statistics('gateway') %> + <%:Gateway Nexthop%><%= statistics('gateway_nexthop', 'neighbour') %> <%:Clients%><%= statistics('clients/total') %> diff --git a/package/gluon-status-page/i18n/de.po b/package/gluon-status-page/i18n/de.po index ef0374c0..5caebfde 100644 --- a/package/gluon-status-page/i18n/de.po +++ b/package/gluon-status-page/i18n/de.po @@ -55,6 +55,9 @@ msgstr "Weitergeleitet" msgid "Gateway" msgstr "Gateway" +msgid "Gateway Nexthop" +msgstr "Gateway Nexthop" + msgid "IP address" msgstr "IP-Adresse" diff --git a/package/gluon-status-page/i18n/gluon-status-page.pot b/package/gluon-status-page/i18n/gluon-status-page.pot index 766a5de8..e471e878 100644 --- a/package/gluon-status-page/i18n/gluon-status-page.pot +++ b/package/gluon-status-page/i18n/gluon-status-page.pot @@ -46,6 +46,9 @@ msgstr "" msgid "Gateway" msgstr "" +msgid "Gateway Nexthop" +msgstr "" + msgid "IP address" msgstr "" diff --git a/package/gluon-status-page/javascript/status-page.js b/package/gluon-status-page/javascript/status-page.js index e3405cf6..005a0897 100644 --- a/package/gluon-status-page/javascript/status-page.js +++ b/package/gluon-status-page/javascript/status-page.js @@ -112,6 +112,17 @@ 'bytes': function(bytes) { return prettyBytes(bytes); }, + 'neighbour': function(addr) { + for (var i in interfaces) { + var iface = interfaces[i]; + var neigh = iface.get_neigh(addr); + if (!neigh) + continue; + return neigh.get_hostname() + ' (' + i + ')'; + } + + return addr + ' (unknown iface)'; + } } @@ -582,6 +593,9 @@ } return { + 'get_hostname': function() { + return hostname.textContent; + }, 'update_nodeinfo': function(nodeinfo) { var addr = choose_address(nodeinfo.network.addresses); if (addr) { From 07ebac6a49a288a3f5b7c7fc4e45a38b265ff929 Mon Sep 17 00:00:00 2001 From: lemoer Date: Sun, 24 Nov 2019 02:12:47 +0100 Subject: [PATCH 024/105] gluon-status-page: show gateway_nexthop and gateway in one table row --- .../files/lib/gluon/status-page/view/status-page.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html b/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html index 641c79aa..0054e61f 100644 --- a/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html +++ b/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html @@ -135,8 +135,7 @@ <%:Load average%><%= statistics('loadavg', 'decimal') %> <%:RAM%><%= statistics('memory', 'memory') %> <%:Filesystem%><%= statistics('rootfs_usage', 'percent') %> - <%:Gateway%><%= statistics('gateway') %> - <%:Gateway Nexthop%><%= statistics('gateway_nexthop', 'neighbour') %> + <%:Gateway%><%= statistics('gateway') %>
via <%= statistics('gateway_nexthop', 'neighbour') %> <%:Clients%><%= statistics('clients/total') %> From 55eff45f96b435de2d3d94a0189ff99473e7828d Mon Sep 17 00:00:00 2001 From: lemoer Date: Sun, 24 Nov 2019 02:38:55 +0100 Subject: [PATCH 025/105] gluon-status-page: prettify nextnode when node is offline --- .../files/lib/gluon/status-page/view/status-page.html | 2 +- package/gluon-status-page/javascript/status-page.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html b/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html index 0054e61f..cb7aaa11 100644 --- a/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html +++ b/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html @@ -135,7 +135,7 @@ <%:Load average%><%= statistics('loadavg', 'decimal') %> <%:RAM%><%= statistics('memory', 'memory') %> <%:Filesystem%><%= statistics('rootfs_usage', 'percent') %> - <%:Gateway%><%= statistics('gateway') %>
via <%= statistics('gateway_nexthop', 'neighbour') %> + <%:Gateway%><%= statistics('gateway') %>
<%= statistics('gateway_nexthop', 'neighbour') %> <%:Clients%><%= statistics('clients/total') %> diff --git a/package/gluon-status-page/javascript/status-page.js b/package/gluon-status-page/javascript/status-page.js index 005a0897..b81d21a7 100644 --- a/package/gluon-status-page/javascript/status-page.js +++ b/package/gluon-status-page/javascript/status-page.js @@ -113,15 +113,18 @@ return prettyBytes(bytes); }, 'neighbour': function(addr) { + if (!addr) + return ''; + for (var i in interfaces) { var iface = interfaces[i]; var neigh = iface.get_neigh(addr); if (!neigh) continue; - return neigh.get_hostname() + ' (' + i + ')'; + return 'via ' + neigh.get_hostname() + ' (' + i + ')'; } - return addr + ' (unknown iface)'; + return 'via ' + addr + ' (unknown iface)'; } } From f34b302b2253da7fcc0af2fe7d81534cd22a6d9f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 23 Nov 2019 19:01:24 +0100 Subject: [PATCH 026/105] gluon-mesh-babel: remove explicit ubus socket specification, convert timeout to expected units --- package/gluon-mesh-babel/src/respondd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/package/gluon-mesh-babel/src/respondd.c b/package/gluon-mesh-babel/src/respondd.c index 80c4f970..5251e89c 100644 --- a/package/gluon-mesh-babel/src/respondd.c +++ b/package/gluon-mesh-babel/src/respondd.c @@ -74,8 +74,7 @@ #define IFNAMELEN 32 #define PROTOLEN 32 -#define UBUS_TIMEOUT 30 -#define UBUS_SOCKET "/var/run/ubus.sock" +#define UBUS_TIMEOUT 30000 static struct babelhelper_ctx bhelper_ctx = {}; @@ -330,7 +329,7 @@ static struct json_object * get_mesh_ifs() { unsigned int id=8; - ubus_ctx = ubus_connect(UBUS_SOCKET); + ubus_ctx = ubus_connect(NULL); if (!ubus_ctx) { fprintf(stderr,"could not connect to ubus, not providing mesh-data\n"); goto end; @@ -338,7 +337,7 @@ static struct json_object * get_mesh_ifs() { blob_buf_init(&b, 0); ubus_lookup_id(ubus_ctx, "network.interface", &id); - int uret = ubus_invoke(ubus_ctx, id, "dump", b.head, receive_call_result_data, &ret, UBUS_TIMEOUT * 1000); + int uret = ubus_invoke(ubus_ctx, id, "dump", b.head, receive_call_result_data, &ret, UBUS_TIMEOUT); if (uret > 0) fprintf(stderr, "ubus command failed: %s\n", ubus_strerror(uret)); From 0f1fa243f781ee5eef9ed4bc1b3c5397136ac2da Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 23 Nov 2019 21:32:15 +0100 Subject: [PATCH 027/105] Move common code from gluon-mesh-babel and -batman-adv respondd providers to gluon-respondd In addition this PR contains: - split of gluon-respondd provider into multiple source files - minor additional cleanups in gluon-mesh-babel respondd provider (untested, as the babel respondd provider already doesn't compile prior to these changes...) --- package/gluon-mesh-babel/src/Makefile | 2 +- package/gluon-mesh-babel/src/respondd.c | 230 ++----------- package/gluon-mesh-batman-adv/src/Makefile | 2 +- package/gluon-mesh-batman-adv/src/respondd.c | 175 +--------- package/gluon-respondd/src/Makefile | 6 +- package/gluon-respondd/src/respondd-common.h | 32 ++ .../gluon-respondd/src/respondd-neighbours.c | 130 ++++++++ .../gluon-respondd/src/respondd-nodeinfo.c | 132 ++++++++ .../gluon-respondd/src/respondd-statistics.c | 309 +++++++++++++++++ package/gluon-respondd/src/respondd.c | 310 +----------------- 10 files changed, 649 insertions(+), 679 deletions(-) create mode 100644 package/gluon-respondd/src/respondd-common.h create mode 100644 package/gluon-respondd/src/respondd-neighbours.c create mode 100644 package/gluon-respondd/src/respondd-nodeinfo.c create mode 100644 package/gluon-respondd/src/respondd-statistics.c diff --git a/package/gluon-mesh-babel/src/Makefile b/package/gluon-mesh-babel/src/Makefile index 98a22d5e..80d29fa9 100644 --- a/package/gluon-mesh-babel/src/Makefile +++ b/package/gluon-mesh-babel/src/Makefile @@ -25,7 +25,7 @@ LDFLAGS_JSONC = $(shell pkg-config --libs json-c) respondd.so: respondd.c handle_neighbour.c - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -shared $(LDFLAGS_JSONC) -o $@ $^ -lgluonutil -lblobmsg_json -lubox -lubus -liwinfo -luci + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -shared $(LDFLAGS_JSONC) -o $@ $^ -lgluonutil -lblobmsg_json -lubox -lubus -luci neighbours-babel: neighbours-babel.c handle_neighbour.c $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_JSONC) $(LDFLAGS) $(LDLIBS) $(LDFLAGS_JSONC) -o $@ $^ diff --git a/package/gluon-mesh-babel/src/respondd.c b/package/gluon-mesh-babel/src/respondd.c index 5251e89c..96195d89 100644 --- a/package/gluon-mesh-babel/src/respondd.c +++ b/package/gluon-mesh-babel/src/respondd.c @@ -26,17 +26,15 @@ #include -#include #include #include #include -#include -#include #include #include #include #include +#include #include #include @@ -49,29 +47,15 @@ #include #include -#include -#include -#include - #include -#include "errno.h" +#include #include #include -#include "libubus.h" - -#define _STRINGIFY(s) #s -#define STRINGIFY(s) _STRINGIFY(s) -#include - -#define MAX_INACTIVITY 60000 +#include #define SOCKET_INPUT_BUFFER_SIZE 255 -#define BABEL_PORT 33123 -#define VPN_INTERFACE "mesh-vpn" -#define l3rdctl "/var/run/l3roamd.sock" -#define IFNAMELEN 32 #define PROTOLEN 32 #define UBUS_TIMEOUT 30000 @@ -257,9 +241,9 @@ static void blobmsg_handle_element(struct blob_attr *attr, bool head, char **ifn switch (blob_id(attr)) { case BLOBMSG_TYPE_STRING: - if (!strncmp(blobmsg_name(attr),"device", 6)) { + if (!strncmp(blobmsg_name(attr), "device", 6)) { free(*ifname); - *ifname = strndup(data, IFNAMELEN); + *ifname = strndup(data, IF_NAMESIZE); } else if (!strncmp(blobmsg_name(attr), "proto", 5)) { free(*proto); *proto = strndup(data, PROTOLEN); @@ -385,34 +369,40 @@ static struct json_object * respondd_provider_nodeinfo(void) { return ret; } -static uint64_t getnumber(const char *ifname, const char *stat) { +static struct json_object * read_number(const char *ifname, const char *stat) { const char *format = "/sys/class/net/%s/statistics/%s"; + + struct json_object *ret = NULL; + int64_t i; + char path[strlen(format) + strlen(ifname) + strlen(stat) + 1]; snprintf(path, sizeof(path), format, ifname, stat); - if (! access(path, F_OK)) { - char *line=gluonutil_read_line(path); - long long i = atoll(line); - free(line); - return(i); - } - return 0; + + FILE *f = fopen(path, "r"); + if (!f) + return NULL; + + if (fscanf(f, "%"SCNd64, &i) == 1) + ret = json_object_new_int64(i); + + fclose(f); + + return ret; } static struct json_object * get_traffic(void) { - char ifname[16]; - - strncpy(ifname, "br-client", 16); + const char *ifname = "br-client"; struct json_object *ret = NULL; struct json_object *rx = json_object_new_object(); struct json_object *tx = json_object_new_object(); - json_object_object_add(rx, "packets", json_object_new_int64(getnumber(ifname, "rx_packets"))); - json_object_object_add(rx, "bytes", json_object_new_int64(getnumber(ifname, "rx_bytes"))); - json_object_object_add(rx, "dropped", json_object_new_int64(getnumber(ifname, "rx_dropped"))); - json_object_object_add(tx, "packets", json_object_new_int64(getnumber(ifname, "tx_packets"))); - json_object_object_add(tx, "dropped", json_object_new_int64(getnumber(ifname, "tx_dropped"))); - json_object_object_add(tx, "bytes", json_object_new_int64(getnumber(ifname, "tx_bytes"))); + json_object_object_add(rx, "packets", read_number(ifname, "rx_packets")); + json_object_object_add(rx, "bytes", read_number(ifname, "rx_bytes")); + json_object_object_add(rx, "dropped", read_number(ifname, "rx_dropped")); + json_object_object_add(tx, "packets", read_number(ifname, "tx_packets")); + json_object_object_add(tx, "dropped", read_number(ifname, "tx_dropped")); + json_object_object_add(tx, "bytes", read_number(ifname, "tx_bytes")); ret = json_object_new_object(); json_object_object_add(ret, "rx", rx); @@ -421,72 +411,6 @@ static struct json_object * get_traffic(void) { return ret; } -static void count_iface_stations(size_t *wifi24, size_t *wifi5, const char *ifname) { - const struct iwinfo_ops *iw = iwinfo_backend(ifname); - if (!iw) - return; - - int freq; - if (iw->frequency(ifname, &freq) < 0) - return; - - size_t *wifi; - if (freq >= 2400 && freq < 2500) - wifi = wifi24; - else if (freq >= 5000 && freq < 6000) - wifi = wifi5; - else - return; - - int len; - char buf[IWINFO_BUFSIZE]; - if (iw->assoclist(ifname, buf, &len) < 0) - return; - - struct iwinfo_assoclist_entry *entry; - for (entry = (struct iwinfo_assoclist_entry *)buf; (char*)(entry+1) <= buf + len; entry++) { - if (entry->inactive > MAX_INACTIVITY) - continue; - - (*wifi)++; - } -} - -static void count_stations(size_t *wifi24, size_t *wifi5) { - struct uci_context *ctx = uci_alloc_context(); - ctx->flags &= ~UCI_FLAG_STRICT; - - - struct uci_package *p; - if (uci_load(ctx, "wireless", &p)) - goto end; - - - struct uci_element *e; - uci_foreach_element(&p->sections, e) { - struct uci_section *s = uci_to_section(e); - if (strcmp(s->type, "wifi-iface")) - continue; - - const char *network = uci_lookup_option_string(ctx, s, "network"); - if (!network || strcmp(network, "client")) - continue; - - const char *mode = uci_lookup_option_string(ctx, s, "mode"); - if (!mode || strcmp(mode, "ap")) - continue; - - const char *ifname = uci_lookup_option_string(ctx, s, "ifname"); - if (!ifname) - continue; - - count_iface_stations(wifi24, wifi5, ifname); - } - -end: - uci_free_context(ctx); -} - static bool handle_route_addgw_nexthop(char **data, void *arg) { struct json_object *obj = (struct json_object*) arg; if (data[PREFIX] && data[FROM] && data[VIA] && data[IF]) { @@ -568,21 +492,12 @@ end: } static struct json_object * get_clients(void) { - size_t wifi24 = 0, wifi5 = 0; - - count_stations(&wifi24, &wifi5); - - int total = ask_l3roamd_for_client_count(); - - size_t wifi = wifi24 + wifi5; struct json_object *ret = json_object_new_object(); + int total = ask_l3roamd_for_client_count(); if (total >= 0) json_object_object_add(ret, "total", json_object_new_int(total)); - json_object_object_add(ret, "wifi", json_object_new_int(wifi)); - json_object_object_add(ret, "wifi24", json_object_new_int(wifi24)); - json_object_object_add(ret, "wifi5", json_object_new_int(wifi5)); return ret; } @@ -597,89 +512,6 @@ static struct json_object * respondd_provider_statistics(void) { return ret; } -static struct json_object * get_wifi_neighbours(const char *ifname) { - const struct iwinfo_ops *iw = iwinfo_backend(ifname); - if (!iw) - return NULL; - - int len; - char buf[IWINFO_BUFSIZE]; - if (iw->assoclist(ifname, buf, &len) < 0) - return NULL; - - struct json_object *neighbours = json_object_new_object(); - - struct iwinfo_assoclist_entry *entry; - for (entry = (struct iwinfo_assoclist_entry *)buf; (char*)(entry+1) <= buf + len; entry++) { - if (entry->inactive > MAX_INACTIVITY) - continue; - - struct json_object *obj = json_object_new_object(); - - json_object_object_add(obj, "signal", json_object_new_int(entry->signal)); - json_object_object_add(obj, "noise", json_object_new_int(entry->noise)); - json_object_object_add(obj, "inactive", json_object_new_int(entry->inactive)); - - char mac[18]; - snprintf(mac, sizeof(mac), "%02x:%02x:%02x:%02x:%02x:%02x", - entry->mac[0], entry->mac[1], entry->mac[2], - entry->mac[3], entry->mac[4], entry->mac[5]); - - json_object_object_add(neighbours, mac, obj); - } - - struct json_object *ret = json_object_new_object(); - - if (json_object_object_length(neighbours)) - json_object_object_add(ret, "neighbours", neighbours); - else - json_object_put(neighbours); - - return ret; -} - -static struct json_object * get_wifi(void) { - - struct uci_context *ctx = uci_alloc_context(); - ctx->flags &= ~UCI_FLAG_STRICT; - - struct json_object *ret = json_object_new_object(); - - struct uci_package *p; - if (uci_load(ctx, "network", &p)) - goto end; - - - struct uci_element *e; - uci_foreach_element(&p->sections, e) { - struct uci_section *s = uci_to_section(e); - if (strcmp(s->type, "interface")) - continue; - - const char *proto = uci_lookup_option_string(ctx, s, "proto"); - if (!proto || strcmp(proto, "gluon_mesh")) - continue; - - const char *ifname = uci_lookup_option_string(ctx, s, "ifname"); - if (!ifname) - continue; - - char *ifaddr = gluonutil_get_interface_address(ifname); - if (!ifaddr) - continue; - - struct json_object *neighbours = get_wifi_neighbours(ifname); - if (neighbours) - json_object_object_add(ret, ifaddr, neighbours); - - free(ifaddr); - } - -end: - uci_free_context(ctx); - return ret; -} - static struct json_object * respondd_provider_neighbours(void) { struct json_object *ret = json_object_new_object(); @@ -688,10 +520,6 @@ static struct json_object * respondd_provider_neighbours(void) { json_object_object_add(ret, "babel", babel); - struct json_object *wifi = get_wifi(); - if (wifi) - json_object_object_add(ret, "wifi", wifi); - return ret; } diff --git a/package/gluon-mesh-batman-adv/src/Makefile b/package/gluon-mesh-batman-adv/src/Makefile index 0974669b..b40c52b1 100644 --- a/package/gluon-mesh-batman-adv/src/Makefile +++ b/package/gluon-mesh-batman-adv/src/Makefile @@ -32,4 +32,4 @@ CFLAGS += $(LIBBATADV_CFLAGS) LDLIBS += $(LIBBATADV_LDLIBS) respondd.so: respondd.c - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -fPIC -D_GNU_SOURCE -o $@ $^ $(LDLIBS) -lgluonutil -liwinfo -luci + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -fPIC -D_GNU_SOURCE -o $@ $^ $(LDLIBS) -lgluonutil -luci diff --git a/package/gluon-mesh-batman-adv/src/respondd.c b/package/gluon-mesh-batman-adv/src/respondd.c index c2b20399..1df8d43f 100644 --- a/package/gluon-mesh-batman-adv/src/respondd.c +++ b/package/gluon-mesh-batman-adv/src/respondd.c @@ -26,8 +26,6 @@ #include -#include -#include #include #include #include @@ -59,9 +57,6 @@ #include -#define _STRINGIFY(s) #s -#define STRINGIFY(s) _STRINGIFY(s) - #define MAX_INACTIVITY 60000 @@ -76,7 +71,7 @@ struct gw_netlink_opts { }; struct clients_netlink_opts { - size_t non_wifi; + size_t clients; struct batadv_nlquery_opts query_opts; }; @@ -429,74 +424,6 @@ static struct json_object * get_traffic(void) { return ret; } -static void count_iface_stations(size_t *wifi24, size_t *wifi5, const char *ifname) { - const struct iwinfo_ops *iw = iwinfo_backend(ifname); - if (!iw) - return; - - int freq; - if (iw->frequency(ifname, &freq) < 0) - return; - - size_t *wifi; - if (freq >= 2400 && freq < 2500) - wifi = wifi24; - else if (freq >= 5000 && freq < 6000) - wifi = wifi5; - else - return; - - int len; - char buf[IWINFO_BUFSIZE]; - if (iw->assoclist(ifname, buf, &len) < 0) - return; - - struct iwinfo_assoclist_entry *entry; - for (entry = (struct iwinfo_assoclist_entry *)buf; (char*)(entry+1) <= buf + len; entry++) { - if (entry->inactive > MAX_INACTIVITY) - continue; - - (*wifi)++; - } -} - -static void count_stations(size_t *wifi24, size_t *wifi5) { - struct uci_context *ctx = uci_alloc_context(); - if (!ctx) - return; - ctx->flags &= ~UCI_FLAG_STRICT; - - - struct uci_package *p; - if (uci_load(ctx, "wireless", &p)) - goto end; - - - struct uci_element *e; - uci_foreach_element(&p->sections, e) { - struct uci_section *s = uci_to_section(e); - if (strcmp(s->type, "wifi-iface")) - continue; - - const char *network = uci_lookup_option_string(ctx, s, "network"); - if (!network || strcmp(network, "client")) - continue; - - const char *mode = uci_lookup_option_string(ctx, s, "mode"); - if (!mode || strcmp(mode, "ap")) - continue; - - const char *ifname = uci_lookup_option_string(ctx, s, "ifname"); - if (!ifname) - continue; - - count_iface_stations(wifi24, wifi5, ifname); - } - - end: - uci_free_context(ctx); -} - static const enum batadv_nl_attrs clients_mandatory[] = { BATADV_ATTR_TT_FLAGS, /* Entries without the BATADV_TT_CLIENT_NOPURGE flag do not have a @@ -537,24 +464,21 @@ static int parse_clients_list_netlink_cb(struct nl_msg *msg, void *arg) flags = nla_get_u32(attrs[BATADV_ATTR_TT_FLAGS]); - if (flags & (BATADV_TT_CLIENT_NOPURGE | BATADV_TT_CLIENT_WIFI)) + if (flags & (BATADV_TT_CLIENT_NOPURGE)) return NL_OK; lastseen = nla_get_u32(attrs[BATADV_ATTR_LAST_SEEN_MSECS]); if (lastseen > MAX_INACTIVITY) return NL_OK; - opts->non_wifi++; + opts->clients++; return NL_OK; } static struct json_object * get_clients(void) { - size_t wifi24 = 0, wifi5 = 0; - size_t total; - size_t wifi; struct clients_netlink_opts opts = { - .non_wifi = 0, + .clients = 0, .query_opts = { .err = 0, }, @@ -564,15 +488,10 @@ static struct json_object * get_clients(void) { parse_clients_list_netlink_cb, NLM_F_DUMP, &opts.query_opts); - count_stations(&wifi24, &wifi5); - wifi = wifi24 + wifi5; - total = wifi + opts.non_wifi; - struct json_object *ret = json_object_new_object(); - json_object_object_add(ret, "total", json_object_new_int(total)); - json_object_object_add(ret, "wifi", json_object_new_int(wifi)); - json_object_object_add(ret, "wifi24", json_object_new_int(wifi24)); - json_object_object_add(ret, "wifi5", json_object_new_int(wifi5)); + + json_object_object_add(ret, "total", json_object_new_int(opts.clients)); + return ret; } @@ -679,7 +598,7 @@ static int parse_orig_list_netlink_cb(struct nl_msg *msg, void *arg) json_object_object_add(obj, "tq", json_object_new_int(tq)); json_object_object_add(obj, "lastseen", json_object_new_double(lastseen / 1000.)); - json_object_object_add(obj, "best", json_object_new_boolean(attrs[BATADV_ATTR_FLAG_BEST])); + json_object_object_add(obj, "best", json_object_new_boolean(!!attrs[BATADV_ATTR_FLAG_BEST])); json_object_object_add(interface, mac1, obj); return NL_OK; @@ -708,80 +627,6 @@ static struct json_object * get_batadv(void) { return ifnames2addrs(opts.interfaces); } -static struct json_object * get_wifi_neighbours(const char *ifname) { - const struct iwinfo_ops *iw = iwinfo_backend(ifname); - if (!iw) - return NULL; - - int len; - char buf[IWINFO_BUFSIZE]; - if (iw->assoclist(ifname, buf, &len) < 0) - return NULL; - - struct json_object *neighbours = json_object_new_object(); - - struct iwinfo_assoclist_entry *entry; - for (entry = (struct iwinfo_assoclist_entry *)buf; (char*)(entry+1) <= buf + len; entry++) { - if (entry->inactive > MAX_INACTIVITY) - continue; - - struct json_object *obj = json_object_new_object(); - - json_object_object_add(obj, "signal", json_object_new_int(entry->signal)); - json_object_object_add(obj, "noise", json_object_new_int(entry->noise)); - json_object_object_add(obj, "inactive", json_object_new_int(entry->inactive)); - - char mac[18]; - snprintf(mac, sizeof(mac), "%02x:%02x:%02x:%02x:%02x:%02x", - entry->mac[0], entry->mac[1], entry->mac[2], - entry->mac[3], entry->mac[4], entry->mac[5]); - - json_object_object_add(neighbours, mac, obj); - } - - struct json_object *ret = json_object_new_object(); - - if (json_object_object_length(neighbours)) - json_object_object_add(ret, "neighbours", neighbours); - else - json_object_put(neighbours); - - return ret; -} - -static struct json_object * get_wifi(void) { - const char *mesh = "bat0"; - - struct json_object *ret = json_object_new_object(); - - const char *format = "/sys/class/net/%s/lower_*"; - char pattern[strlen(format) + strlen(mesh)]; - snprintf(pattern, sizeof(pattern), format, mesh); - - size_t pattern_len = strlen(pattern); - - glob_t lower; - if (!glob(pattern, GLOB_NOSORT, NULL, &lower)) { - size_t i; - for (i = 0; i < lower.gl_pathc; i++) { - const char *ifname = lower.gl_pathv[i] + pattern_len - 1; - char *ifaddr = gluonutil_get_interface_address(ifname); - if (!ifaddr) - continue; - - struct json_object *neighbours = get_wifi_neighbours(ifname); - if (neighbours) - json_object_object_add(ret, ifaddr, neighbours); - - free(ifaddr); - } - - globfree(&lower); - } - - return ret; -} - static struct json_object * respondd_provider_neighbours(void) { struct json_object *ret = json_object_new_object(); @@ -789,10 +634,6 @@ static struct json_object * respondd_provider_neighbours(void) { if (batadv) json_object_object_add(ret, "batadv", batadv); - struct json_object *wifi = get_wifi(); - if (wifi) - json_object_object_add(ret, "wifi", wifi); - return ret; } diff --git a/package/gluon-respondd/src/Makefile b/package/gluon-respondd/src/Makefile index f26b59a2..9e1e831d 100644 --- a/package/gluon-respondd/src/Makefile +++ b/package/gluon-respondd/src/Makefile @@ -2,5 +2,7 @@ all: respondd.so CFLAGS += -Wall -respondd.so: respondd.c - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -fPIC -D_GNU_SOURCE -o $@ $^ $(LDLIBS) -lgluonutil -lplatforminfo -luci +SOURCES = respondd.c respondd-nodeinfo.c respondd-statistics.c respondd-neighbours.c + +respondd.so: $(SOURCES) respondd-common.h + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -fPIC -fvisibility=hidden -D_GNU_SOURCE -o $@ $(SOURCES) $(LDLIBS) -lgluonutil -lplatforminfo -luci -liwinfo diff --git a/package/gluon-respondd/src/respondd-common.h b/package/gluon-respondd/src/respondd-common.h new file mode 100644 index 00000000..db40cbaf --- /dev/null +++ b/package/gluon-respondd/src/respondd-common.h @@ -0,0 +1,32 @@ +/* + Copyright (c) 2016-2019, Matthias Schiffer + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#pragma once + +#define MAX_INACTIVITY 60000 + +struct json_object * respondd_provider_nodeinfo(void); +struct json_object * respondd_provider_statistics(void); +struct json_object * respondd_provider_neighbours(void); diff --git a/package/gluon-respondd/src/respondd-neighbours.c b/package/gluon-respondd/src/respondd-neighbours.c new file mode 100644 index 00000000..2a07634f --- /dev/null +++ b/package/gluon-respondd/src/respondd-neighbours.c @@ -0,0 +1,130 @@ +/* + Copyright (c) 2016-2019, Matthias Schiffer + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "respondd-common.h" + +#include + +#include +#include + + +static struct json_object * get_wifi_neighbours(const char *ifname) { + const struct iwinfo_ops *iw = iwinfo_backend(ifname); + if (!iw) + return NULL; + + int len; + char buf[IWINFO_BUFSIZE]; + if (iw->assoclist(ifname, buf, &len) < 0) + return NULL; + + struct json_object *neighbours = json_object_new_object(); + + struct iwinfo_assoclist_entry *entry; + for (entry = (struct iwinfo_assoclist_entry *)buf; (char*)(entry+1) <= buf + len; entry++) { + if (entry->inactive > MAX_INACTIVITY) + continue; + + struct json_object *obj = json_object_new_object(); + + json_object_object_add(obj, "signal", json_object_new_int(entry->signal)); + json_object_object_add(obj, "noise", json_object_new_int(entry->noise)); + json_object_object_add(obj, "inactive", json_object_new_int(entry->inactive)); + + char mac[18]; + snprintf(mac, sizeof(mac), "%02x:%02x:%02x:%02x:%02x:%02x", + entry->mac[0], entry->mac[1], entry->mac[2], + entry->mac[3], entry->mac[4], entry->mac[5]); + + json_object_object_add(neighbours, mac, obj); + } + + struct json_object *ret = json_object_new_object(); + + if (json_object_object_length(neighbours)) + json_object_object_add(ret, "neighbours", neighbours); + else + json_object_put(neighbours); + + return ret; +} + +static struct json_object * get_wifi(void) { + struct uci_context *ctx = uci_alloc_context(); + if (!ctx) + return NULL; + + ctx->flags &= ~UCI_FLAG_STRICT; + + struct json_object *ret = json_object_new_object(); + + struct uci_package *p; + if (uci_load(ctx, "network", &p)) + goto end; + + + struct uci_element *e; + uci_foreach_element(&p->sections, e) { + struct uci_section *s = uci_to_section(e); + if (strcmp(s->type, "interface")) + continue; + + const char *proto = uci_lookup_option_string(ctx, s, "proto"); + if (!proto || strcmp(proto, "gluon_mesh")) + continue; + + const char *ifname = uci_lookup_option_string(ctx, s, "ifname"); + if (!ifname) + continue; + + char *ifaddr = gluonutil_get_interface_address(ifname); + if (!ifaddr) + continue; + + struct json_object *neighbours = get_wifi_neighbours(ifname); + if (neighbours) + json_object_object_add(ret, ifaddr, neighbours); + + free(ifaddr); + } + +end: + uci_free_context(ctx); + return ret; +} + +struct json_object * respondd_provider_neighbours(void) { + struct json_object *ret = json_object_new_object(); + + json_object_object_add(ret, "node_id", gluonutil_wrap_and_free_string(gluonutil_get_node_id())); + + struct json_object *wifi = get_wifi(); + if (wifi) + json_object_object_add(ret, "wifi", wifi); + + + return ret; +} diff --git a/package/gluon-respondd/src/respondd-nodeinfo.c b/package/gluon-respondd/src/respondd-nodeinfo.c new file mode 100644 index 00000000..f70abc9a --- /dev/null +++ b/package/gluon-respondd/src/respondd-nodeinfo.c @@ -0,0 +1,132 @@ +/* + Copyright (c) 2016-2019, Matthias Schiffer + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "respondd-common.h" + +#include +#include + +#include +#include + +#include +#include +#include + + +static struct json_object * gluon_version(void) { + char *version = gluonutil_read_line("/lib/gluon/gluon-version"); + if (!version) + return NULL; + + char full_version[6 + strlen(version) + 1]; + snprintf(full_version, sizeof(full_version), "gluon-%s", version); + + free(version); + + + return json_object_new_string(full_version); +} + +static struct json_object * get_site_code(void) { + struct json_object *site = gluonutil_load_site_config(); + if (!site) + return NULL; + + struct json_object *ret = NULL; + json_object_object_get_ex(site, "site_code", &ret); + if (ret) + json_object_get(ret); + + json_object_put(site); + return ret; +} + +static struct json_object * get_domain_code(void) { + return gluonutil_wrap_and_free_string(gluonutil_get_domain()); +} + +static struct json_object * get_hostname(void) { + struct json_object *ret = NULL; + + struct uci_context *ctx = uci_alloc_context(); + if (!ctx) + return NULL; + ctx->flags &= ~UCI_FLAG_STRICT; + + char section[] = "system.@system[0]"; + struct uci_ptr ptr; + if (uci_lookup_ptr(ctx, &ptr, section, true)) + goto error; + + struct uci_section *s = ptr.s; + + const char *hostname = uci_lookup_option_string(ctx, s, "pretty_hostname"); + + if (!hostname) + hostname = uci_lookup_option_string(ctx, s, "hostname"); + + ret = gluonutil_wrap_string(hostname); + +error: + uci_free_context(ctx); + + return ret; +} + +struct json_object * respondd_provider_nodeinfo(void) { + struct json_object *ret = json_object_new_object(); + + json_object_object_add(ret, "node_id", gluonutil_wrap_and_free_string(gluonutil_get_node_id())); + json_object_object_add(ret, "hostname", get_hostname()); + + struct json_object *hardware = json_object_new_object(); + + const char *model = platforminfo_get_model(); + if (model) + json_object_object_add(hardware, "model", json_object_new_string(model)); + + json_object_object_add(hardware, "nproc", json_object_new_int(sysconf(_SC_NPROCESSORS_ONLN))); + json_object_object_add(ret, "hardware", hardware); + + struct json_object *network = json_object_new_object(); + json_object_object_add(network, "mac", gluonutil_wrap_and_free_string(gluonutil_get_sysconfig("primary_mac"))); + json_object_object_add(ret, "network", network); + + struct json_object *software = json_object_new_object(); + struct json_object *software_firmware = json_object_new_object(); + json_object_object_add(software_firmware, "base", gluon_version()); + json_object_object_add(software_firmware, "release", gluonutil_wrap_and_free_string(gluonutil_read_line("/lib/gluon/release"))); + json_object_object_add(software, "firmware", software_firmware); + json_object_object_add(ret, "software", software); + + struct json_object *system = json_object_new_object(); + json_object_object_add(system, "site_code", get_site_code()); + if (gluonutil_has_domains()) + json_object_object_add(system, "domain_code", get_domain_code()); + json_object_object_add(ret, "system", system); + + return ret; +} diff --git a/package/gluon-respondd/src/respondd-statistics.c b/package/gluon-respondd/src/respondd-statistics.c new file mode 100644 index 00000000..634b2942 --- /dev/null +++ b/package/gluon-respondd/src/respondd-statistics.c @@ -0,0 +1,309 @@ +/* + Copyright (c) 2016-2019, Matthias Schiffer + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "respondd-common.h" + +#include + +#include +#include + +#include +#include +#include +#include + +#include + + +static void add_uptime(struct json_object *obj) { + FILE *f = fopen("/proc/uptime", "r"); + struct json_object* jso; + if (!f) + return; + + double uptime, idletime; + if (fscanf(f, "%lf %lf", &uptime, &idletime) == 2) { + jso = json_object_new_double(uptime); + json_object_set_serializer(jso, json_object_double_to_json_string, "%.2f", NULL); + json_object_object_add(obj, "uptime", jso); + jso = json_object_new_double(idletime); + json_object_set_serializer(jso, json_object_double_to_json_string, "%.2f", NULL); + json_object_object_add(obj, "idletime", jso); + } + + fclose(f); +} + +static void add_loadavg(struct json_object *obj) { + FILE *f = fopen("/proc/loadavg", "r"); + if (!f) + return; + + double loadavg; + unsigned proc_running, proc_total; + if (fscanf(f, "%lf %*f %*f %u/%u", &loadavg, &proc_running, &proc_total) == 3) { + struct json_object *jso = json_object_new_double(loadavg); + json_object_set_serializer(jso, json_object_double_to_json_string, "%.2f", NULL); + json_object_object_add(obj, "loadavg", jso); + + struct json_object *processes = json_object_new_object(); + json_object_object_add(processes, "running", json_object_new_int(proc_running)); + json_object_object_add(processes, "total", json_object_new_int(proc_total)); + json_object_object_add(obj, "processes", processes); + } + + fclose(f); +} + +static struct json_object * get_memory(void) { + FILE *f = fopen("/proc/meminfo", "r"); + if (!f) + return NULL; + + struct json_object *ret = json_object_new_object(); + + char *line = NULL; + size_t len = 0; + + while (getline(&line, &len, f) >= 0) { + char label[32]; + unsigned value; + + if (sscanf(line, "%31[^:]: %u", label, &value) != 2) + continue; + + if (!strcmp(label, "MemTotal")) + json_object_object_add(ret, "total", json_object_new_int(value)); + else if (!strcmp(label, "MemFree")) + json_object_object_add(ret, "free", json_object_new_int(value)); + else if (!strcmp(label, "MemAvailable")) + json_object_object_add(ret, "available", json_object_new_int(value)); + else if (!strcmp(label, "Buffers")) + json_object_object_add(ret, "buffers", json_object_new_int(value)); + else if (!strcmp(label, "Cached")) + json_object_object_add(ret, "cached", json_object_new_int(value)); + } + + free(line); + fclose(f); + + return ret; +} + +static struct json_object * get_stat(void) { + FILE *f = fopen("/proc/stat", "r"); + if (!f) + return NULL; + + struct json_object *stat = json_object_new_object(); + struct json_object *ret = NULL; + + char *line = NULL; + size_t len = 0; + + while (getline(&line, &len, f) >= 0) { + char label[32]; + + if (sscanf(line, "%31s", label) != 1){ + goto invalid_stat_format; + } + + if (!strcmp(label, "cpu")) { + int64_t user, nice, system, idle, iowait, irq, softirq; + if (sscanf(line, "%*s %"SCNd64" %"SCNd64" %"SCNd64" %"SCNd64" %"SCNd64" %"SCNd64" %"SCNd64, + &user, &nice, &system, &idle, &iowait, &irq, &softirq) != 7) + goto invalid_stat_format; + + struct json_object *cpu = json_object_new_object(); + + json_object_object_add(cpu, "user", json_object_new_int64(user)); + json_object_object_add(cpu, "nice", json_object_new_int64(nice)); + json_object_object_add(cpu, "system", json_object_new_int64(system)); + json_object_object_add(cpu, "idle", json_object_new_int64(idle)); + json_object_object_add(cpu, "iowait", json_object_new_int64(iowait)); + json_object_object_add(cpu, "irq", json_object_new_int64(irq)); + json_object_object_add(cpu, "softirq", json_object_new_int64(softirq)); + + json_object_object_add(stat, "cpu", cpu); + } else if (!strcmp(label, "ctxt")) { + int64_t ctxt; + if (sscanf(line, "%*s %"SCNd64, &ctxt) != 1) + goto invalid_stat_format; + + json_object_object_add(stat, "ctxt", json_object_new_int64(ctxt)); + } else if (!strcmp(label, "intr")) { + int64_t total_intr; + if (sscanf(line, "%*s %"SCNd64, &total_intr) != 1) + goto invalid_stat_format; + + json_object_object_add(stat, "intr", json_object_new_int64(total_intr)); + } else if (!strcmp(label, "softirq")) { + int64_t total_softirq; + if (sscanf(line, "%*s %"SCNd64, &total_softirq) != 1) + goto invalid_stat_format; + + json_object_object_add(stat, "softirq", json_object_new_int64(total_softirq)); + } else if (!strcmp(label, "processes")) { + int64_t processes; + if (sscanf(line, "%*s %"SCNd64, &processes) != 1) + goto invalid_stat_format; + + json_object_object_add(stat, "processes", json_object_new_int64(processes)); + } + + } + + ret = stat; + +invalid_stat_format: + if (!ret) + json_object_put(stat); + + free(line); + fclose(f); + + return ret; +} + + +static struct json_object * get_rootfs_usage(void) { + struct statfs s; + if (statfs("/", &s)) + return NULL; + + struct json_object *jso = json_object_new_double(1 - (double)s.f_bfree / s.f_blocks); + json_object_set_serializer(jso, json_object_double_to_json_string, "%.4f", NULL); + return jso; +} + +static struct json_object * get_time(void) { + struct timespec now; + + if (clock_gettime(CLOCK_REALTIME, &now) != 0) + return NULL; + + return json_object_new_int64(now.tv_sec); +} + +static void count_iface_stations(size_t *wifi24, size_t *wifi5, const char *ifname) { + const struct iwinfo_ops *iw = iwinfo_backend(ifname); + if (!iw) + return; + + int freq; + if (iw->frequency(ifname, &freq) < 0) + return; + + size_t *wifi; + if (freq >= 2400 && freq < 2500) + wifi = wifi24; + else if (freq >= 5000 && freq < 6000) + wifi = wifi5; + else + return; + + int len; + char buf[IWINFO_BUFSIZE]; + if (iw->assoclist(ifname, buf, &len) < 0) + return; + + struct iwinfo_assoclist_entry *entry; + for (entry = (struct iwinfo_assoclist_entry *)buf; (char*)(entry+1) <= buf + len; entry++) { + if (entry->inactive > MAX_INACTIVITY) + continue; + + (*wifi)++; + } +} + +static void count_stations(size_t *wifi24, size_t *wifi5) { + struct uci_context *ctx = uci_alloc_context(); + if (!ctx) + return; + ctx->flags &= ~UCI_FLAG_STRICT; + + + struct uci_package *p; + if (uci_load(ctx, "wireless", &p)) + goto end; + + + struct uci_element *e; + uci_foreach_element(&p->sections, e) { + struct uci_section *s = uci_to_section(e); + if (strcmp(s->type, "wifi-iface")) + continue; + + const char *network = uci_lookup_option_string(ctx, s, "network"); + if (!network || strcmp(network, "client")) + continue; + + const char *mode = uci_lookup_option_string(ctx, s, "mode"); + if (!mode || strcmp(mode, "ap")) + continue; + + const char *ifname = uci_lookup_option_string(ctx, s, "ifname"); + if (!ifname) + continue; + + count_iface_stations(wifi24, wifi5, ifname); + } + + end: + uci_free_context(ctx); +} + +static struct json_object * get_clients(void) { + size_t wifi24 = 0, wifi5 = 0; + + count_stations(&wifi24, &wifi5); + + struct json_object *ret = json_object_new_object(); + + json_object_object_add(ret, "wifi", json_object_new_int(wifi24 + wifi5)); + json_object_object_add(ret, "wifi24", json_object_new_int(wifi24)); + json_object_object_add(ret, "wifi5", json_object_new_int(wifi5)); + + return ret; +} + +struct json_object * respondd_provider_statistics(void) { + struct json_object *ret = json_object_new_object(); + + json_object_object_add(ret, "node_id", gluonutil_wrap_and_free_string(gluonutil_get_node_id())); + + json_object_object_add(ret, "time", get_time()); + json_object_object_add(ret, "rootfs_usage", get_rootfs_usage()); + json_object_object_add(ret, "memory", get_memory()); + json_object_object_add(ret, "stat", get_stat()); + + json_object_object_add(ret, "clients", get_clients()); + + add_uptime(ret); + add_loadavg(ret); + + return ret; +} diff --git a/package/gluon-respondd/src/respondd.c b/package/gluon-respondd/src/respondd.c index 04010c68..36188e46 100644 --- a/package/gluon-respondd/src/respondd.c +++ b/package/gluon-respondd/src/respondd.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2016, Matthias Schiffer + Copyright (c) 2016-2019, Matthias Schiffer All rights reserved. Redistribution and use in source and binary forms, with or without @@ -23,316 +23,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "respondd-common.h" #include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - - -static struct json_object * gluon_version(void) { - char *version = gluonutil_read_line("/lib/gluon/gluon-version"); - if (!version) - return NULL; - - char full_version[6 + strlen(version) + 1]; - snprintf(full_version, sizeof(full_version), "gluon-%s", version); - - free(version); - - - return json_object_new_string(full_version); -} - -static struct json_object * get_site_code(void) { - struct json_object *site = gluonutil_load_site_config(); - if (!site) - return NULL; - - struct json_object *ret = NULL; - json_object_object_get_ex(site, "site_code", &ret); - if (ret) - json_object_get(ret); - - json_object_put(site); - return ret; -} - -static struct json_object * get_domain_code(void) { - return gluonutil_wrap_and_free_string(gluonutil_get_domain()); -} - -static struct json_object * get_hostname(void) { - struct json_object *ret = NULL; - - struct uci_context *ctx = uci_alloc_context(); - if (!ctx) - return NULL; - ctx->flags &= ~UCI_FLAG_STRICT; - - char section[] = "system.@system[0]"; - struct uci_ptr ptr; - if (uci_lookup_ptr(ctx, &ptr, section, true)) - goto error; - - struct uci_section *s = ptr.s; - - const char *hostname = uci_lookup_option_string(ctx, s, "pretty_hostname"); - - if (!hostname) - hostname = uci_lookup_option_string(ctx, s, "hostname"); - - ret = gluonutil_wrap_string(hostname); - -error: - uci_free_context(ctx); - - return ret; -} - -static struct json_object * respondd_provider_nodeinfo(void) { - struct json_object *ret = json_object_new_object(); - - json_object_object_add(ret, "node_id", gluonutil_wrap_and_free_string(gluonutil_get_node_id())); - json_object_object_add(ret, "hostname", get_hostname()); - - struct json_object *hardware = json_object_new_object(); - - const char *model = platforminfo_get_model(); - if (model) - json_object_object_add(hardware, "model", json_object_new_string(model)); - - json_object_object_add(hardware, "nproc", json_object_new_int(sysconf(_SC_NPROCESSORS_ONLN))); - json_object_object_add(ret, "hardware", hardware); - - struct json_object *network = json_object_new_object(); - json_object_object_add(network, "mac", gluonutil_wrap_and_free_string(gluonutil_get_sysconfig("primary_mac"))); - json_object_object_add(ret, "network", network); - - struct json_object *software = json_object_new_object(); - struct json_object *software_firmware = json_object_new_object(); - json_object_object_add(software_firmware, "base", gluon_version()); - json_object_object_add(software_firmware, "release", gluonutil_wrap_and_free_string(gluonutil_read_line("/lib/gluon/release"))); - json_object_object_add(software, "firmware", software_firmware); - json_object_object_add(ret, "software", software); - - struct json_object *system = json_object_new_object(); - json_object_object_add(system, "site_code", get_site_code()); - if (gluonutil_has_domains()) - json_object_object_add(system, "domain_code", get_domain_code()); - json_object_object_add(ret, "system", system); - - return ret; -} - - -static void add_uptime(struct json_object *obj) { - FILE *f = fopen("/proc/uptime", "r"); - struct json_object* jso; - if (!f) - return; - - double uptime, idletime; - if (fscanf(f, "%lf %lf", &uptime, &idletime) == 2) { - jso = json_object_new_double(uptime); - json_object_set_serializer(jso, json_object_double_to_json_string, "%.2f", NULL); - json_object_object_add(obj, "uptime", jso); - jso = json_object_new_double(idletime); - json_object_set_serializer(jso, json_object_double_to_json_string, "%.2f", NULL); - json_object_object_add(obj, "idletime", jso); - } - - fclose(f); -} - -static void add_loadavg(struct json_object *obj) { - FILE *f = fopen("/proc/loadavg", "r"); - if (!f) - return; - - double loadavg; - unsigned proc_running, proc_total; - if (fscanf(f, "%lf %*f %*f %u/%u", &loadavg, &proc_running, &proc_total) == 3) { - struct json_object *jso = json_object_new_double(loadavg); - json_object_set_serializer(jso, json_object_double_to_json_string, "%.2f", NULL); - json_object_object_add(obj, "loadavg", jso); - - struct json_object *processes = json_object_new_object(); - json_object_object_add(processes, "running", json_object_new_int(proc_running)); - json_object_object_add(processes, "total", json_object_new_int(proc_total)); - json_object_object_add(obj, "processes", processes); - } - - fclose(f); -} - -static struct json_object * get_memory(void) { - FILE *f = fopen("/proc/meminfo", "r"); - if (!f) - return NULL; - - struct json_object *ret = json_object_new_object(); - - char *line = NULL; - size_t len = 0; - - while (getline(&line, &len, f) >= 0) { - char label[32]; - unsigned value; - - if (sscanf(line, "%31[^:]: %u", label, &value) != 2) - continue; - - if (!strcmp(label, "MemTotal")) - json_object_object_add(ret, "total", json_object_new_int(value)); - else if (!strcmp(label, "MemFree")) - json_object_object_add(ret, "free", json_object_new_int(value)); - else if (!strcmp(label, "MemAvailable")) - json_object_object_add(ret, "available", json_object_new_int(value)); - else if (!strcmp(label, "Buffers")) - json_object_object_add(ret, "buffers", json_object_new_int(value)); - else if (!strcmp(label, "Cached")) - json_object_object_add(ret, "cached", json_object_new_int(value)); - } - - free(line); - fclose(f); - - return ret; -} - -static struct json_object * get_stat(void) { - FILE *f = fopen("/proc/stat", "r"); - if (!f) - return NULL; - - struct json_object *stat = json_object_new_object(); - struct json_object *ret = NULL; - - char *line = NULL; - size_t len = 0; - - while (getline(&line, &len, f) >= 0) { - char label[32]; - - if (sscanf(line, "%31s", label) != 1){ - goto invalid_stat_format; - } - - if (!strcmp(label, "cpu")) { - int64_t user, nice, system, idle, iowait, irq, softirq; - if (sscanf(line, "%*s %"SCNd64" %"SCNd64" %"SCNd64" %"SCNd64" %"SCNd64" %"SCNd64" %"SCNd64, - &user, &nice, &system, &idle, &iowait, &irq, &softirq) != 7) - goto invalid_stat_format; - - struct json_object *cpu = json_object_new_object(); - - json_object_object_add(cpu, "user", json_object_new_int64(user)); - json_object_object_add(cpu, "nice", json_object_new_int64(nice)); - json_object_object_add(cpu, "system", json_object_new_int64(system)); - json_object_object_add(cpu, "idle", json_object_new_int64(idle)); - json_object_object_add(cpu, "iowait", json_object_new_int64(iowait)); - json_object_object_add(cpu, "irq", json_object_new_int64(irq)); - json_object_object_add(cpu, "softirq", json_object_new_int64(softirq)); - - json_object_object_add(stat, "cpu", cpu); - } else if (!strcmp(label, "ctxt")) { - int64_t ctxt; - if (sscanf(line, "%*s %"SCNd64, &ctxt) != 1) - goto invalid_stat_format; - - json_object_object_add(stat, "ctxt", json_object_new_int64(ctxt)); - } else if (!strcmp(label, "intr")) { - int64_t total_intr; - if (sscanf(line, "%*s %"SCNd64, &total_intr) != 1) - goto invalid_stat_format; - - json_object_object_add(stat, "intr", json_object_new_int64(total_intr)); - } else if (!strcmp(label, "softirq")) { - int64_t total_softirq; - if (sscanf(line, "%*s %"SCNd64, &total_softirq) != 1) - goto invalid_stat_format; - - json_object_object_add(stat, "softirq", json_object_new_int64(total_softirq)); - } else if (!strcmp(label, "processes")) { - int64_t processes; - if (sscanf(line, "%*s %"SCNd64, &processes) != 1) - goto invalid_stat_format; - - json_object_object_add(stat, "processes", json_object_new_int64(processes)); - } - - } - - ret = stat; - -invalid_stat_format: - if (!ret) - json_object_put(stat); - - free(line); - fclose(f); - - return ret; -} - - -static struct json_object * get_rootfs_usage(void) { - struct statfs s; - if (statfs("/", &s)) - return NULL; - - struct json_object *jso = json_object_new_double(1 - (double)s.f_bfree / s.f_blocks); - json_object_set_serializer(jso, json_object_double_to_json_string, "%.4f", NULL); - return jso; -} - -static struct json_object * get_time(void) { - struct timespec now; - - if (clock_gettime(CLOCK_REALTIME, &now) != 0) - return NULL; - - return json_object_new_int64(now.tv_sec); -} - -static struct json_object * respondd_provider_statistics(void) { - struct json_object *ret = json_object_new_object(); - - json_object_object_add(ret, "node_id", gluonutil_wrap_and_free_string(gluonutil_get_node_id())); - - json_object *time = get_time(); - if (time != NULL) - json_object_object_add(ret, "time", time); - - json_object_object_add(ret, "rootfs_usage", get_rootfs_usage()); - json_object_object_add(ret, "memory", get_memory()); - json_object_object_add(ret, "stat", get_stat()); - - add_uptime(ret); - add_loadavg(ret); - - return ret; -} - - -static struct json_object * respondd_provider_neighbours(void) { - struct json_object *ret = json_object_new_object(); - json_object_object_add(ret, "node_id", gluonutil_wrap_and_free_string(gluonutil_get_node_id())); - return ret; -} - +__attribute__ ((visibility ("default"))) const struct respondd_provider_info respondd_providers[] = { {"nodeinfo", respondd_provider_nodeinfo}, {"statistics", respondd_provider_statistics}, From ecc29e0b09c1e669899c97e211dc63063b064a3e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 23 Nov 2019 22:31:42 +0100 Subject: [PATCH 028/105] gluon-mesh-batman-adv: further cleanup of respondd provider - Split into multiple files - Avoid alloca() --- package/gluon-mesh-batman-adv/src/Makefile | 7 +- .../src/respondd-common.h | 30 + .../src/respondd-neighbours.c | 176 +++++ .../src/respondd-nodeinfo.c | 219 +++++++ .../src/respondd-statistics.c | 322 +++++++++ package/gluon-mesh-batman-adv/src/respondd.c | 615 +----------------- 6 files changed, 755 insertions(+), 614 deletions(-) create mode 100644 package/gluon-mesh-batman-adv/src/respondd-common.h create mode 100644 package/gluon-mesh-batman-adv/src/respondd-neighbours.c create mode 100644 package/gluon-mesh-batman-adv/src/respondd-nodeinfo.c create mode 100644 package/gluon-mesh-batman-adv/src/respondd-statistics.c diff --git a/package/gluon-mesh-batman-adv/src/Makefile b/package/gluon-mesh-batman-adv/src/Makefile index b40c52b1..e72dce56 100644 --- a/package/gluon-mesh-batman-adv/src/Makefile +++ b/package/gluon-mesh-batman-adv/src/Makefile @@ -31,5 +31,8 @@ endif CFLAGS += $(LIBBATADV_CFLAGS) LDLIBS += $(LIBBATADV_LDLIBS) -respondd.so: respondd.c - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -fPIC -D_GNU_SOURCE -o $@ $^ $(LDLIBS) -lgluonutil -luci + +SOURCES = respondd.c respondd-nodeinfo.c respondd-statistics.c respondd-neighbours.c + +respondd.so: $(SOURCES) respondd-common.h + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -fPIC -fvisibility=hidden -D_GNU_SOURCE -o $@ $(SOURCES) $(LDLIBS) -lgluonutil diff --git a/package/gluon-mesh-batman-adv/src/respondd-common.h b/package/gluon-mesh-batman-adv/src/respondd-common.h new file mode 100644 index 00000000..54145ff9 --- /dev/null +++ b/package/gluon-mesh-batman-adv/src/respondd-common.h @@ -0,0 +1,30 @@ +/* + Copyright (c) 2016-2019, Matthias Schiffer + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#pragma once + +struct json_object * respondd_provider_nodeinfo(void); +struct json_object * respondd_provider_statistics(void); +struct json_object * respondd_provider_neighbours(void); diff --git a/package/gluon-mesh-batman-adv/src/respondd-neighbours.c b/package/gluon-mesh-batman-adv/src/respondd-neighbours.c new file mode 100644 index 00000000..bf5b0315 --- /dev/null +++ b/package/gluon-mesh-batman-adv/src/respondd-neighbours.c @@ -0,0 +1,176 @@ +/* + Copyright (c) 2016-2019, Matthias Schiffer + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "respondd-common.h" + +#include +#include + +#include + +#include +#include + +#include +#include +#include + +#include + + +struct neigh_netlink_opts { + struct json_object *interfaces; + struct batadv_nlquery_opts query_opts; +}; + + +static struct json_object * ifnames2addrs(struct json_object *interfaces) { + struct json_object *ret = json_object_new_object(); + + json_object_object_foreach(interfaces, ifname, interface) { + char *ifaddr = gluonutil_get_interface_address(ifname); + if (!ifaddr) + continue; + + struct json_object *obj = json_object_new_object(); + json_object_object_add(obj, "neighbours", json_object_get(interface)); + json_object_object_add(ret, ifaddr, obj); + + free(ifaddr); + } + + json_object_put(interfaces); + + return ret; +} + +static const enum batadv_nl_attrs parse_orig_list_mandatory[] = { + BATADV_ATTR_ORIG_ADDRESS, + BATADV_ATTR_NEIGH_ADDRESS, + BATADV_ATTR_TQ, + BATADV_ATTR_HARD_IFINDEX, + BATADV_ATTR_LAST_SEEN_MSECS, +}; + +static int parse_orig_list_netlink_cb(struct nl_msg *msg, void *arg) +{ + struct nlattr *attrs[BATADV_ATTR_MAX+1]; + struct nlmsghdr *nlh = nlmsg_hdr(msg); + struct batadv_nlquery_opts *query_opts = arg; + struct genlmsghdr *ghdr; + uint8_t *orig; + uint8_t *dest; + uint8_t tq; + uint32_t hardif; + uint32_t lastseen; + char ifname_buf[IF_NAMESIZE], *ifname; + struct neigh_netlink_opts *opts; + char mac1[18]; + + opts = batadv_container_of(query_opts, struct neigh_netlink_opts, + query_opts); + + if (!genlmsg_valid_hdr(nlh, 0)) + return NL_OK; + + ghdr = nlmsg_data(nlh); + + if (ghdr->cmd != BATADV_CMD_GET_ORIGINATORS) + return NL_OK; + + if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0), + genlmsg_len(ghdr), batadv_genl_policy)) + return NL_OK; + + if (batadv_genl_missing_attrs(attrs, parse_orig_list_mandatory, + BATADV_ARRAY_SIZE(parse_orig_list_mandatory))) + return NL_OK; + + orig = nla_data(attrs[BATADV_ATTR_ORIG_ADDRESS]); + dest = nla_data(attrs[BATADV_ATTR_NEIGH_ADDRESS]); + tq = nla_get_u8(attrs[BATADV_ATTR_TQ]); + hardif = nla_get_u32(attrs[BATADV_ATTR_HARD_IFINDEX]); + lastseen = nla_get_u32(attrs[BATADV_ATTR_LAST_SEEN_MSECS]); + + if (memcmp(orig, dest, 6) != 0) + return NL_OK; + + ifname = if_indextoname(hardif, ifname_buf); + if (!ifname) + return NL_OK; + + sprintf(mac1, "%02x:%02x:%02x:%02x:%02x:%02x", + orig[0], orig[1], orig[2], orig[3], orig[4], orig[5]); + + struct json_object *obj = json_object_new_object(); + if (!obj) + return NL_OK; + + struct json_object *interface; + if (!json_object_object_get_ex(opts->interfaces, ifname, &interface)) { + interface = json_object_new_object(); + json_object_object_add(opts->interfaces, ifname, interface); + } + + json_object_object_add(obj, "tq", json_object_new_int(tq)); + json_object_object_add(obj, "lastseen", json_object_new_double(lastseen / 1000.)); + json_object_object_add(obj, "best", json_object_new_boolean(!!attrs[BATADV_ATTR_FLAG_BEST])); + json_object_object_add(interface, mac1, obj); + + return NL_OK; +} + +static struct json_object * get_batadv(void) { + struct neigh_netlink_opts opts = { + .query_opts = { + .err = 0, + }, + }; + int ret; + + opts.interfaces = json_object_new_object(); + if (!opts.interfaces) + return NULL; + + ret = batadv_genl_query("bat0", BATADV_CMD_GET_ORIGINATORS, + parse_orig_list_netlink_cb, NLM_F_DUMP, + &opts.query_opts); + if (ret < 0) { + json_object_put(opts.interfaces); + return NULL; + } + + return ifnames2addrs(opts.interfaces); +} + +struct json_object * respondd_provider_neighbours(void) { + struct json_object *ret = json_object_new_object(); + + struct json_object *batadv = get_batadv(); + if (batadv) + json_object_object_add(ret, "batadv", batadv); + + return ret; +} diff --git a/package/gluon-mesh-batman-adv/src/respondd-nodeinfo.c b/package/gluon-mesh-batman-adv/src/respondd-nodeinfo.c new file mode 100644 index 00000000..36e330f9 --- /dev/null +++ b/package/gluon-mesh-batman-adv/src/respondd-nodeinfo.c @@ -0,0 +1,219 @@ +/* + Copyright (c) 2016-2019, Matthias Schiffer + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "respondd-common.h" + +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + + +struct ip_address_information { + unsigned int ifindex; + struct json_object *addresses; +}; + +static int get_addresses_cb(struct nl_msg *msg, void *arg) { + struct ip_address_information *info = (struct ip_address_information*) arg; + + struct nlmsghdr *nlh = nlmsg_hdr(msg); + struct ifaddrmsg *msg_content = NLMSG_DATA(nlh); + int remaining = nlh->nlmsg_len - NLMSG_LENGTH(sizeof(struct ifaddrmsg)); + struct rtattr *hdr; + + for (hdr = IFA_RTA(msg_content); RTA_OK(hdr, remaining); hdr = RTA_NEXT(hdr, remaining)) { + char addr_str_buf[INET6_ADDRSTRLEN]; + + /* We are only interested in IP-addresses of br-client */ + if (hdr->rta_type != IFA_ADDRESS || + msg_content->ifa_index != info->ifindex || + msg_content->ifa_flags & (IFA_F_TENTATIVE|IFA_F_DEPRECATED)) { + continue; + } + + if (inet_ntop(AF_INET6, (struct in6_addr *) RTA_DATA(hdr), addr_str_buf, INET6_ADDRSTRLEN)) { + json_object_array_add(info->addresses, json_object_new_string(addr_str_buf)); + } + } + + return NL_OK; +} + +static struct json_object *get_addresses(void) { + struct ip_address_information info = { + .ifindex = if_nametoindex("br-client"), + .addresses = json_object_new_array(), + }; + int err; + + /* Open socket */ + struct nl_sock *socket = nl_socket_alloc(); + if (!socket) { + return info.addresses; + } + + err = nl_connect(socket, NETLINK_ROUTE); + if (err < 0) { + goto out_free; + } + + /* Send message */ + struct ifaddrmsg rt_hdr = { .ifa_family = AF_INET6, }; + err = nl_send_simple(socket, RTM_GETADDR, NLM_F_REQUEST | NLM_F_ROOT, &rt_hdr, sizeof(struct ifaddrmsg)); + if (err < 0) { + goto out_free; + } + + /* Retrieve answer. Message is handled by get_addresses_cb */ + nl_socket_modify_cb(socket, NL_CB_VALID, NL_CB_CUSTOM, get_addresses_cb, &info); + nl_recvmsgs_default(socket); + +out_free: + nl_socket_free(socket); + return info.addresses; +} + +static void add_if_not_empty(struct json_object *obj, const char *key, struct json_object *val) { + if (json_object_array_length(val)) + json_object_object_add(obj, key, val); + else + json_object_put(val); +} + +static bool interface_file_exists(const char *ifname, const char *name) { + const char *format = "/sys/class/net/%s/%s"; + char path[strlen(format) + strlen(ifname) + strlen(name)]; + snprintf(path, sizeof(path), format, ifname, name); + + return !access(path, F_OK); +} + +static void mesh_add_subif(const char *ifname, struct json_object *wireless, + struct json_object *tunnel, struct json_object *other) { + struct json_object *address = gluonutil_wrap_and_free_string(gluonutil_get_interface_address(ifname)); + + char lowername[IFNAMSIZ]; + strncpy(lowername, ifname, sizeof(lowername)-1); + lowername[sizeof(lowername)-1] = 0; + + const char *format = "/sys/class/net/%s/lower_*"; + char pattern[strlen(format) + IFNAMSIZ]; + + /* In case of VLAN and bridge interfaces, we want the lower interface + * to determine the interface type (but not for the interface address) */ + while (true) { + snprintf(pattern, sizeof(pattern), format, lowername); + size_t pattern_len = strlen(pattern); + + glob_t lower; + if (glob(pattern, GLOB_NOSORT, NULL, &lower)) + break; + + strncpy(lowername, lower.gl_pathv[0] + pattern_len - 1, sizeof(lowername)-1); + + globfree(&lower); + } + + if (interface_file_exists(lowername, "wireless")) + json_object_array_add(wireless, address); + else if (interface_file_exists(lowername, "tun_flags")) + json_object_array_add(tunnel, address); + else + json_object_array_add(other, address); + +} + +static struct json_object * get_mesh_subifs(const char *ifname) { + struct json_object *wireless = json_object_new_array(); + struct json_object *tunnel = json_object_new_array(); + struct json_object *other = json_object_new_array(); + + const char *format = "/sys/class/net/%s/lower_*"; + char pattern[strlen(format) + strlen(ifname) - 1]; + snprintf(pattern, sizeof(pattern), format, ifname); + + size_t pattern_len = strlen(pattern); + + glob_t lower; + if (!glob(pattern, GLOB_NOSORT, NULL, &lower)) { + size_t i; + for (i = 0; i < lower.gl_pathc; i++) { + mesh_add_subif(lower.gl_pathv[i] + pattern_len - 1, + wireless, tunnel, other); + } + + globfree(&lower); + } + + struct json_object *ret = json_object_new_object(); + add_if_not_empty(ret, "wireless", wireless); + add_if_not_empty(ret, "tunnel", tunnel); + add_if_not_empty(ret, "other", other); + return ret; +} + +static struct json_object * get_mesh(void) { + struct json_object *ret = json_object_new_object(); + struct json_object *bat0_interfaces = json_object_new_object(); + json_object_object_add(bat0_interfaces, "interfaces", get_mesh_subifs("bat0")); + json_object_object_add(ret, "bat0", bat0_interfaces); + return ret; +} + +struct json_object * respondd_provider_nodeinfo(void) { + struct json_object *ret = json_object_new_object(); + + struct json_object *network = json_object_new_object(); + json_object_object_add(network, "addresses", get_addresses()); + json_object_object_add(network, "mesh", get_mesh()); + json_object_object_add(ret, "network", network); + + struct json_object *software = json_object_new_object(); + struct json_object *software_batman_adv = json_object_new_object(); + json_object_object_add(software_batman_adv, "version", + gluonutil_wrap_and_free_string(gluonutil_read_line("/sys/module/batman_adv/version"))); + json_object_object_add(software_batman_adv, "compat", json_object_new_int(15)); + json_object_object_add(software, "batman-adv", software_batman_adv); + json_object_object_add(ret, "software", software); + + return ret; +} diff --git a/package/gluon-mesh-batman-adv/src/respondd-statistics.c b/package/gluon-mesh-batman-adv/src/respondd-statistics.c new file mode 100644 index 00000000..c9394d87 --- /dev/null +++ b/package/gluon-mesh-batman-adv/src/respondd-statistics.c @@ -0,0 +1,322 @@ +/* + Copyright (c) 2016-2019, Matthias Schiffer + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "respondd-common.h" + +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + + +#define MAX_INACTIVITY 60000 + + +struct clients_netlink_opts { + size_t clients; + struct batadv_nlquery_opts query_opts; +}; + +struct gw_netlink_opts { + struct json_object *obj; + struct batadv_nlquery_opts query_opts; +}; + + +static const enum batadv_nl_attrs gateways_mandatory[] = { + BATADV_ATTR_ORIG_ADDRESS, + BATADV_ATTR_ROUTER, +}; + +static int parse_gw_list_netlink_cb(struct nl_msg *msg, void *arg) +{ + struct nlattr *attrs[BATADV_ATTR_MAX+1]; + struct nlmsghdr *nlh = nlmsg_hdr(msg); + struct batadv_nlquery_opts *query_opts = arg; + struct genlmsghdr *ghdr; + uint8_t *orig; + uint8_t *router; + struct gw_netlink_opts *opts; + char addr[18]; + + opts = batadv_container_of(query_opts, struct gw_netlink_opts, + query_opts); + + if (!genlmsg_valid_hdr(nlh, 0)) + return NL_OK; + + ghdr = nlmsg_data(nlh); + + if (ghdr->cmd != BATADV_CMD_GET_GATEWAYS) + return NL_OK; + + if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0), + genlmsg_len(ghdr), batadv_genl_policy)) + return NL_OK; + + if (batadv_genl_missing_attrs(attrs, gateways_mandatory, + BATADV_ARRAY_SIZE(gateways_mandatory))) + return NL_OK; + + if (!attrs[BATADV_ATTR_FLAG_BEST]) + return NL_OK; + + orig = nla_data(attrs[BATADV_ATTR_ORIG_ADDRESS]); + router = nla_data(attrs[BATADV_ATTR_ROUTER]); + + sprintf(addr, "%02x:%02x:%02x:%02x:%02x:%02x", + orig[0], orig[1], orig[2], orig[3], orig[4], orig[5]); + + json_object_object_add(opts->obj, "gateway", json_object_new_string(addr)); + + sprintf(addr, "%02x:%02x:%02x:%02x:%02x:%02x", + router[0], router[1], router[2], router[3], router[4], router[5]); + + json_object_object_add(opts->obj, "gateway_nexthop", json_object_new_string(addr)); + + return NL_STOP; +} + +static void add_gateway(struct json_object *obj) { + struct gw_netlink_opts opts = { + .obj = obj, + .query_opts = { + .err = 0, + }, + }; + + batadv_genl_query("bat0", BATADV_CMD_GET_GATEWAYS, + parse_gw_list_netlink_cb, NLM_F_DUMP, + &opts.query_opts); +} + +static inline bool ethtool_ioctl(int fd, struct ifreq *ifr, void *data) { + ifr->ifr_data = data; + + return (ioctl(fd, SIOCETHTOOL, ifr) >= 0); +} + +static uint32_t ethtool_get_stats_length(int fd, struct ifreq *ifr) { + struct { + struct ethtool_sset_info info; + uint32_t buf; + } sset = {}; + + sset.info.cmd = ETHTOOL_GSSET_INFO; + sset.info.sset_mask = (uint64_t)1 << ETH_SS_STATS; + + if (!ethtool_ioctl(fd, ifr, &sset.info)) + return 0; + + return sset.info.sset_mask ? sset.info.data[0] : 0; +} + +static struct ethtool_gstrings * ethtool_get_stats_strings(int fd, struct ifreq *ifr) { + uint32_t n_stats = ethtool_get_stats_length(fd, ifr); + + if (!n_stats) + return NULL; + + struct ethtool_gstrings *strings = calloc(1, sizeof(*strings) + n_stats * ETH_GSTRING_LEN); + + strings->cmd = ETHTOOL_GSTRINGS; + strings->string_set = ETH_SS_STATS; + strings->len = n_stats; + + if (!ethtool_ioctl(fd, ifr, strings)) { + free(strings); + return NULL; + } + + return strings; +} + + +static struct json_object * get_traffic(void) { + struct ethtool_gstrings *strings = NULL; + struct ethtool_stats *stats = NULL; + + struct ifreq ifr = {}; + strncpy(ifr.ifr_name, "bat0", IF_NAMESIZE); + + struct json_object *ret = NULL; + + int fd = socket(AF_INET, SOCK_DGRAM, 0); + if (fd < 0) + return NULL; + + strings = ethtool_get_stats_strings(fd, &ifr); + if (!strings) + goto out; + + stats = calloc(1, sizeof(struct ethtool_stats) + strings->len * sizeof(uint64_t)); + stats->cmd = ETHTOOL_GSTATS; + stats->n_stats = strings->len; + + if (!ethtool_ioctl(fd, &ifr, stats)) + goto out; + + struct json_object *rx = json_object_new_object(); + struct json_object *tx = json_object_new_object(); + struct json_object *forward = json_object_new_object(); + struct json_object *mgmt_rx = json_object_new_object(); + struct json_object *mgmt_tx = json_object_new_object(); + + size_t i; + for (i = 0; i < strings->len; i++) { + if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "rx", ETH_GSTRING_LEN)) + json_object_object_add(rx, "packets", json_object_new_int64(stats->data[i])); + else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "rx_bytes", ETH_GSTRING_LEN)) + json_object_object_add(rx, "bytes", json_object_new_int64(stats->data[i])); + else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "tx", ETH_GSTRING_LEN)) + json_object_object_add(tx, "packets", json_object_new_int64(stats->data[i])); + else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "tx_dropped", ETH_GSTRING_LEN)) + json_object_object_add(tx, "dropped", json_object_new_int64(stats->data[i])); + else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "tx_bytes", ETH_GSTRING_LEN)) + json_object_object_add(tx, "bytes", json_object_new_int64(stats->data[i])); + else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "forward", ETH_GSTRING_LEN)) + json_object_object_add(forward, "packets", json_object_new_int64(stats->data[i])); + else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "forward_bytes", ETH_GSTRING_LEN)) + json_object_object_add(forward, "bytes", json_object_new_int64(stats->data[i])); + else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "mgmt_rx", ETH_GSTRING_LEN)) + json_object_object_add(mgmt_rx, "packets", json_object_new_int64(stats->data[i])); + else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "mgmt_rx_bytes", ETH_GSTRING_LEN)) + json_object_object_add(mgmt_rx, "bytes", json_object_new_int64(stats->data[i])); + else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "mgmt_tx", ETH_GSTRING_LEN)) + json_object_object_add(mgmt_tx, "packets", json_object_new_int64(stats->data[i])); + else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "mgmt_tx_bytes", ETH_GSTRING_LEN)) + json_object_object_add(mgmt_tx, "bytes", json_object_new_int64(stats->data[i])); + } + + ret = json_object_new_object(); + json_object_object_add(ret, "rx", rx); + json_object_object_add(ret, "tx", tx); + json_object_object_add(ret, "forward", forward); + json_object_object_add(ret, "mgmt_rx", mgmt_rx); + json_object_object_add(ret, "mgmt_tx", mgmt_tx); + + out: + free(stats); + free(strings); + close(fd); + return ret; +} + +static const enum batadv_nl_attrs clients_mandatory[] = { + BATADV_ATTR_TT_FLAGS, + /* Entries without the BATADV_TT_CLIENT_NOPURGE flag do not have a + * BATADV_ATTR_LAST_SEEN_MSECS attribute. We can still make this attr + * mandatory here, as entries without BATADV_TT_CLIENT_NOPURGE are + * ignored anyways. + */ + BATADV_ATTR_LAST_SEEN_MSECS, +}; + +static int parse_clients_list_netlink_cb(struct nl_msg *msg, void *arg) +{ + struct nlattr *attrs[BATADV_ATTR_MAX+1]; + struct nlmsghdr *nlh = nlmsg_hdr(msg); + struct batadv_nlquery_opts *query_opts = arg; + struct genlmsghdr *ghdr; + struct clients_netlink_opts *opts; + uint32_t flags, lastseen; + + opts = batadv_container_of(query_opts, struct clients_netlink_opts, + query_opts); + + if (!genlmsg_valid_hdr(nlh, 0)) + return NL_OK; + + ghdr = nlmsg_data(nlh); + + if (ghdr->cmd != BATADV_CMD_GET_TRANSTABLE_LOCAL) + return NL_OK; + + if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0), + genlmsg_len(ghdr), batadv_genl_policy)) + return NL_OK; + + if (batadv_genl_missing_attrs(attrs, clients_mandatory, + BATADV_ARRAY_SIZE(clients_mandatory))) + return NL_OK; + + flags = nla_get_u32(attrs[BATADV_ATTR_TT_FLAGS]); + + if (flags & (BATADV_TT_CLIENT_NOPURGE)) + return NL_OK; + + lastseen = nla_get_u32(attrs[BATADV_ATTR_LAST_SEEN_MSECS]); + if (lastseen > MAX_INACTIVITY) + return NL_OK; + + opts->clients++; + + return NL_OK; +} + +static struct json_object * get_clients(void) { + struct clients_netlink_opts opts = { + .clients = 0, + .query_opts = { + .err = 0, + }, + }; + + batadv_genl_query("bat0", BATADV_CMD_GET_TRANSTABLE_LOCAL, + parse_clients_list_netlink_cb, NLM_F_DUMP, + &opts.query_opts); + + struct json_object *ret = json_object_new_object(); + + json_object_object_add(ret, "total", json_object_new_int(opts.clients)); + + return ret; +} + +struct json_object * respondd_provider_statistics(void) { + struct json_object *ret = json_object_new_object(); + + json_object_object_add(ret, "clients", get_clients()); + json_object_object_add(ret, "traffic", get_traffic()); + + add_gateway(ret); + + return ret; +} diff --git a/package/gluon-mesh-batman-adv/src/respondd.c b/package/gluon-mesh-batman-adv/src/respondd.c index 1df8d43f..36188e46 100644 --- a/package/gluon-mesh-batman-adv/src/respondd.c +++ b/package/gluon-mesh-batman-adv/src/respondd.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2016, Matthias Schiffer + Copyright (c) 2016-2019, Matthias Schiffer All rights reserved. Redistribution and use in source and binary forms, with or without @@ -23,621 +23,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "respondd-common.h" #include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include -#include -#include - -#include -#include -#include -#include - -#include - - -#define MAX_INACTIVITY 60000 - - -struct neigh_netlink_opts { - struct json_object *interfaces; - struct batadv_nlquery_opts query_opts; -}; - -struct gw_netlink_opts { - struct json_object *obj; - struct batadv_nlquery_opts query_opts; -}; - -struct clients_netlink_opts { - size_t clients; - struct batadv_nlquery_opts query_opts; -}; - -struct ip_address_information { - unsigned int ifindex; - struct json_object *addresses; -}; - -static int get_addresses_cb(struct nl_msg *msg, void *arg) { - struct ip_address_information *info = (struct ip_address_information*) arg; - - struct nlmsghdr *nlh = nlmsg_hdr(msg); - struct ifaddrmsg *msg_content = NLMSG_DATA(nlh); - int remaining = nlh->nlmsg_len - NLMSG_LENGTH(sizeof(struct ifaddrmsg)); - struct rtattr *hdr; - - for (hdr = IFA_RTA(msg_content); RTA_OK(hdr, remaining); hdr = RTA_NEXT(hdr, remaining)) { - char addr_str_buf[INET6_ADDRSTRLEN]; - - /* We are only interested in IP-addresses of br-client */ - if (hdr->rta_type != IFA_ADDRESS || - msg_content->ifa_index != info->ifindex || - msg_content->ifa_flags & (IFA_F_TENTATIVE|IFA_F_DEPRECATED)) { - continue; - } - - if (inet_ntop(AF_INET6, (struct in6_addr *) RTA_DATA(hdr), addr_str_buf, INET6_ADDRSTRLEN)) { - json_object_array_add(info->addresses, json_object_new_string(addr_str_buf)); - } - } - - return NL_OK; -} - -static struct json_object *get_addresses(void) { - struct ip_address_information info = { - .ifindex = if_nametoindex("br-client"), - .addresses = json_object_new_array(), - }; - int err; - - /* Open socket */ - struct nl_sock *socket = nl_socket_alloc(); - if (!socket) { - return info.addresses; - } - - err = nl_connect(socket, NETLINK_ROUTE); - if (err < 0) { - goto out_free; - } - - /* Send message */ - struct ifaddrmsg rt_hdr = { .ifa_family = AF_INET6, }; - err = nl_send_simple(socket, RTM_GETADDR, NLM_F_REQUEST | NLM_F_ROOT, &rt_hdr, sizeof(struct ifaddrmsg)); - if (err < 0) { - goto out_free; - } - - /* Retrieve answer. Message is handled by get_addresses_cb */ - nl_socket_modify_cb(socket, NL_CB_VALID, NL_CB_CUSTOM, get_addresses_cb, &info); - nl_recvmsgs_default(socket); - -out_free: - nl_socket_free(socket); - return info.addresses; -} - -static void add_if_not_empty(struct json_object *obj, const char *key, struct json_object *val) { - if (json_object_array_length(val)) - json_object_object_add(obj, key, val); - else - json_object_put(val); -} - -static bool interface_file_exists(const char *ifname, const char *name) { - const char *format = "/sys/class/net/%s/%s"; - char path[strlen(format) + strlen(ifname) + strlen(name)]; - snprintf(path, sizeof(path), format, ifname, name); - - return !access(path, F_OK); -} - -static void mesh_add_subif(const char *ifname, struct json_object *wireless, - struct json_object *tunnel, struct json_object *other) { - struct json_object *address = gluonutil_wrap_and_free_string(gluonutil_get_interface_address(ifname)); - - char lowername[IFNAMSIZ]; - strncpy(lowername, ifname, sizeof(lowername)-1); - lowername[sizeof(lowername)-1] = 0; - - const char *format = "/sys/class/net/%s/lower_*"; - char pattern[strlen(format) + IFNAMSIZ]; - - /* In case of VLAN and bridge interfaces, we want the lower interface - * to determine the interface type (but not for the interface address) */ - while (true) { - snprintf(pattern, sizeof(pattern), format, lowername); - size_t pattern_len = strlen(pattern); - - glob_t lower; - if (glob(pattern, GLOB_NOSORT, NULL, &lower)) - break; - - strncpy(lowername, lower.gl_pathv[0] + pattern_len - 1, sizeof(lowername)-1); - - globfree(&lower); - } - - if (interface_file_exists(lowername, "wireless")) - json_object_array_add(wireless, address); - else if (interface_file_exists(lowername, "tun_flags")) - json_object_array_add(tunnel, address); - else - json_object_array_add(other, address); - -} - -static struct json_object * get_mesh_subifs(const char *ifname) { - struct json_object *wireless = json_object_new_array(); - struct json_object *tunnel = json_object_new_array(); - struct json_object *other = json_object_new_array(); - - const char *format = "/sys/class/net/%s/lower_*"; - char pattern[strlen(format) + strlen(ifname) - 1]; - snprintf(pattern, sizeof(pattern), format, ifname); - - size_t pattern_len = strlen(pattern); - - glob_t lower; - if (!glob(pattern, GLOB_NOSORT, NULL, &lower)) { - size_t i; - for (i = 0; i < lower.gl_pathc; i++) { - mesh_add_subif(lower.gl_pathv[i] + pattern_len - 1, - wireless, tunnel, other); - } - - globfree(&lower); - } - - struct json_object *ret = json_object_new_object(); - add_if_not_empty(ret, "wireless", wireless); - add_if_not_empty(ret, "tunnel", tunnel); - add_if_not_empty(ret, "other", other); - return ret; -} - -static struct json_object * get_mesh(void) { - struct json_object *ret = json_object_new_object(); - struct json_object *bat0_interfaces = json_object_new_object(); - json_object_object_add(bat0_interfaces, "interfaces", get_mesh_subifs("bat0")); - json_object_object_add(ret, "bat0", bat0_interfaces); - return ret; -} - -static struct json_object * respondd_provider_nodeinfo(void) { - struct json_object *ret = json_object_new_object(); - - struct json_object *network = json_object_new_object(); - json_object_object_add(network, "addresses", get_addresses()); - json_object_object_add(network, "mesh", get_mesh()); - json_object_object_add(ret, "network", network); - - struct json_object *software = json_object_new_object(); - struct json_object *software_batman_adv = json_object_new_object(); - json_object_object_add(software_batman_adv, "version", - gluonutil_wrap_and_free_string(gluonutil_read_line("/sys/module/batman_adv/version"))); - json_object_object_add(software_batman_adv, "compat", json_object_new_int(15)); - json_object_object_add(software, "batman-adv", software_batman_adv); - json_object_object_add(ret, "software", software); - - return ret; -} - -static const enum batadv_nl_attrs gateways_mandatory[] = { - BATADV_ATTR_ORIG_ADDRESS, - BATADV_ATTR_ROUTER, -}; - -static int parse_gw_list_netlink_cb(struct nl_msg *msg, void *arg) -{ - struct nlattr *attrs[BATADV_ATTR_MAX+1]; - struct nlmsghdr *nlh = nlmsg_hdr(msg); - struct batadv_nlquery_opts *query_opts = arg; - struct genlmsghdr *ghdr; - uint8_t *orig; - uint8_t *router; - struct gw_netlink_opts *opts; - char addr[18]; - - opts = batadv_container_of(query_opts, struct gw_netlink_opts, - query_opts); - - if (!genlmsg_valid_hdr(nlh, 0)) - return NL_OK; - - ghdr = nlmsg_data(nlh); - - if (ghdr->cmd != BATADV_CMD_GET_GATEWAYS) - return NL_OK; - - if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0), - genlmsg_len(ghdr), batadv_genl_policy)) - return NL_OK; - - if (batadv_genl_missing_attrs(attrs, gateways_mandatory, - BATADV_ARRAY_SIZE(gateways_mandatory))) - return NL_OK; - - if (!attrs[BATADV_ATTR_FLAG_BEST]) - return NL_OK; - - orig = nla_data(attrs[BATADV_ATTR_ORIG_ADDRESS]); - router = nla_data(attrs[BATADV_ATTR_ROUTER]); - - sprintf(addr, "%02x:%02x:%02x:%02x:%02x:%02x", - orig[0], orig[1], orig[2], orig[3], orig[4], orig[5]); - - json_object_object_add(opts->obj, "gateway", json_object_new_string(addr)); - - sprintf(addr, "%02x:%02x:%02x:%02x:%02x:%02x", - router[0], router[1], router[2], router[3], router[4], router[5]); - - json_object_object_add(opts->obj, "gateway_nexthop", json_object_new_string(addr)); - - return NL_STOP; -} - -static void add_gateway(struct json_object *obj) { - struct gw_netlink_opts opts = { - .obj = obj, - .query_opts = { - .err = 0, - }, - }; - - batadv_genl_query("bat0", BATADV_CMD_GET_GATEWAYS, - parse_gw_list_netlink_cb, NLM_F_DUMP, - &opts.query_opts); -} - -static inline bool ethtool_ioctl(int fd, struct ifreq *ifr, void *data) { - ifr->ifr_data = data; - - return (ioctl(fd, SIOCETHTOOL, ifr) >= 0); -} - -static uint32_t ethtool_get_stats_length(int fd, struct ifreq *ifr) { - const size_t sset_info_len = sizeof(struct ethtool_sset_info) + sizeof(uint32_t); - struct ethtool_sset_info *sset_info = alloca(sset_info_len); - memset(sset_info, 0, sset_info_len); - - sset_info->cmd = ETHTOOL_GSSET_INFO; - sset_info->sset_mask = 1ull << ETH_SS_STATS; - - if (!ethtool_ioctl(fd, ifr, sset_info)) - return 0; - - return sset_info->sset_mask ? sset_info->data[0] : 0; -} - -static struct ethtool_gstrings * ethtool_get_stats_strings(int fd, struct ifreq *ifr) { - uint32_t n_stats = ethtool_get_stats_length(fd, ifr); - - if (!n_stats) - return NULL; - - struct ethtool_gstrings *strings = calloc(1, sizeof(*strings) + n_stats * ETH_GSTRING_LEN); - - strings->cmd = ETHTOOL_GSTRINGS; - strings->string_set = ETH_SS_STATS; - strings->len = n_stats; - - if (!ethtool_ioctl(fd, ifr, strings)) { - free(strings); - return NULL; - } - - return strings; -} - - -static struct json_object * get_traffic(void) { - struct ethtool_gstrings *strings = NULL; - struct ethtool_stats *stats = NULL; - - struct ifreq ifr = {}; - strncpy(ifr.ifr_name, "bat0", IF_NAMESIZE); - - struct json_object *ret = NULL; - - int fd = socket(AF_INET, SOCK_DGRAM, 0); - if (fd < 0) - return NULL; - - strings = ethtool_get_stats_strings(fd, &ifr); - if (!strings) - goto out; - - stats = calloc(1, sizeof(struct ethtool_stats) + strings->len * sizeof(uint64_t)); - stats->cmd = ETHTOOL_GSTATS; - stats->n_stats = strings->len; - - if (!ethtool_ioctl(fd, &ifr, stats)) - goto out; - - struct json_object *rx = json_object_new_object(); - struct json_object *tx = json_object_new_object(); - struct json_object *forward = json_object_new_object(); - struct json_object *mgmt_rx = json_object_new_object(); - struct json_object *mgmt_tx = json_object_new_object(); - - size_t i; - for (i = 0; i < strings->len; i++) { - if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "rx", ETH_GSTRING_LEN)) - json_object_object_add(rx, "packets", json_object_new_int64(stats->data[i])); - else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "rx_bytes", ETH_GSTRING_LEN)) - json_object_object_add(rx, "bytes", json_object_new_int64(stats->data[i])); - else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "tx", ETH_GSTRING_LEN)) - json_object_object_add(tx, "packets", json_object_new_int64(stats->data[i])); - else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "tx_dropped", ETH_GSTRING_LEN)) - json_object_object_add(tx, "dropped", json_object_new_int64(stats->data[i])); - else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "tx_bytes", ETH_GSTRING_LEN)) - json_object_object_add(tx, "bytes", json_object_new_int64(stats->data[i])); - else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "forward", ETH_GSTRING_LEN)) - json_object_object_add(forward, "packets", json_object_new_int64(stats->data[i])); - else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "forward_bytes", ETH_GSTRING_LEN)) - json_object_object_add(forward, "bytes", json_object_new_int64(stats->data[i])); - else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "mgmt_rx", ETH_GSTRING_LEN)) - json_object_object_add(mgmt_rx, "packets", json_object_new_int64(stats->data[i])); - else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "mgmt_rx_bytes", ETH_GSTRING_LEN)) - json_object_object_add(mgmt_rx, "bytes", json_object_new_int64(stats->data[i])); - else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "mgmt_tx", ETH_GSTRING_LEN)) - json_object_object_add(mgmt_tx, "packets", json_object_new_int64(stats->data[i])); - else if (!strncmp((const char*)&strings->data[i * ETH_GSTRING_LEN], "mgmt_tx_bytes", ETH_GSTRING_LEN)) - json_object_object_add(mgmt_tx, "bytes", json_object_new_int64(stats->data[i])); - } - - ret = json_object_new_object(); - json_object_object_add(ret, "rx", rx); - json_object_object_add(ret, "tx", tx); - json_object_object_add(ret, "forward", forward); - json_object_object_add(ret, "mgmt_rx", mgmt_rx); - json_object_object_add(ret, "mgmt_tx", mgmt_tx); - - out: - free(stats); - free(strings); - close(fd); - return ret; -} - -static const enum batadv_nl_attrs clients_mandatory[] = { - BATADV_ATTR_TT_FLAGS, - /* Entries without the BATADV_TT_CLIENT_NOPURGE flag do not have a - * BATADV_ATTR_LAST_SEEN_MSECS attribute. We can still make this attr - * mandatory here, as entries without BATADV_TT_CLIENT_NOPURGE are - * ignored anyways. - */ - BATADV_ATTR_LAST_SEEN_MSECS, -}; - -static int parse_clients_list_netlink_cb(struct nl_msg *msg, void *arg) -{ - struct nlattr *attrs[BATADV_ATTR_MAX+1]; - struct nlmsghdr *nlh = nlmsg_hdr(msg); - struct batadv_nlquery_opts *query_opts = arg; - struct genlmsghdr *ghdr; - struct clients_netlink_opts *opts; - uint32_t flags, lastseen; - - opts = batadv_container_of(query_opts, struct clients_netlink_opts, - query_opts); - - if (!genlmsg_valid_hdr(nlh, 0)) - return NL_OK; - - ghdr = nlmsg_data(nlh); - - if (ghdr->cmd != BATADV_CMD_GET_TRANSTABLE_LOCAL) - return NL_OK; - - if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0), - genlmsg_len(ghdr), batadv_genl_policy)) - return NL_OK; - - if (batadv_genl_missing_attrs(attrs, clients_mandatory, - BATADV_ARRAY_SIZE(clients_mandatory))) - return NL_OK; - - flags = nla_get_u32(attrs[BATADV_ATTR_TT_FLAGS]); - - if (flags & (BATADV_TT_CLIENT_NOPURGE)) - return NL_OK; - - lastseen = nla_get_u32(attrs[BATADV_ATTR_LAST_SEEN_MSECS]); - if (lastseen > MAX_INACTIVITY) - return NL_OK; - - opts->clients++; - - return NL_OK; -} - -static struct json_object * get_clients(void) { - struct clients_netlink_opts opts = { - .clients = 0, - .query_opts = { - .err = 0, - }, - }; - - batadv_genl_query("bat0", BATADV_CMD_GET_TRANSTABLE_LOCAL, - parse_clients_list_netlink_cb, NLM_F_DUMP, - &opts.query_opts); - - struct json_object *ret = json_object_new_object(); - - json_object_object_add(ret, "total", json_object_new_int(opts.clients)); - - return ret; -} - - -static struct json_object * respondd_provider_statistics(void) { - struct json_object *ret = json_object_new_object(); - - json_object_object_add(ret, "clients", get_clients()); - json_object_object_add(ret, "traffic", get_traffic()); - - add_gateway(ret); - - return ret; -} - - -static struct json_object * ifnames2addrs(struct json_object *interfaces) { - struct json_object *ret = json_object_new_object(); - - json_object_object_foreach(interfaces, ifname, interface) { - char *ifaddr = gluonutil_get_interface_address(ifname); - if (!ifaddr) - continue; - - struct json_object *obj = json_object_new_object(); - json_object_object_add(obj, "neighbours", json_object_get(interface)); - json_object_object_add(ret, ifaddr, obj); - - free(ifaddr); - } - - json_object_put(interfaces); - - return ret; -} - -static const enum batadv_nl_attrs parse_orig_list_mandatory[] = { - BATADV_ATTR_ORIG_ADDRESS, - BATADV_ATTR_NEIGH_ADDRESS, - BATADV_ATTR_TQ, - BATADV_ATTR_HARD_IFINDEX, - BATADV_ATTR_LAST_SEEN_MSECS, -}; - -static int parse_orig_list_netlink_cb(struct nl_msg *msg, void *arg) -{ - struct nlattr *attrs[BATADV_ATTR_MAX+1]; - struct nlmsghdr *nlh = nlmsg_hdr(msg); - struct batadv_nlquery_opts *query_opts = arg; - struct genlmsghdr *ghdr; - uint8_t *orig; - uint8_t *dest; - uint8_t tq; - uint32_t hardif; - uint32_t lastseen; - char ifname_buf[IF_NAMESIZE], *ifname; - struct neigh_netlink_opts *opts; - char mac1[18]; - - opts = batadv_container_of(query_opts, struct neigh_netlink_opts, - query_opts); - - if (!genlmsg_valid_hdr(nlh, 0)) - return NL_OK; - - ghdr = nlmsg_data(nlh); - - if (ghdr->cmd != BATADV_CMD_GET_ORIGINATORS) - return NL_OK; - - if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0), - genlmsg_len(ghdr), batadv_genl_policy)) - return NL_OK; - - if (batadv_genl_missing_attrs(attrs, parse_orig_list_mandatory, - BATADV_ARRAY_SIZE(parse_orig_list_mandatory))) - return NL_OK; - - orig = nla_data(attrs[BATADV_ATTR_ORIG_ADDRESS]); - dest = nla_data(attrs[BATADV_ATTR_NEIGH_ADDRESS]); - tq = nla_get_u8(attrs[BATADV_ATTR_TQ]); - hardif = nla_get_u32(attrs[BATADV_ATTR_HARD_IFINDEX]); - lastseen = nla_get_u32(attrs[BATADV_ATTR_LAST_SEEN_MSECS]); - - if (memcmp(orig, dest, 6) != 0) - return NL_OK; - - ifname = if_indextoname(hardif, ifname_buf); - if (!ifname) - return NL_OK; - - sprintf(mac1, "%02x:%02x:%02x:%02x:%02x:%02x", - orig[0], orig[1], orig[2], orig[3], orig[4], orig[5]); - - struct json_object *obj = json_object_new_object(); - if (!obj) - return NL_OK; - - struct json_object *interface; - if (!json_object_object_get_ex(opts->interfaces, ifname, &interface)) { - interface = json_object_new_object(); - json_object_object_add(opts->interfaces, ifname, interface); - } - - json_object_object_add(obj, "tq", json_object_new_int(tq)); - json_object_object_add(obj, "lastseen", json_object_new_double(lastseen / 1000.)); - json_object_object_add(obj, "best", json_object_new_boolean(!!attrs[BATADV_ATTR_FLAG_BEST])); - json_object_object_add(interface, mac1, obj); - - return NL_OK; -} - -static struct json_object * get_batadv(void) { - struct neigh_netlink_opts opts = { - .query_opts = { - .err = 0, - }, - }; - int ret; - - opts.interfaces = json_object_new_object(); - if (!opts.interfaces) - return NULL; - - ret = batadv_genl_query("bat0", BATADV_CMD_GET_ORIGINATORS, - parse_orig_list_netlink_cb, NLM_F_DUMP, - &opts.query_opts); - if (ret < 0) { - json_object_put(opts.interfaces); - return NULL; - } - - return ifnames2addrs(opts.interfaces); -} - -static struct json_object * respondd_provider_neighbours(void) { - struct json_object *ret = json_object_new_object(); - - struct json_object *batadv = get_batadv(); - if (batadv) - json_object_object_add(ret, "batadv", batadv); - - return ret; -} - +__attribute__ ((visibility ("default"))) const struct respondd_provider_info respondd_providers[] = { {"nodeinfo", respondd_provider_nodeinfo}, {"statistics", respondd_provider_statistics}, From 2389679380a96ef0f01dfd5b14715a1c1c94e0ea Mon Sep 17 00:00:00 2001 From: Christof Schulze Date: Sun, 7 Jul 2019 03:33:22 +0200 Subject: [PATCH 029/105] gluon-mesh-babel: use babel 1.9.0 feature to set pref-src on installed routes --- .../luasrc/lib/gluon/upgrade/300-gluon-mesh-babel-mkconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/gluon-mesh-babel/luasrc/lib/gluon/upgrade/300-gluon-mesh-babel-mkconfig b/package/gluon-mesh-babel/luasrc/lib/gluon/upgrade/300-gluon-mesh-babel-mkconfig index 43eaa428..e9a62dbe 100755 --- a/package/gluon-mesh-babel/luasrc/lib/gluon/upgrade/300-gluon-mesh-babel-mkconfig +++ b/package/gluon-mesh-babel/luasrc/lib/gluon/upgrade/300-gluon-mesh-babel-mkconfig @@ -1,6 +1,8 @@ #!/usr/bin/lua local site = require 'gluon.site' +local uci = require('simple-uci').cursor() +local nodeip = uci:get('network', 'loopback', 'ip6addr'):match('^[^/]+') local babelconf='/etc/gluon-babeld.conf' local file = io.open(babelconf, "w") @@ -15,7 +17,7 @@ file:write("redistribute ip " .. site.prefix6() .. " eq 128 allow\n") file:write("redistribute ip " .. site.node_client_prefix6() .. " eq 128 allow\n") file:write("redistribute ip " .. site.node_prefix6() .. " eq 128 allow\n") file:write("redistribute ip 2000::/3 allow\n") - file:write("redistribute local if br-wan deny\n") file:write("redistribute local ip 0.0.0.0/0 deny\n") +file:write("install pref-src " .. nodeip .."\n") file:close() From d5b08fe6c9ebc91c1aaa45bedb132b45c380aef8 Mon Sep 17 00:00:00 2001 From: Christof Schulze Date: Fri, 23 Aug 2019 20:36:00 +0200 Subject: [PATCH 030/105] gluon-mesh-babel: depend on gluon-mmfd --- package/gluon-mesh-babel/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/gluon-mesh-babel/Makefile b/package/gluon-mesh-babel/Makefile index 4d5f1197..bdc3d4bc 100644 --- a/package/gluon-mesh-babel/Makefile +++ b/package/gluon-mesh-babel/Makefile @@ -10,7 +10,7 @@ include ../gluon.mk define Package/gluon-mesh-babel TITLE:=Babel mesh - DEPENDS:=+gluon-core +babeld +mmfd +libiwinfo +libgluonutil +firewall +libjson-c +libnl-tiny +libubus +libubox +libblobmsg-json +libbabelhelper +luabitop +gluon-l3roamd + DEPENDS:=+gluon-core +babeld +gluon-mmfd +libiwinfo +libgluonutil +firewall +libjson-c +libnl-tiny +libubus +libubox +libblobmsg-json +libbabelhelper +luabitop PROVIDES:=gluon-mesh-provider endef From 04421f60ac499c9c11054a7a44b5a84d40463a9c Mon Sep 17 00:00:00 2001 From: Simon Terzenbach Date: Thu, 21 Nov 2019 10:30:56 +0100 Subject: [PATCH 031/105] ath79-generic: add support for devolo WiFi pro 1750x --- docs/user/supported_devices.rst | 1 + package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua | 3 +++ targets/ath79-generic | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index 5feaa2b1..377a388b 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -188,6 +188,7 @@ ath79-generic - WiFi pro 1200i - WiFi pro 1750c - WiFi pro 1750i + - WiFi pro 1750x * OCEDO diff --git a/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua b/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua index d87218e6..a16c7036 100644 --- a/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua +++ b/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua @@ -44,6 +44,9 @@ function M.is_outdoor_device() elseif M.match('ar71xx', 'generic', {'unifiac-pro'}) and M.get_model() == 'Ubiquiti UniFi-AC-MESH-PRO' then return true + + elseif M.match('ath79', 'generic', {'devolo,dvl1750x'}) then + return true end return false diff --git a/targets/ath79-generic b/targets/ath79-generic index ba169e4e..f3fc4425 100644 --- a/targets/ath79-generic +++ b/targets/ath79-generic @@ -29,6 +29,11 @@ device('devolo-wifi-pro-1750i', 'devolo_dvl1750i', { factory = false, }) +device('devolo-wifi-pro-1750x', 'devolo_dvl1750x', { + packages = ATH10K_PACKAGES_QCA9880, + factory = false, +}) + -- OCEDO device('ocedo-raccoon', 'ocedo_raccoon', { From f276bd3bb4cfec1741c6538c1e4e3dbd684c9ece Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 26 Nov 2019 19:57:52 +0100 Subject: [PATCH 032/105] modules: update OpenWrt base 1859391e9ed2 uboot-envtools: ath79: add support for YunCore XD4200 and A782 45c9923edfeb ath79: add support for YunCore XD4200 and A782 83a18aefbdea ath79: add support for YunCore TFTP image generation 449433d13104 ath79: Add support for TP-Link Archer C60 v2 70233e3afe40 ath79: Add support for TP-Link Archer C60 v1 a2d9de21b841 base-files: config_generate: split macaddr with multiple ifaces 3a5e28bd266b ar71xx: ubnt-(xm,xw): add rssileds package 1cb763c559b8 ath79: add PoE passthrough switch for Ubiquiti Nanostation (XM/XW) a0897f8a4663 uboot-envtools: ramips: add support for ALFA Network Quad-E4G 71469caa0ab4 ramips: add support for ALFA Network Quad-E4G 939dfe61ed8a uboot-envtools: ramips: add support for ALFA Network R36M-E4G c515cd7c348c ramips: add support for ALFA Network R36M-E4G 7a62e909b286 ramips: support dual image feature on ALFA Network boards ee71837e3857 ramips: refresh all subtargets kernel configs 3806899a5015 ramips: use upstream RAW_APPENDED_DTB instead of our OWRTDTB --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index fa4c1435..841086a8 100644 --- a/modules +++ b/modules @@ -2,7 +2,7 @@ GLUON_FEEDS='packages routing gluon' OPENWRT_REPO=https://git.openwrt.org/openwrt/openwrt.git OPENWRT_BRANCH=openwrt-19.07 -OPENWRT_COMMIT=f97d2351e2c1282cdfa0e5126bd6eef56d0e8252 +OPENWRT_COMMIT=1859391e9ed29a803306545de495c03e4fca39cf PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git PACKAGES_PACKAGES_BRANCH=openwrt-19.07 From 06476c249600d38888adb80f2a70be09c7e8acf4 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 26 Nov 2019 20:01:42 +0100 Subject: [PATCH 033/105] modules: update OpenWrt and Gluon packages OpenWrt: 03b412db2e3f luasrcdiet: add package (moved from luci-base package) b98dcdc34273 cifsd-tools: update to git (2019-11-25) a45dd8850244 adblock: update 3.8.12 88c37cb6fe2d transmission: Disable webseeding e8438eb67ab8 transmission: Fix tracker issue with some firewalls 4a821376132a php7: Update to version 7.2.25 36358e7e382c php7: mark /etc/config/php7-fastcgi as conffile 3be4577ee916 php7-mod-xmlreader: add conditional dependency to php7-mod-dom (fixes #10201) 7aadc713003a php7: bump to 7.2.23 fc337287241f python-pyopenssl: Update to 19.1.0 Gluon: 208d9ccd14ba Revert "luasrcdiet: add package (moved from luci-base package)" and following --- modules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules b/modules index 841086a8..fa5764b6 100644 --- a/modules +++ b/modules @@ -6,11 +6,11 @@ OPENWRT_COMMIT=1859391e9ed29a803306545de495c03e4fca39cf PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git PACKAGES_PACKAGES_BRANCH=openwrt-19.07 -PACKAGES_PACKAGES_COMMIT=d4aa51b2462504f9ede0e9217547f77199306543 +PACKAGES_PACKAGES_COMMIT=03b412db2e3f9b42c4a55e13ce0c6de3c757895b PACKAGES_ROUTING_REPO=https://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_BRANCH=openwrt-19.07 PACKAGES_ROUTING_COMMIT=8d5ee29f088e9dfaa49dc74573edb1919f14dbf4 PACKAGES_GLUON_REPO=https://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=83dbdbcb7b6f1d9eab144423b82ee9ffa4c9bc69 +PACKAGES_GLUON_COMMIT=208d9ccd14ba21cf077c928e59dc4e39e71f3068 From e7d9a2749b626c5fc3980a655fb6db1a2814c668 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 1 Dec 2019 16:17:30 +0100 Subject: [PATCH 034/105] modules: update OpenWrt d2d12346e8 mac80211: unify setup of iw htmode for mesh and adhoc 06bf1a9b67 ucert: update to latest git HEAD d74526c1c5 OpenWrt v19.07.0-rc2: revert to branch defaults 628e996928 OpenWrt v19.07.0-rc2: adjust config defaults db8345d8e4 generic ar8xxx: increase VLAN table for AR83x7 cde70954ef busybox: add glibc dependency for vi regex option a4d798e8dd usign: Activate LTO compile option 1fc05c3115 swconfig: Activate LTO compile option 5cb845ebfe mtd: Activate LTO compile option c38074de92 ramips: disable ZyXel Keenetic by default 432a349761 ramips: disable WR512-3GN 4MB variant by default 67aca5f0ae ramips: disable A5-V11 by default eb836ea8e9 ar71xx: disable TP-Link TL-WA855RE by default 59ef47ae2c brcm47xx: disable Linksys E1000 v1 by default 7232d9247e ramips: disable TP-Link TL-WA750RE by default 531ab59804 ar71xx: disable TP-Link TL-WA850RE by default 634db7930a ramips: disable TP-Link TL-WR840N v5 by default 6a124efb99 ramips: disable Sitecom WL-351 by default 2607c02ed5 ramips: disable D-Link DIR-645 by default 02fc43b4b4 ramips: disable D-Link DIR-300 B5/B6/B7 by default 0686418338 ar71xx: disable Netgear WNR2000v4 by default 6af348f6a1 ar71xx: disable On Networks N150R by default c65f09b641 ar71xx: disable TP-Link TL-WA850RE v2 by default 1793baee46 ar71xx: disable Netgear WNR612 v2 by default 4b759caf51 ramips: disable ASUS RT-N10+ B1 by default 953d9c384f kernel: bump 4.14 to 4.14.156 7581a7bebc config: kernel: fix typo in HFSPLUG_FS_POSIX_ACL Compile-tested: mpc85xx-generic, ipq40xx-generic Runtime-tested: ipq40xx-generic (GL-B1300) --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index fa5764b6..013ad5c9 100644 --- a/modules +++ b/modules @@ -2,7 +2,7 @@ GLUON_FEEDS='packages routing gluon' OPENWRT_REPO=https://git.openwrt.org/openwrt/openwrt.git OPENWRT_BRANCH=openwrt-19.07 -OPENWRT_COMMIT=1859391e9ed29a803306545de495c03e4fca39cf +OPENWRT_COMMIT=d2d12346e8e6dd5fbb6befd4f9e3e1d5304a2e31 PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git PACKAGES_PACKAGES_BRANCH=openwrt-19.07 From 580b7357d5fe53e01c8845aec348fbae255b5e7f Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 1 Dec 2019 16:22:34 +0100 Subject: [PATCH 035/105] Revert gluon-status-page gateway_nexthop changes This reverts commits - caf2dd037ba4b560a0794ce87d6a230e7a6cbcf8. - 07ebac6a49a288a3f5b7c7fc4e45a38b265ff929 - 55eff45f96b435de2d3d94a0189ff99473e7828d I accidentally pushed these commits as I had them lying around on a dirty checkout I did testing on. --- .../lib/gluon/status-page/view/status-page.html | 2 +- package/gluon-status-page/i18n/de.po | 3 --- .../i18n/gluon-status-page.pot | 3 --- .../gluon-status-page/javascript/status-page.js | 17 ----------------- 4 files changed, 1 insertion(+), 24 deletions(-) diff --git a/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html b/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html index cb7aaa11..6e18b010 100644 --- a/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html +++ b/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html @@ -135,7 +135,7 @@ <%:Load average%><%= statistics('loadavg', 'decimal') %> <%:RAM%><%= statistics('memory', 'memory') %> <%:Filesystem%><%= statistics('rootfs_usage', 'percent') %> - <%:Gateway%><%= statistics('gateway') %>
<%= statistics('gateway_nexthop', 'neighbour') %> + <%:Gateway%><%= statistics('gateway') %> <%:Clients%><%= statistics('clients/total') %> diff --git a/package/gluon-status-page/i18n/de.po b/package/gluon-status-page/i18n/de.po index 5caebfde..ef0374c0 100644 --- a/package/gluon-status-page/i18n/de.po +++ b/package/gluon-status-page/i18n/de.po @@ -55,9 +55,6 @@ msgstr "Weitergeleitet" msgid "Gateway" msgstr "Gateway" -msgid "Gateway Nexthop" -msgstr "Gateway Nexthop" - msgid "IP address" msgstr "IP-Adresse" diff --git a/package/gluon-status-page/i18n/gluon-status-page.pot b/package/gluon-status-page/i18n/gluon-status-page.pot index e471e878..766a5de8 100644 --- a/package/gluon-status-page/i18n/gluon-status-page.pot +++ b/package/gluon-status-page/i18n/gluon-status-page.pot @@ -46,9 +46,6 @@ msgstr "" msgid "Gateway" msgstr "" -msgid "Gateway Nexthop" -msgstr "" - msgid "IP address" msgstr "" diff --git a/package/gluon-status-page/javascript/status-page.js b/package/gluon-status-page/javascript/status-page.js index b81d21a7..e3405cf6 100644 --- a/package/gluon-status-page/javascript/status-page.js +++ b/package/gluon-status-page/javascript/status-page.js @@ -112,20 +112,6 @@ 'bytes': function(bytes) { return prettyBytes(bytes); }, - 'neighbour': function(addr) { - if (!addr) - return ''; - - for (var i in interfaces) { - var iface = interfaces[i]; - var neigh = iface.get_neigh(addr); - if (!neigh) - continue; - return 'via ' + neigh.get_hostname() + ' (' + i + ')'; - } - - return 'via ' + addr + ' (unknown iface)'; - } } @@ -596,9 +582,6 @@ } return { - 'get_hostname': function() { - return hostname.textContent; - }, 'update_nodeinfo': function(nodeinfo) { var addr = choose_address(nodeinfo.network.addresses); if (addr) { From bdfa4b71ffb46ea3cad1b7e0ba263f57b9d7bffa Mon Sep 17 00:00:00 2001 From: Simon Terzenbach Date: Wed, 27 Nov 2019 13:09:58 +0100 Subject: [PATCH 036/105] ath79-generic: add support for devolo WiFi pro 1750e --- docs/user/supported_devices.rst | 1 + targets/ath79-generic | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index 377a388b..5bb24805 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -187,6 +187,7 @@ ath79-generic - WiFi pro 1200i - WiFi pro 1750c + - WiFi pro 1750e - WiFi pro 1750i - WiFi pro 1750x diff --git a/targets/ath79-generic b/targets/ath79-generic index f3fc4425..9c21d20b 100644 --- a/targets/ath79-generic +++ b/targets/ath79-generic @@ -24,6 +24,11 @@ device('devolo-wifi-pro-1750c', 'devolo_dvl1750c', { factory = false, }) +device('devolo-wifi-pro-1750e', 'devolo_dvl1750e', { + packages = ATH10K_PACKAGES_QCA9880, + factory = false, +}) + device('devolo-wifi-pro-1750i', 'devolo_dvl1750i', { packages = ATH10K_PACKAGES_QCA9880, factory = false, From bb2744f0d8223d3eff648ed9bda46792b7d77dc3 Mon Sep 17 00:00:00 2001 From: Simon Terzenbach Date: Tue, 26 Nov 2019 13:34:58 +0100 Subject: [PATCH 037/105] ath79-generic: add support for devolo WiFi pro 1200e --- docs/user/supported_devices.rst | 1 + targets/ath79-generic | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index 5bb24805..7d3727df 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -185,6 +185,7 @@ ath79-generic * devolo + - WiFi pro 1200e - WiFi pro 1200i - WiFi pro 1750c - WiFi pro 1750e diff --git a/targets/ath79-generic b/targets/ath79-generic index 9c21d20b..75791cb0 100644 --- a/targets/ath79-generic +++ b/targets/ath79-generic @@ -14,6 +14,11 @@ local ATH10K_PACKAGES_QCA9888 = { -- devolo +device('devolo-wifi-pro-1200e', 'devolo_dvl1200e', { + packages = ATH10K_PACKAGES_QCA9880, + factory = false, +}) + device('devolo-wifi-pro-1200i', 'devolo_dvl1200i', { packages = ATH10K_PACKAGES_QCA9880, factory = false, From aa679bc6e90a3b790e1956bf3b82df8a24dfa4f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20M=C3=B6ller?= Date: Tue, 3 Dec 2019 14:08:48 +0100 Subject: [PATCH 038/105] ar71xx-generic: add alias for wndr3800chmychart a regular Netgear WNDR3800 but identifies itself as wndr3800chmychart. --- targets/ar71xx-generic | 1 + 1 file changed, 1 insertion(+) diff --git a/targets/ar71xx-generic b/targets/ar71xx-generic index 69892177..fb69f3da 100644 --- a/targets/ar71xx-generic +++ b/targets/ar71xx-generic @@ -154,6 +154,7 @@ device('netgear-wndr3700v2', 'wndr3700v2', { }) device('netgear-wndr3800', 'wndr3800', { + aliases = {'netgear-wndr3800chmychart'}, factory_ext = '.img', }) From 82082d8c620f44a599694995e46b7fa68e98f016 Mon Sep 17 00:00:00 2001 From: lemoer Date: Thu, 5 Dec 2019 17:00:59 +0100 Subject: [PATCH 039/105] gluon-status-page: add gateway_nexthop to statistics --- .../gluon/status-page/view/status-page.html | 2 +- .../status-page/www/static/status-page.js | 2 +- package/gluon-status-page/i18n/de.po | 3 +++ .../i18n/gluon-status-page.pot | 3 +++ .../javascript/status-page.js | 21 +++++++++++++++++++ 5 files changed, 29 insertions(+), 2 deletions(-) diff --git a/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html b/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html index 6e18b010..cb7aaa11 100644 --- a/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html +++ b/package/gluon-status-page/files/lib/gluon/status-page/view/status-page.html @@ -135,7 +135,7 @@ <%:Load average%><%= statistics('loadavg', 'decimal') %> <%:RAM%><%= statistics('memory', 'memory') %> <%:Filesystem%><%= statistics('rootfs_usage', 'percent') %> - <%:Gateway%><%= statistics('gateway') %> + <%:Gateway%><%= statistics('gateway') %>
<%= statistics('gateway_nexthop', 'neighbour') %> <%:Clients%><%= statistics('clients/total') %> diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/static/status-page.js b/package/gluon-status-page/files/lib/gluon/status-page/www/static/status-page.js index 37bda815..87e33789 100644 --- a/package/gluon-status-page/files/lib/gluon/status-page/www/static/status-page.js +++ b/package/gluon-status-page/files/lib/gluon/status-page/www/static/status-page.js @@ -1 +1 @@ -"use strict";!function(){var a=JSON.parse(document.body.getAttribute("data-translations"));function r(t,e){return t.toFixed(e).replace(/\./,a["."])}function o(t,e){e--;for(var n=t;10<=n&&0e[0]?-1:t[1]e[1]?1:0});var e=t[0][2];return e&&!/^fe80:/i.test(e)?e:void 0}}(t.network.addresses);if(u){if("span"===h.nodeName.toLowerCase()){var l=h;h=document.createElement("a"),l.parentNode.replaceChild(h,l)}h.href="http://["+u+"]/"}if(h.textContent=t.hostname,y&&t.location){var f=(e=y.latitude,n=y.longitude,i=t.location.latitude,r=t.location.longitude,a=Math.PI/180,o=(i*=a)-(e*=a),c=(r*=a)-(n*=a),s=Math.sin(o/2)*Math.sin(o/2)+Math.sin(c/2)*Math.sin(c/2)*Math.cos(e)*Math.cos(i),2*Math.asin(Math.sqrt(s))*6372.8);d.textContent=Math.round(1e3*f)+" m"}p()},update_mesh:function(n){Object.keys(v).forEach(function(t){var e=v[t];e.td.textContent=n[t]+e.suffix}),p()},update_wifi:function(t){s.textContent=t.signal,u.textContent=Math.round(t.inactive/1e3)+" s",a.classList.toggle("inactive",200e[0]?-1:t[1]e[1]?1:0});var e=t[0][2];return e&&!/^fe80:/i.test(e)?e:void 0}}return t.wireless&&((u=a.insertCell()).textContent="-",(d=a.insertCell()).textContent="-",(s=a.insertCell()).textContent="-",f=E(n),t.signalgraph.addSignal(f)),a.onmouseenter=function(){a.classList.add("highlight"),f&&(f.highlight=!0)},a.onmouseleave=function(){a.classList.remove("highlight"),f&&(f.highlight=!1)},p(),{get_hostname:function(){return h.textContent},update_nodeinfo:function(t){var e,n,r,i,a,o,c,u,s=y(t.network.addresses);if(s){if("span"===h.nodeName.toLowerCase()){var f=h;h=document.createElement("a"),f.parentNode.replaceChild(h,f)}h.href="http://["+s+"]/"}if(h.textContent=t.hostname,C&&t.location){var l=(e=C.latitude,n=C.longitude,r=t.location.latitude,i=t.location.longitude,a=Math.PI/180,o=(r*=a)-(e*=a),c=(i*=a)-(n*=a),u=Math.sin(o/2)*Math.sin(o/2)+Math.sin(c/2)*Math.sin(c/2)*Math.cos(e)*Math.cos(r),2*Math.asin(Math.sqrt(u))*6372.8);d.textContent=Math.round(1e3*l)+" m"}p()},update_mesh:function(n){Object.keys(v).forEach(function(t){var e=v[t];e.td.textContent=n[t]+e.suffix}),p()},update_wifi:function(t){u.textContent=t.signal,s.textContent=Math.round(t.inactive/1e3)+" s",a.classList.toggle("inactive",200 Date: Tue, 3 Dec 2019 19:19:39 +0100 Subject: [PATCH 040/105] docs: clarify WAN port on LAN-only devices At the December 2019 review day, the behavior for LAN only devices was defined. Such devices will use each LAN port as WAN. --- docs/dev/wan.rst | 5 +++++ docs/user/supported_devices.rst | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/dev/wan.rst b/docs/dev/wan.rst index 86455e91..b992146a 100644 --- a/docs/dev/wan.rst +++ b/docs/dev/wan.rst @@ -11,6 +11,11 @@ There are two cases in which the WAN port is used: After the VPN connection has been established, the node should be able to reach the mesh's DNS servers and use these for all other name resolution. +If the device does not feature a WAN port, the LAN port is configured as WAN port. +In case such a device has multiple LAN ports, all these can be used as WAN. +Devices, which feature a "hybrid" port (labled as WAN/LAN), this port is used as WAN. + +This behavior can be reversed using the ``single_as_lan`` site.conf option. Routing tables ~~~~~~~~~~~~~~ diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index 7d3727df..91dddbeb 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -185,10 +185,10 @@ ath79-generic * devolo - - WiFi pro 1200e + - WiFi pro 1200e [#lan_as_wan]_ - WiFi pro 1200i - WiFi pro 1750c - - WiFi pro 1750e + - WiFi pro 1750e [#lan_as_wan]_ - WiFi pro 1750i - WiFi pro 1750x @@ -396,3 +396,6 @@ Footnotes .. [#eva_ramboot] For instructions on how to flash AVM NAND devices, see the respective commit which added support in OpenWrt. + +.. [#lan_as_wan] + All LAN ports on this device are used as WAN. From ed2479bd40613010a44a519c357a785a1c46b792 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 7 Dec 2019 21:40:01 +0100 Subject: [PATCH 041/105] docs: add revision number to TP-Link RE450 support list entry We only support v1, not v2 or v3. --- docs/user/supported_devices.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index 91dddbeb..c0ccc786 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -82,7 +82,7 @@ ar71xx-generic - CPE220 (v1.1) - CPE510 (v1.0, v1.1) - CPE520 (v1.1) - - RE450 + - RE450 (v1) - TL-WDR3500 (v1) - TL-WDR3600 (v1) - TL-WDR4300 (v1) From 510bcd4ab4f9688732b26a46c76e94fff232748e Mon Sep 17 00:00:00 2001 From: Dark4MD Date: Mon, 18 Nov 2019 23:28:21 +0100 Subject: [PATCH 042/105] lantiq-xrx200: add support for AVM FRITZ!Box 7362 SL Flash instructions in the OpenWRT Commit: https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=eae6cac6a30b95bef04d033ed8a303b7e35a078b --- docs/user/supported_devices.rst | 1 + targets/lantiq-xrx200 | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index c0ccc786..8b1218cb 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -250,6 +250,7 @@ lantiq-xrx200 * AVM + - FRITZ!Box 7362 SL [#eva_ramboot]_ [#lan_as_wan]_ - FRITZ!Box 7412 [#eva_ramboot]_ lantiq-xway diff --git a/targets/lantiq-xrx200 b/targets/lantiq-xrx200 index b9d9894a..8fd59ed6 100644 --- a/targets/lantiq-xrx200 +++ b/targets/lantiq-xrx200 @@ -1,3 +1,7 @@ +device('avm-fritz-box-7362-sl', 'avm_fritz7362sl', { + factory = false, +}) + device('avm-fritz-box-7412', 'avm_fritz7412', { factory = false, }) From 40ef70534d826e82a28600cdddaffaf7a07f5e1f Mon Sep 17 00:00:00 2001 From: Dark4MD Date: Mon, 9 Dec 2019 16:14:53 +0100 Subject: [PATCH 043/105] lantiq-xrx200: add support for AVM FRITZ!Box 7360 (v1, v2) and 7360 SL --- docs/user/supported_devices.rst | 2 ++ targets/lantiq-xrx200 | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index 8b1218cb..facd9166 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -250,6 +250,8 @@ lantiq-xrx200 * AVM + - FRITZ!Box 7360 (v1, v2) [#avmflash]_ [#lan_as_wan]_ + - FRITZ!Box 7360 SL [#avmflash]_ [#lan_as_wan]_ - FRITZ!Box 7362 SL [#eva_ramboot]_ [#lan_as_wan]_ - FRITZ!Box 7412 [#eva_ramboot]_ diff --git a/targets/lantiq-xrx200 b/targets/lantiq-xrx200 index 8fd59ed6..43526eb0 100644 --- a/targets/lantiq-xrx200 +++ b/targets/lantiq-xrx200 @@ -1,3 +1,8 @@ +device('avm-fritz-box-7360-sl', 'avm_fritz7360sl', { + factory = false, + aliases = {'avm-fritz-box-7360-v1', 'avm-fritz-box-7360-v2'}, +}) + device('avm-fritz-box-7362-sl', 'avm_fritz7362sl', { factory = false, }) From 4e070312f982f182cff21dda824914815b7cf9e6 Mon Sep 17 00:00:00 2001 From: Tata Date: Thu, 12 Dec 2019 13:08:27 +0100 Subject: [PATCH 044/105] docs: features/multidomain.rst: use gluon-reload instead of reboot (#1888) --- docs/features/multidomain.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/multidomain.rst b/docs/features/multidomain.rst index 1f9a729e..cf61ba05 100644 --- a/docs/features/multidomain.rst +++ b/docs/features/multidomain.rst @@ -94,7 +94,7 @@ Switching the domain uci set gluon.core.domain="newdomaincode" gluon-reconfigure - reboot + gluon-reload **via config mode:** From dd76e0898d70a123d8e7f178384fec84890e5251 Mon Sep 17 00:00:00 2001 From: Jan-Tarek Butt Date: Mon, 30 Sep 2019 21:38:40 +0200 Subject: [PATCH 045/105] treewide: solve shellcheck warnings --- contrib/depdot.sh | 3 +-- contrib/lsupgrade.sh | 3 ++- contrib/sign.sh | 2 +- contrib/sigtest.sh | 4 ++-- .../gluon-core/files/lib/netifd/proto/gluon_wired.sh | 1 + .../files/etc/hotplug.d/button/50-gluon-setup-mode | 4 ++-- .../gluon-setup-mode/files/lib/preinit/90_setup_mode | 2 +- scripts/features.sh | 11 ++++++----- scripts/filesize.sh | 2 +- scripts/modules.sh | 1 + scripts/patch.sh | 2 +- scripts/sha256sum.sh | 2 +- scripts/sha512sum.sh | 2 +- scripts/update-patches.sh | 4 ++-- scripts/update.sh | 6 +++--- 15 files changed, 26 insertions(+), 23 deletions(-) diff --git a/contrib/depdot.sh b/contrib/depdot.sh index c065ea57..4e0a9406 100755 --- a/contrib/depdot.sh +++ b/contrib/depdot.sh @@ -5,8 +5,7 @@ # * Works only if directory names and package names are the same (true for all Gluon packages) # * Doesn't show dependencies through virtual packages correctly - - +set -e shopt -s nullglob diff --git a/contrib/lsupgrade.sh b/contrib/lsupgrade.sh index eca7a852..f8e28f9a 100755 --- a/contrib/lsupgrade.sh +++ b/contrib/lsupgrade.sh @@ -1,5 +1,6 @@ #!/bin/bash +set -e # Script to list all upgrade scripts in a clear manner # Limitations: # * Does only show scripts of packages whose `files'/`luasrc' directories represent the whole image filesystem (which are all Gluon packages) @@ -27,7 +28,7 @@ fi pushd "$(dirname "$0")/.." >/dev/null -find ./package packages -name Makefile | while read makefile; do +find ./package packages -name Makefile | while read -r makefile; do dir="$(dirname "$makefile")" pushd "$dir" >/dev/null diff --git a/contrib/sign.sh b/contrib/sign.sh index c04854e8..d88bc345 100755 --- a/contrib/sign.sh +++ b/contrib/sign.sh @@ -2,7 +2,7 @@ set -e -if [ $# -ne 2 -o "-h" = "$1" -o "--help" = "$1" -o ! -r "$1" -o ! -r "$2" ]; then +if [ $# -ne 2 ] || [ "-h" = "$1" ] || [ "--help" = "$1" ] || [ ! -r "$1" ] || [ ! -r "$2" ]; then cat < diff --git a/contrib/sigtest.sh b/contrib/sigtest.sh index 2a0faf2c..0fa19f90 100755 --- a/contrib/sigtest.sh +++ b/contrib/sigtest.sh @@ -1,6 +1,6 @@ #!/bin/sh -if [ $# -eq 0 -o "-h" = "$1" -o "-help" = "$1" -o "--help" = "$1" ]; then +if [ $# -eq 0 ] || [ "-h" = "$1" ] || [ "-help" = "$1" ] || [ "--help" = "$1" ]; then cat < @@ -27,7 +27,7 @@ awk "BEGIN { sep=0 } else print > \"$lower\"}" \ "$manifest" -while read line +while read -r line do if ecdsaverify -s "$line" -p "$public" "$upper"; then ret=0 diff --git a/package/gluon-core/files/lib/netifd/proto/gluon_wired.sh b/package/gluon-core/files/lib/netifd/proto/gluon_wired.sh index 0778b354..708e9743 100755 --- a/package/gluon-core/files/lib/netifd/proto/gluon_wired.sh +++ b/package/gluon-core/files/lib/netifd/proto/gluon_wired.sh @@ -14,6 +14,7 @@ xor2() { echo -n "${1:1:1}" | tr '0123456789abcdef' '23016745ab89efcd' } +# shellcheck disable=SC2086 interface_linklocal() { local macaddr="$(ubus call network.device status '{"name": "'"$1"'"}' | jsonfilter -e '@.macaddr')" local oldIFS="$IFS"; IFS=':'; set -- $macaddr; IFS="$oldIFS" diff --git a/package/gluon-setup-mode/files/etc/hotplug.d/button/50-gluon-setup-mode b/package/gluon-setup-mode/files/etc/hotplug.d/button/50-gluon-setup-mode index 3a3cb20f..314f8a43 100755 --- a/package/gluon-setup-mode/files/etc/hotplug.d/button/50-gluon-setup-mode +++ b/package/gluon-setup-mode/files/etc/hotplug.d/button/50-gluon-setup-mode @@ -12,7 +12,7 @@ wait_setup_mode() { } -if [ "$BUTTON" = wps -o "$BUTTON" = reset -o "$BUTTON" = phone ]; then +if [ "$BUTTON" = wps ] || [ "$BUTTON" = reset ] || [ "$BUTTON" = phone ]; then case "$ACTION" in pressed) wait_setup_mode & @@ -21,7 +21,7 @@ if [ "$BUTTON" = wps -o "$BUTTON" = reset -o "$BUTTON" = phone ]; then ;; released) if [ -r /tmp/.wait_setup_mode ]; then - kill $(cat /tmp/.wait_setup_mode) + kill "$(cat /tmp/.wait_setup_mode)" rm /tmp/.wait_setup_mode fi ;; diff --git a/package/gluon-setup-mode/files/lib/preinit/90_setup_mode b/package/gluon-setup-mode/files/lib/preinit/90_setup_mode index 396b4f76..c38ac281 100644 --- a/package/gluon-setup-mode/files/lib/preinit/90_setup_mode +++ b/package/gluon-setup-mode/files/lib/preinit/90_setup_mode @@ -5,7 +5,7 @@ setup_mode_enable() { local enabled="$(uci -q get 'gluon-setup-mode.@setup_mode[0].enabled')" local configured="$(uci -q get 'gluon-setup-mode.@setup_mode[0].configured')" - if [ "$enabled" = 1 -o "$configured" != 1 ]; then + if [ "$enabled" = 1 ] || [ "$configured" != 1 ]; then echo '/lib/gluon/setup-mode/rc.d' > /tmp/rc_d_path fi } diff --git a/scripts/features.sh b/scripts/features.sh index 2d35fdee..1d7184ee 100755 --- a/scripts/features.sh +++ b/scripts/features.sh @@ -31,14 +31,14 @@ sanitize() { echo -n "$v" } -vars= +vars=() for feature in $1; do - if [ "$(type -t gluon_feature_nodefault_${feature})" != 'function' ]; then + if [ "$(type -t "gluon_feature_nodefault_${feature}")" != 'function' ]; then echo "gluon-${feature}" fi - vars="$vars $(sanitize "$feature")=1" + vars+=("$(sanitize "$feature")=1") done @@ -46,18 +46,19 @@ nodefault() { : } +# shellcheck disable=SC2086 packages() { local cond="$(sanitize "$1")" shift # We only allow variable names, parentheses and the operators: & | ! - if [ "$(expr match "$cond" '.*[^A-Za-z0-9_()&|! ].*')" -gt 0 ]; then + if grep -q '[^A-Za-z0-9_()&|! ]' <<< "$cond"; then exit 1 fi # Let will return false when the result of the passed expression is 0, # so we always add 1. This way false is only returned for syntax errors. - local ret="$(env -i $vars bash --norc -ec "let _result_='1+($cond)'; echo -n \"\$_result_\"" 2>/dev/null)" + local ret="$(env -i "${vars[@]}" bash --norc -ec "let _result_='1+($cond)'; echo -n \"\$_result_\"" 2>/dev/null)" case "$ret" in 2) for pkg in "$@"; do diff --git a/scripts/filesize.sh b/scripts/filesize.sh index 1a6ea4dd..7068eb54 100755 --- a/scripts/filesize.sh +++ b/scripts/filesize.sh @@ -1,7 +1,7 @@ #!/bin/sh check_command() { - which "$1" >/dev/null 2>&1 + command -v "$1" >/dev/null } if check_command gnustat; then diff --git a/scripts/modules.sh b/scripts/modules.sh index 4df7e580..78b819c3 100644 --- a/scripts/modules.sh +++ b/scripts/modules.sh @@ -1,6 +1,7 @@ . ./modules [ ! -f "$GLUON_SITEDIR"/modules ] || . "$GLUON_SITEDIR"/modules +# shellcheck disable=SC2086 FEEDS="$(echo $GLUON_FEEDS $GLUON_SITE_FEEDS | tr ' ' '\n')" GLUON_MODULES=openwrt diff --git a/scripts/patch.sh b/scripts/patch.sh index 082ca1fc..9269ffb5 100755 --- a/scripts/patch.sh +++ b/scripts/patch.sh @@ -3,7 +3,7 @@ set -e shopt -s nullglob -[ "$GLUON_TMPDIR" -a "$GLUON_PATCHESDIR" ] || exit 1 +[ "$GLUON_TMPDIR" ] && [ "$GLUON_PATCHESDIR" ] || exit 1 . scripts/modules.sh diff --git a/scripts/sha256sum.sh b/scripts/sha256sum.sh index e4f6f3e5..99d97acd 100755 --- a/scripts/sha256sum.sh +++ b/scripts/sha256sum.sh @@ -1,7 +1,7 @@ #!/bin/sh check_command() { - which "$1" >/dev/null 2>&1 + command -v "$1" >/dev/null 2>&1 } if check_command sha256sum; then diff --git a/scripts/sha512sum.sh b/scripts/sha512sum.sh index d9fd544d..cb4b07e4 100755 --- a/scripts/sha512sum.sh +++ b/scripts/sha512sum.sh @@ -1,7 +1,7 @@ #!/bin/sh check_command() { - which "$1" >/dev/null 2>&1 + command -v "$1" >/dev/null 2>&1 } if check_command sha512sum; then diff --git a/scripts/update-patches.sh b/scripts/update-patches.sh index 933d20ac..94f103fa 100755 --- a/scripts/update-patches.sh +++ b/scripts/update-patches.sh @@ -13,13 +13,13 @@ GLUONDIR="$(pwd)" for module in $GLUON_MODULES; do echo "--- Updating patches for module '$module' ---" - rm -rf "${GLUON_PATCHESDIR}/$module" + rm -rf "${GLUON_PATCHESDIR:?}/$module" cd "$GLUONDIR"/"$module" n=0 for commit in $(git rev-list --reverse --no-merges base..patched); do - let n=n+1 + (( ++n )) mkdir -p "${GLUON_PATCHESDIR}/$module" git -c core.abbrev=40 show --pretty=format:'From: %an <%ae>%nDate: %aD%nSubject: %B' --no-renames --binary "$commit" > "${GLUON_PATCHESDIR}/$module/$(printf '%04u' $n)-$(git show -s --pretty=format:%f "$commit").patch" done diff --git a/scripts/update.sh b/scripts/update.sh index afea8e71..0d33a8cc 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -10,9 +10,9 @@ GLUONDIR="$(pwd)" for module in $GLUON_MODULES; do echo "--- Updating module '$module' ---" var=$(echo "$module" | tr '[:lower:]/' '[:upper:]_') - eval repo=\${${var}_REPO} - eval branch=\${${var}_BRANCH} - eval commit=\${${var}_COMMIT} + eval 'repo=${'"${var}"'_REPO}' + eval 'branch=${'"${var}"'_BRANCH}' + eval 'commit=${'"${var}"'_COMMIT}' mkdir -p "$GLUONDIR/$module" cd "$GLUONDIR/$module" From 24a98428d489780fa84bdfb89aa767f1e378d8c7 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Tue, 17 Dec 2019 18:57:12 +0100 Subject: [PATCH 046/105] modules: bump OpenWrt 3243523c46 ath79: migrate LED paths of TL-WDR4300 board d0a71a89e1 malta: remove CONFIG_LEGACY_PTY from kernel config 9e6fb4463b sunxi: remove CONFIG_LEGACY_PTY from kernel config 4aebbaeac1 layerscape: remove CONFIG_LEGACY_PTY from kernel config a2ac5b3a97 kirkwood: remove CONFIG_LEGACY_PTY from kernel config a467f39e55 at91: disable legacy PTYs and virtual terminals a77d4bc3a5 mpc85xx: remove CONFIG_LEGACY_PTY from kernel config 40a7e761a0 uml: remove CONFIG_LEGACY_PTY from kernel config 852ec97e1c oxnas: disable legacy PTYs and virtual terminals 1f1867dd9b odhcpd: optimize syslog priority values 03c93679b4 lantiq: remove redundant WiFi LED on FRITZ!Box 7320 795df80917 mpc85xx: add support for Enterasys WS-AP3710i 3959f11005 glibc: update to latest 2.27 commit (BZ #2503, BZ #2504) a50c2190d3 glibc: backport fix for regexec buffer read overrun 929c6d733a glibc: update to latest 2.27 commit (BZ#23637) e8e09c5893 glibc: update to latest 2.27 commit (BZ #24228, BZ #24744, BZ #24699) 6e24df296c ath79: add support for TP-Link TL-WDR4300 v1 (IL) 52c9f95178 ramips: allow JCG_MAXSIZE in kiB in Build/jcg-header e33a123140 brcm47xx: add switch configuration for WNR3500L d1d84da1c3 ramips: fix number of LAN Ports for Mikrotik RBM33G fa700ed714 ramips: fix switch port order for TP-Link Archer C20i 0bb4733e67 ath10k-firmware: update Candela Tech firmware images c3cc419cc6 kernel: bump 4.14 to 4.14.158 compile-tested: ath79-generic run-tested: ath79-generic --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 013ad5c9..2acd2ce9 100644 --- a/modules +++ b/modules @@ -2,7 +2,7 @@ GLUON_FEEDS='packages routing gluon' OPENWRT_REPO=https://git.openwrt.org/openwrt/openwrt.git OPENWRT_BRANCH=openwrt-19.07 -OPENWRT_COMMIT=d2d12346e8e6dd5fbb6befd4f9e3e1d5304a2e31 +OPENWRT_COMMIT=3243523c46e059bde4f826531d5b0991eacdd1f3 PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git PACKAGES_PACKAGES_BRANCH=openwrt-19.07 From fb191ab8e4a44f59fd05b9d47938a5ee9f314414 Mon Sep 17 00:00:00 2001 From: Dark4MD Date: Mon, 11 Nov 2019 11:07:28 +0100 Subject: [PATCH 047/105] lantiq-xway: add support for AVM FRITZ!Box 7320, 7330 and 7330 SL --- docs/user/supported_devices.rst | 3 +++ targets/lantiq-xway | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index facd9166..3d148ceb 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -261,6 +261,9 @@ lantiq-xway * AVM - FRITZ!Box 7312 [#avmflash]_ + - FRITZ!Box 7320 [#avmflash]_ [#lan_as_wan]_ + - FRITZ!Box 7330 [#avmflash]_ [#lan_as_wan]_ + - FRITZ!Box 7330 SL [#avmflash]_ [#lan_as_wan]_ mpc85xx-generic --------------- diff --git a/targets/lantiq-xway b/targets/lantiq-xway index e3d5da98..bc556d7a 100644 --- a/targets/lantiq-xway +++ b/targets/lantiq-xway @@ -1,3 +1,8 @@ device('avm-fritz-box-7312', 'avm_fritz7312', { factory = false, }) + +device('avm-fritz-box-7320', 'avm_fritz7320', { + factory = false, + aliases = {'avm-fritz-box-7330', 'avm-fritz-box-7330-sl'}, +}) From d428e5345780d99f49dbad35e129efb1f645e87a Mon Sep 17 00:00:00 2001 From: David Bauer Date: Wed, 18 Dec 2019 23:56:34 +0100 Subject: [PATCH 048/105] mpc85xx-p1020: add support for Enterasys WS-AP3710i --- docs/user/supported_devices.rst | 4 ++++ targets/mpc85xx-p1020 | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index 3d148ceb..508d6f5a 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -279,6 +279,10 @@ mpc85xx-p1020 - HiveAP 330 +* Enterasys + + - WS-AP3710i + * OCEDO - Panda diff --git a/targets/mpc85xx-p1020 b/targets/mpc85xx-p1020 index c6fb7d16..ee120111 100644 --- a/targets/mpc85xx-p1020 +++ b/targets/mpc85xx-p1020 @@ -4,6 +4,14 @@ device('aerohive-hiveap-330', 'hiveap-330', { factory = false, }) + +-- Enterasys + +device('enterasys-ws-ap3710i', 'ws-ap3710i', { + factory = false, +}) + + -- OCEDO device('ocedo-panda', 'panda', { From 8446772d076fae9d27dd8fd78a785a1ae3e4411d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 23 Dec 2019 12:00:28 +0100 Subject: [PATCH 049/105] gluon-site: add missing build depends on gluon-web/host --- package/gluon-site/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/gluon-site/Makefile b/package/gluon-site/Makefile index b1d2d91b..b81ed103 100644 --- a/package/gluon-site/Makefile +++ b/package/gluon-site/Makefile @@ -8,7 +8,7 @@ PKG_VERSION:=$(if $(DUMP),x,$(GLUON_SITE_VERSION)) PKG_CONFIG_DEPENDS := CONFIG_GLUON_RELEASE CONFIG_GLUON_SITEDIR CONFIG_GLUON_MULTIDOMAIN PKG_FILE_DEPENDS := $(GLUON_SITEDIR)/site.conf $(GLUON_SITEDIR)/domains/ $(GLUON_SITEDIR)/i18n/ -PKG_BUILD_DEPENDS := lua-cjson/host +PKG_BUILD_DEPENDS := lua-cjson/host gluon-web/host PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) From 920aa1a21d27c4fd808035136c391b42c813f80e Mon Sep 17 00:00:00 2001 From: nrbffs <38812627+nrbffs@users.noreply.github.com> Date: Fri, 27 Dec 2019 15:09:26 +0100 Subject: [PATCH 050/105] patches/openwrt: add set TARGET_ROOTFS_PARTSIZE to make combined image fit in 128MB --- ...-to-make-combined-image-fit-in-128MB.patch | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 patches/openwrt/0006-build-set-TARGET_ROOTFS_PARTSIZE-to-make-combined-image-fit-in-128MB.patch diff --git a/patches/openwrt/0006-build-set-TARGET_ROOTFS_PARTSIZE-to-make-combined-image-fit-in-128MB.patch b/patches/openwrt/0006-build-set-TARGET_ROOTFS_PARTSIZE-to-make-combined-image-fit-in-128MB.patch new file mode 100644 index 00000000..773b2800 --- /dev/null +++ b/patches/openwrt/0006-build-set-TARGET_ROOTFS_PARTSIZE-to-make-combined-image-fit-in-128MB.patch @@ -0,0 +1,27 @@ +From: Matthias Schiffer +Date: Sat, 21 Sep 2019 13:21:36 +0200 +Subject: build: set TARGET_ROOTFS_PARTSIZE to make combined image fit in 128MB + +Change TARGET_ROOTFS_PARTSIZE from 128 to 104 MiB, so the whole image +(bootloader + boot + root) will fit on a 128MB CF card by default. + +With these settings, the generated images (tested on x86-generic and +x86-64) have 126,353,408 bytes; the smallest CF card marketed as "128MB" +that I found a datasheet for (a Transcend TS128MCF80) has 126,959,616 +bytes. + +Signed-off-by: Matthias Schiffer + +diff --git a/config/Config-images.in b/config/Config-images.in +index 8548c7cd24742daad4fb1c64e58bad82590795c2..dc7a9cbd54ffbe3c78a7fdbd124f389c102ef6c1 100644 +--- a/config/Config-images.in ++++ b/config/Config-images.in +@@ -274,7 +274,7 @@ menu "Target Images" + config TARGET_ROOTFS_PARTSIZE + int "Root filesystem partition size (in MB)" + depends on GRUB_IMAGES || USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS || TARGET_omap || TARGET_rb532 || TARGET_sunxi || TARGET_uml +- default 256 ++ default 104 + help + Select the root filesystem partition size. + From 25a4f3b816e9879656c3ea3100b55f72edf59fdd Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sat, 28 Dec 2019 18:40:33 +0100 Subject: [PATCH 051/105] docs: add mt76 to supported chipsets (#1870) The docs previously only listed ath9k and ath10k based chipsets as fully supported by Gluon, however we also support mt76. --- docs/dev/hardware.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/hardware.rst b/docs/dev/hardware.rst index dae2bbb3..986a88bf 100644 --- a/docs/dev/hardware.rst +++ b/docs/dev/hardware.rst @@ -5,7 +5,7 @@ for new hardware to Gluon. Hardware requirements --------------------- -Having an ath9k (or ath10k) based WLAN adapter is highly recommended, +Having an ath9k, ath10k or mt76 based WLAN adapter is highly recommended, although other chipsets may also work. VAP (multiple SSID) support is a requirement. From a2ced263ab20123a67b850f397d737e86d7af85c Mon Sep 17 00:00:00 2001 From: Jan-Tarek Butt Date: Sat, 14 Dec 2019 22:18:58 +0100 Subject: [PATCH 052/105] build: add make targets lint, lint-sh, lint-lua [Matthias Schiffer: minor script improvements] --- Makefile | 7 +++++++ scripts/lint-lua.sh | 5 +++++ scripts/lint-sh.sh | 28 ++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100755 scripts/lint-lua.sh create mode 100755 scripts/lint-sh.sh diff --git a/Makefile b/Makefile index a9849104..34343356 100644 --- a/Makefile +++ b/Makefile @@ -103,6 +103,13 @@ endef list-targets: FORCE @$(foreach target,$(GLUON_TARGETS),echo '$(target)';) +lint: lint-lua lint-sh + +lint-lua: FORCE + @scripts/lint-lua.sh + +lint-sh: FORCE + @scripts/lint-sh.sh GLUON_DEFAULT_PACKAGES := hostapd-mini diff --git a/scripts/lint-lua.sh b/scripts/lint-lua.sh new file mode 100755 index 00000000..e958e3f1 --- /dev/null +++ b/scripts/lint-lua.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +set -e + +luacheck package scripts targets diff --git a/scripts/lint-sh.sh b/scripts/lint-sh.sh new file mode 100755 index 00000000..71ce5463 --- /dev/null +++ b/scripts/lint-sh.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +set -e + +is_scriptfile() { + echo "$1" | grep -qE '.*\.sh$' || head -n1 "$1" | grep -qE '^#.*(sh|bash)$' +} + +find contrib -type f | while read -r file; do + is_scriptfile "$file" || continue + + echo "Checking $file" + shellcheck -f gcc "$file" +done + +find package -type f | while read -r file; do + is_scriptfile "$file" || continue + + echo "Checking $file" + shellcheck -f gcc -x -s sh -e SC2039,SC1091,SC2155,SC2034 "$file" +done + +find scripts -type f | while read -r file; do + is_scriptfile "$file" || continue + + echo "Checking $file" + shellcheck -f gcc -x -e SC2154,SC1090,SC2181,SC2155,SC2148,SC2034,SC2148 "$file" +done From 6024c7a22f4b3614e7a45839ae45de6f3a3bec8a Mon Sep 17 00:00:00 2001 From: Jan-Tarek Butt Date: Fri, 27 Sep 2019 00:01:01 +0200 Subject: [PATCH 053/105] CI Jenkinsfile: use taps and fix fileformat --- contrib/ci/Jenkinsfile | 50 +++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/contrib/ci/Jenkinsfile b/contrib/ci/Jenkinsfile index 5ecbe203..4ab6300d 100644 --- a/contrib/ci/Jenkinsfile +++ b/contrib/ci/Jenkinsfile @@ -1,27 +1,27 @@ pipeline { - agent { label 'gluon-docker' } - environment { - GLUON_SITEDIR = "contrib/ci/minimal-site" - GLUON_TARGET = "x86-64" - BUILD_LOG = "1" - } - stages { - stage('lint') { - steps { - sh 'luacheck package scripts targets' - } - } - stage('docs') { - steps { - sh 'make -C docs html' - } - } - stage('build') { - steps { - sh 'make update' - sh 'test -d /dl_cache && ln -s /dl_cache openwrt/dl || true' - sh 'make -j$(nproc) V=s' - } - } - } + agent { label 'gluon-docker' } + environment { + GLUON_SITEDIR = "contrib/ci/minimal-site" + GLUON_TARGET = "x86-64" + BUILD_LOG = "1" + } + stages { + stage('lint') { + steps { + sh 'luacheck package scripts targets' + } + } + stage('docs') { + steps { + sh 'make -C docs html' + } + } + stage('build') { + steps { + sh 'make update' + sh 'test -d /dl_cache && ln -s /dl_cache openwrt/dl || true' + sh 'make -j$(nproc) V=s' + } + } + } } From 600e67350ae696afd3e7157f3658569be143aa9f Mon Sep 17 00:00:00 2001 From: Jan-Tarek Butt Date: Fri, 27 Sep 2019 00:06:01 +0200 Subject: [PATCH 054/105] CI Jenkinsfile: add parallel task for shellcheck lint --- contrib/ci/Jenkinsfile | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/contrib/ci/Jenkinsfile b/contrib/ci/Jenkinsfile index 4ab6300d..87a89bef 100644 --- a/contrib/ci/Jenkinsfile +++ b/contrib/ci/Jenkinsfile @@ -1,3 +1,20 @@ +def lualint() { + make lint-lua +} + +def shelllint() { + make lint-sh +} + +run_lint_set = [ + "task1": { + lualint() + }, + "task2": { + shelllint() + } +] + pipeline { agent { label 'gluon-docker' } environment { @@ -8,7 +25,9 @@ pipeline { stages { stage('lint') { steps { - sh 'luacheck package scripts targets' + script { + parallel(run_lint_set) + } } } stage('docs') { From 2c071657ac5701c2fbc15dd4bd88088b07be459f Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 29 Dec 2019 15:54:27 +0100 Subject: [PATCH 055/105] contrib: Dockerfile: add shellcheck --- contrib/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/Dockerfile b/contrib/Dockerfile index 18868378..50d7ff89 100644 --- a/contrib/Dockerfile +++ b/contrib/Dockerfile @@ -17,6 +17,7 @@ RUN apt update && apt install -y --no-install-recommends \ time \ ecdsautils \ lua-check \ + shellcheck \ && rm -rf /var/lib/apt/lists/* RUN useradd -d /gluon gluon From 4de6f3ff36fdc53f56601f924f2840096053043f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 29 Dec 2019 15:59:16 +0100 Subject: [PATCH 056/105] Jenkinsfile: fix indentation --- contrib/ci/Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/ci/Jenkinsfile b/contrib/ci/Jenkinsfile index 87a89bef..32fad18b 100644 --- a/contrib/ci/Jenkinsfile +++ b/contrib/ci/Jenkinsfile @@ -19,8 +19,8 @@ pipeline { agent { label 'gluon-docker' } environment { GLUON_SITEDIR = "contrib/ci/minimal-site" - GLUON_TARGET = "x86-64" - BUILD_LOG = "1" + GLUON_TARGET = "x86-64" + BUILD_LOG = "1" } stages { stage('lint') { @@ -38,8 +38,8 @@ pipeline { stage('build') { steps { sh 'make update' - sh 'test -d /dl_cache && ln -s /dl_cache openwrt/dl || true' - sh 'make -j$(nproc) V=s' + sh 'test -d /dl_cache && ln -s /dl_cache openwrt/dl || true' + sh 'make -j$(nproc) V=s' } } } From 7302fbf5abaada0bdc76ef1b294c2cbb428feef5 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 29 Dec 2019 15:59:29 +0100 Subject: [PATCH 057/105] Jenkinsfile: fix parallel step declaration --- contrib/ci/Jenkinsfile | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/contrib/ci/Jenkinsfile b/contrib/ci/Jenkinsfile index 32fad18b..443d78ef 100644 --- a/contrib/ci/Jenkinsfile +++ b/contrib/ci/Jenkinsfile @@ -1,22 +1,5 @@ -def lualint() { - make lint-lua -} - -def shelllint() { - make lint-sh -} - -run_lint_set = [ - "task1": { - lualint() - }, - "task2": { - shelllint() - } -] - pipeline { - agent { label 'gluon-docker' } + agent none environment { GLUON_SITEDIR = "contrib/ci/minimal-site" GLUON_TARGET = "x86-64" @@ -24,18 +7,29 @@ pipeline { } stages { stage('lint') { - steps { - script { - parallel(run_lint_set) + parallel { + stage('lint-lua') { + agent { label 'gluon-docker' } + steps { + sh 'make lint-lua' + } + } + stage('lint-sh') { + agent { label 'gluon-docker' } + steps { + sh 'make lint-sh' + } } } } stage('docs') { + agent { label 'gluon-docker' } steps { sh 'make -C docs html' } } stage('build') { + agent { label 'gluon-docker' } steps { sh 'make update' sh 'test -d /dl_cache && ln -s /dl_cache openwrt/dl || true' From ef95448702987a0df64d701884adcb1b371e51c6 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Thu, 2 Jan 2020 03:58:53 +0100 Subject: [PATCH 058/105] modules: bump OpenWrt 7ab5dc77b2 ramips: add LED trigger for TL-WR902AC v3 WAN LED ad4b939bd0 rt2x00: add throughput LED trigger 91dde4291c mac80211: fix build without CONFIG_PCI 30301dfcf0 mac80211: add patch to include local BSS rx time in survey information da7dde8993 mac80211: add pcie apsm backport changes 62d5ece70b ramips: remove bogus ralink,mtd-eeprom with offset 0x4 94153971bb ipq40xx: use ath10k-ct-smallbuffers for 128 MiB devices d13c6d078e kernel: bump 4.14 to 4.14.160 f80272dd9c kernel: bump 4.14 to 4.14.159 3030abfa7e ath79: use ath10k-ct-smallbuffers for 64 MiB devices 36057763fa ath10k-firmware: Add kmod-ath10k-ct-smallbuffers to depends 450b306e54 kernel: ath10k-ct: provide a build variant for small RAM devices e50d44d985 fstools: update to latest git HEAD 6a151d6558 fstools: update to latest git HEAD 43c5927312 fstools: bump to version 2019-11-03 f7779d64ba fstools: update to latest Git HEAD ab7386bd67 libubox: bump to version 2019-10-29 c34499a6e4 libubox: update to latest git HEAD 7203a58d7b kernel: remove LINUX_4_9 dependency of kmod-dax 0c07224b5a scripts/dowload.pl: add archive.apache.org to apache mirror list 4fba5dc103 kernel: fix *-gpio-custom module unloading df45ef5436 cmake: Install host packages to lib instead of lib64 6351205d73 adb: fix for SuperSpeed devices d2e87c7800 toolchain/gcc: Backport patch to fix unconditional MULTIARCH_DIRNAME a7d880e830 toolchain/gcc: correct the check expr for newer clang 3a863da268 lantiq: fix phys led 18107f4481 uhttpd: reset PKG_RELEASE 414ea30927 uhttpd: update to latest Git HEAD 27eea24921 ar71xx: fix MAC address setup for TL-WDR4300 board 9bdd3d39ad ath79: fix MAC address setup for TP-Link TL-WDR3600/TL-WDR4300 08c850f046 ramips: fix USB LED for Belkin F9K1109v1 2c16044ccf mac80211: brcm: add support for BCM4359 SDIO chipset c0f2905fa9 mac80211: brcm: backport 5.5 and 5.6 kernel patches Compile-tested: ramips-mt7621 Run-tested: ramips-mt7621 --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 2acd2ce9..f6c55f4e 100644 --- a/modules +++ b/modules @@ -2,7 +2,7 @@ GLUON_FEEDS='packages routing gluon' OPENWRT_REPO=https://git.openwrt.org/openwrt/openwrt.git OPENWRT_BRANCH=openwrt-19.07 -OPENWRT_COMMIT=3243523c46e059bde4f826531d5b0991eacdd1f3 +OPENWRT_COMMIT=7ab5dc77b223fd71e07ac5b8eb2f32852e804db9 PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git PACKAGES_PACKAGES_BRANCH=openwrt-19.07 From 8d8634b78eacbafd16a04f6a1e2a8d57bc4b1e43 Mon Sep 17 00:00:00 2001 From: Andreas Ziegler Date: Sun, 29 Dec 2019 16:07:21 +0100 Subject: [PATCH 059/105] docs: add v2018.2.4 release notes (cherry picked from commit 1e66cd905773a6271c11f712ae9fd8cf7ce38e9b) --- docs/index.rst | 1 + docs/releases/v2018.2.4.rst | 53 +++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 docs/releases/v2018.2.4.rst diff --git a/docs/index.rst b/docs/index.rst index ae4a4df0..3052a6fe 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -75,6 +75,7 @@ Several Freifunk communities in Germany use Gluon as the foundation of their Fre :maxdepth: 1 releases/v2019.1 + releases/v2018.2.4 releases/v2018.2.3 releases/v2018.2.2 releases/v2018.2.1 diff --git a/docs/releases/v2018.2.4.rst b/docs/releases/v2018.2.4.rst new file mode 100644 index 00000000..bddae46d --- /dev/null +++ b/docs/releases/v2018.2.4.rst @@ -0,0 +1,53 @@ +Gluon 2018.2.4 +============== + +End of life +~~~~~~~~~~~~~~ + +This will be the final release of the v2018.2.x series. Updating to the v2019.1.x release series is the recommended course of action, which should be fairly easy. + +Bugfixes +~~~~~~~~ + +* Fixes device alias for Ubiquiti UniFi AC LR. (`#1834 `_) + Autoupdates on this model were impossible before, since we were missing the proper device alias. + +* Add correct ath10k firmware package for OCEDO Koala. (`#1838 `_) + +* Fixes various batman-adv bugs with backports from 2019.4 and 2019.5 by updating the openwrt-routing packages feed + +Other changes +~~~~~~~~~~~~~ + +* Linux kernel has been updated to either + + - 4.9.207 (ar71xx, brcm2708, mpc85xx) or + - 4.14.160 (ipq40xx, ipq806x, mvebu, ramips, sunxi, x86). + +Known issues +~~~~~~~~~~~~ + +* Default TX power on many Ubiquiti devices is too high, correct offsets are + unknown (`#94 `_) + + Reducing the TX power in the Advanced Settings is recommended. + +* The MAC address of the WAN interface is modified even when Mesh-on-WAN is + disabled (`#496 `_) + + This may lead to issues in environments where a fixed MAC address is expected + (like VMware when promiscuous mode is disallowed). + +* Inconsistent respondd API + (`#522 `_) + + The current API is inconsistent and will be replaced eventually. The old API + will still be supported for a while. + +* Frequent reboots due to out-of-memory or high load due to memory pressure on + weak hardware especially in larger meshes + (`#1243 `_) + + Optimizations in Gluon 2018.1 have significantly improved memory usage. + There are still known bugs leading to unreasonably high load that we hope to + solve in future releases. From e9dc28241e6e362eb46540a9c539d7286e17eec3 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Fri, 3 Jan 2020 20:50:52 +0100 Subject: [PATCH 060/105] modules: bump OpenWrt 594f731e04 ramips: fix Archer C20i wireless MAC address 037a151c56 ramips: fix Archer C2 v1 5GHz MAC address 3e8b66e0da ramips: add system LED indicators for TP-Link C20i 80e0b97d07 ramips: convert TP-Link MT7620 boards to tpt trigger a2e2c40b5e mt76: update to the latest openwrt-19.07 version 1f927bd2f0 ramips: fix inverted reset button for Ravpower WD03 Compile-tested: ramips-mt7621 Run-tested: ramips-mt7621 --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index f6c55f4e..fe11f257 100644 --- a/modules +++ b/modules @@ -2,7 +2,7 @@ GLUON_FEEDS='packages routing gluon' OPENWRT_REPO=https://git.openwrt.org/openwrt/openwrt.git OPENWRT_BRANCH=openwrt-19.07 -OPENWRT_COMMIT=7ab5dc77b223fd71e07ac5b8eb2f32852e804db9 +OPENWRT_COMMIT=594f731e04f5442c94a4cfb57c7d46d7513fa9ce PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git PACKAGES_PACKAGES_BRANCH=openwrt-19.07 From 8df207c103d0ebc6e55d5ecd301e0f7348e647ce Mon Sep 17 00:00:00 2001 From: David Bauer Date: Fri, 20 Dec 2019 22:49:46 +0100 Subject: [PATCH 061/105] ipq40xx-generic: add support for Aruba AP-303 --- ...07-ipq-wifi-add-BDF-for-Aruba-AP-303.patch | 92 +++ ...ipq40xx-add-support-for-Aruba-AP-303.patch | 646 ++++++++++++++++++ targets/ipq40xx-generic | 7 + 3 files changed, 745 insertions(+) create mode 100644 patches/openwrt/0007-ipq-wifi-add-BDF-for-Aruba-AP-303.patch create mode 100644 patches/openwrt/0008-ipq40xx-add-support-for-Aruba-AP-303.patch diff --git a/patches/openwrt/0007-ipq-wifi-add-BDF-for-Aruba-AP-303.patch b/patches/openwrt/0007-ipq-wifi-add-BDF-for-Aruba-AP-303.patch new file mode 100644 index 00000000..bfc386a2 --- /dev/null +++ b/patches/openwrt/0007-ipq-wifi-add-BDF-for-Aruba-AP-303.patch @@ -0,0 +1,92 @@ +From: David Bauer +Date: Sun, 15 Dec 2019 23:02:54 +0100 +Subject: ipq-wifi: add BDF for Aruba AP-303 + +The BDF originates from the vendor-firmware. + +Signed-off-by: David Bauer +(cherry picked from commit 4113d8a2554adf5ecee55cc07956eafad378eaff) + +diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile +index eb7c2df1aa36ded7774a772c8a7e02b2acb81b40..cc0505b97c6a04bafd88972cf6ce7890a637c33b 100644 +--- a/package/firmware/ipq-wifi/Makefile ++++ b/package/firmware/ipq-wifi/Makefile +@@ -25,6 +25,7 @@ endef + + ALLWIFIBOARDS:= \ + alfa-network_ap120c-ac \ ++ aruba_ap-303 \ + asus_map-ac2200 \ + avm_fritzbox-7530 \ + avm_fritzrepeater-1200 \ +@@ -97,6 +98,7 @@ endef + # Add $(eval $(call generate-ipq-wifi-package,,)) + + $(eval $(call generate-ipq-wifi-package,alfa-network_ap120c-ac,ALFA Network AP120C-AC)) ++$(eval $(call generate-ipq-wifi-package,aruba_ap-303,Aruba AP-303)) + $(eval $(call generate-ipq-wifi-package,asus_map-ac2200,ASUS MAP-AC2200)) + $(eval $(call generate-ipq-wifi-package,avm_fritzbox-7530,AVM FRITZ!Box 7530)) + $(eval $(call generate-ipq-wifi-package,avm_fritzrepeater-1200,AVM FRITZRepeater 1200)) +diff --git a/package/firmware/ipq-wifi/board-aruba_ap-303.qca4019 b/package/firmware/ipq-wifi/board-aruba_ap-303.qca4019 +new file mode 100644 +index 0000000000000000000000000000000000000000..4848115cfbe3a4a0ed6b17cac929731ecbd7968c +GIT binary patch +literal 24316 +zcmeHPdr(tX8b1l)p-UHTNDu)pAp}Se0tBi-!W$`%6c7~&un1I6BFeZwJ$y}AjvN}B`Pfz$mMbX<(NN~1F#FGd_`$kUSYm( +zzFg|}UZJ$ePkJaU0I%hr$SXO7RRsaQWqBpiyyGXsqDmC`d45r;enA02aybRIXTiQ$ +z{(Fv6D8Qnc9-NN#>(d1&AQynm*7jHxFaWR*!ZjM6>t{S38|w;yprD{vFJ4eY3@h-< +z-!4WF$pUt;M0u#+u2DM@cmo9V_`vZ+ET^9yjw-&*$wzjskw6xF>07kKy8YxWZr<)vMT{juo&5WBJl$pvJ +zSBe@2uw^qXb0;%4&|Y78I5R0hICi_exl*3FFCluYul;;oiF8lGjWOy2|{_1bA?;y|Gf7nVJwj){D78n-DgruPe_KCxqe+o_PC!v0LpI;0W&~ +zgp7R#8_4hmJ+PC)%p@TfcGpx{l$j&E$%$G#3{F}KdUX|Jgd|puct0g5t8qXU6jp>E=A|Pc_n}{`jGyHYexpa) +z8eg})+@@SU~bv!vW@t_*D0~j*k2Ra54<44 +zGAfly!Ey@=__b^`E!H<{G6I~Qyq_vSIUEo8>&bR^_h7rT+37SJ;+lkrg)CPdfsBl_ +zWH#Fk4)pWSFMfRe8oL4#@;p7Xw*UV4*B^9knBz8EYbuTQKj>!%PuOhxmoH!ZTkE^h +zQ5Oxs>k&9eQFX%rmay^oy5hs-a5%Vu>&0fVaLp_>UjzM_W;28hf+9#18ifR+fk=_! +zRP~t;8=70^D?l_Y4@^?%D4kD#N=KYgXTG!89<@iD&}cN8AN@2MNkkL*iQ-5!5{X9z +zsDLkcDnNFjyZF1r0cZdsL}!9fUpK7I#3T~UL`ACe&W|yWIG_$w4u}it!gmqJpfOW1 +zND`XFPZ9^AK~q6UC>qKS6>Cp|ZjKM7g?`0zZ0#0(s21q!}Wsktx^q!Hyz)q)K=GO +zoF7djK!C#!ycz%kffr-~xxvJNR46t~SlLJq1Z=jeD_c)mpnblT&CYJ-0FjUaUY!7- +z#TubR1_QvgL4XK|Xt`DhpfahOvtem(k8e884~Vp^8wB1A+A^rrLvRNI?k-blHXlQ| +z28Ed52$bd6#2N6zwQKmBg-UNPPtI?dv^#g&y*lmgoH%t~Mt1I@LRDi+Ye!f2&4Iz; +zkI`9mEA&tbcUZ +z%raPCff}=CoSdFh&~W)`kLJ$!*9+*BuD^e+C^f1J|FyU;r!;;^^oI +zutbQ7^|zo9O_y4-fz<*{BN<(cKQSIMS&pfWHI9R`Q7+)GZ~m87zSOtRt#@=xPIh$J +z+RmlJ%=Iy)wjsB2$w?ctL{=e6#)NGiAEXw5z3>BC;Y0;D{!GEsIar?io&qX3RM0m- +z1^qu!!LtzyFeRb^yHOg52(ttT)56l)JRy+1kO+_nY&ZmFIrD}%_y76l-@pIvyT3qG +z!a_rK!Uv_0b8llsqdtHB4`|cp+)q8%a_-ajrKM^)`>$U7G-ZAsz9G)NzdxUkC2X$& +zduqM~`z#Q)p7ZVawgPK2|7z4Vsn5hz4U5-aIh*Kyy`9 +z2K#+`d{Fa=s!Ar2h&1D>cG=1J-CQSpgrl-7ZAjx2Fr>-5ns)VRm0Y%a{Fdgrx(+r@ +z*4$UM$;#s6xh~@)>W}b{+^~=yKH~BKoNA}$qFSNKg(0ccXH~^YiRPBNQznm(68cZx +z*IZXs$_@yfwGDV)*c_VFr&I;XWO(qZszR13@rQx5DHW0=A#d`I=8CFBmJ-jw8hkOq +zgDBk|Z&R15a+I-?Bk*9UGFz4i!@LHuj1;2qXotF778Ab}Z}1q-!4z4Am-=K##+*PB +zB@(3t5LgdOV}YrW<_(KL>(KEV5iNeTE@js=e`t@r=v}q-_{qz0XL!ZV`L=NnyANLo +zQ+gcPBDpqn@zBNZRxW7|) +z$*qbmtL@F{5S&95^!$;V#g`*L;FZw#KkAbCs3#V=uB4NN#U`sakZFU2HEI?ks7Dsq&ROrak#AvEH|GYk~cN +z-oYbXaZQ|4jDps_<5wfH44oN*XPh1H-<59xMxzd~07FF+FO3!KO +zkzNs<^C)%5zR+;s{a_h8iyk@DSK5($fm`l$c*8Cna^fTc>i~h}zJUY22WwUg;4xU6 +zE40Voz~Sl1fxqzW8!QiZceZ;vST%3pn9qkNDEBsI+pnKL20^*sWVSI3z)zY;1PmfD +zk8=M~&&^oEhq?Xq!q{llMLGBQ>t)~ra4xR!eZAQ1X^ph;*FG+*f4xJlJ!C>*eEV+r +z#z~GXOppZ=2|4(iyLmNON}QN2ao#+YHqDy{lvv2w_X*(?ul{+G5$Yp=apGx^6Q9v~ +z^YKb>;`PTfcYPtQJz@VX`S#e@Bso3?a_*Ok9NBKwB4Es(@j^U%UHht?;4%Xv +NIrrxNmNc!u{{!hMI2Hf^ + +literal 0 +HcmV?d00001 + diff --git a/patches/openwrt/0008-ipq40xx-add-support-for-Aruba-AP-303.patch b/patches/openwrt/0008-ipq40xx-add-support-for-Aruba-AP-303.patch new file mode 100644 index 00000000..8b5fc9dd --- /dev/null +++ b/patches/openwrt/0008-ipq40xx-add-support-for-Aruba-AP-303.patch @@ -0,0 +1,646 @@ +From: David Bauer +Date: Wed, 23 Oct 2019 22:25:14 +0200 +Subject: ipq40xx: add support for Aruba AP-303 + +Hardware +-------- + +SoC: Qualcomm IPQ4029 +RAM: 512M DDR3 +FLASH: - 128MB NAND (Macronix MX30LF1G18AC) + - 4MB SPI-NOR (Macronix MX25R3235F) +TPM: Atmel AT97SC3203 +BLE: Texas Instruments CC2540T + attached to ttyMSM0 +ETH: Atheros AR8035 +LED: WiFi (amber / green) + System (red / green) +BTN: Reset + +To connect to the serial console, you can solder to the labled pads next +to the USB port or use your Aruba supplied UARt adapter. + +Do NOT plug a standard USB cable into the Console labled USB-port! +Aruba/HPE simply put UART on the micro-USB pins. You can solder yourself +an adapter cable: + +VCC - NC + D+ - TX + D- - RX +GND - GND + +The console setting in bootloader and OS is 9600 8N1. Voltage level is +3.3V. + +To enable a full list of commands in the U-Boot "help" command, execute +the literal "diag" command. + +Installation +------------ + +1. Get the OpenWrt initramfs image. Rename it to ipq40xx.ari and put it + into the TFTP server root directory. Configure the TFTP server to + be reachable at 192.168.1.75/24. Connect the machine running the TFTP + server to the ethernet port of the access point. + +2. Connect to the serial console. Interrupt autobooting by pressing + Enter when prompted. + +3. Configure the bootargs and bootcmd for OpenWrt. + $ setenv bootargs_openwrt "setenv bootargs console=ttyMSM1,9600n8" + $ setenv nandboot_openwrt "run bootargs_openwrt; ubi part aos1; + ubi read 0x85000000 kernel; bootm 0x85000000" + $ setenv ramboot_openwrt "run bootargs_openwrt; + setenv ipaddr 192.168.1.105; setenv serverip 192.168.1.75; + netget; set fdt_high 0x87000000; bootm" + $ setenv bootcmd "run nandboot_openwrt" + $ saveenv + +4. Load OpenWrt into RAM: + $ run ramboot_openwrt + +5. After OpenWrt booted, transfer the OpenWrt sysupgrade image to the + /tmp folder on the device. + +6. Flash OpenWrt: + $ ubidetach -p /dev/mtd1 + $ ubiformat /dev/mtd1 + $ sysupgrade -n /tmp/openwrt-sysupgrade.bin + +To go back to the stock firmware, simply reset the bootcmd in the +bootloader to the original value: + + $ setenv bootcmd "boot" + $ saveenv + +Signed-off-by: David Bauer +(cherry picked from commit 102c8c55f217606cdbdc9a449667e034676b3e75) + +diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network +index 01825b8bac46eec6325de00396d96307c946f975..49dd570242533068adf2c9df89e78560ba5f70eb 100755 +--- a/target/linux/ipq40xx/base-files/etc/board.d/02_network ++++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network +@@ -39,6 +39,7 @@ ipq40xx_setup_interfaces() + ucidef_add_switch "switch0" \ + "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan" + ;; ++ aruba,ap-303|\ + avm,fritzrepeater-1200|\ + engenius,eap1300|\ + meraki,mr33|\ +diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +index b0035ce8a394b6e87d7d89b9f55a6ec7c66e448e..15a2f2c09f8a92cc0accfbf9a977dbeb3355570d 100644 +--- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata ++++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +@@ -137,6 +137,10 @@ case "$FIRMWARE" in + qcom,ap-dk01.1-c1) + ath10kcal_extract "ART" 4096 12064 + ;; ++ aruba,ap-303) ++ ath10kcal_extract "ART" 4096 12064 ++ ath10kcal_patch_mac_crc $(mtd_get_mac_binary mfginfo 29) ++ ;; + asus,map-ac2200) + ath10kcal_ubi_extract "Factory" 4096 12064 + ;; +@@ -199,6 +203,10 @@ case "$FIRMWARE" in + qcom,ap-dk01.1-c1) + ath10kcal_extract "ART" 20480 12064 + ;; ++ aruba,ap-303) ++ ath10kcal_extract "ART" 20480 12064 ++ ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary mfginfo 29) +1) ++ ;; + asus,map-ac2200) + ath10kcal_ubi_extract "Factory" 20480 12064 + ;; +diff --git a/target/linux/ipq40xx/base-files/etc/inittab b/target/linux/ipq40xx/base-files/etc/inittab +index 809bba5e5ff49869429c91cf791cea73ab67d14e..3181021a0592720657b815c3eac803a57f4ea438 100644 +--- a/target/linux/ipq40xx/base-files/etc/inittab ++++ b/target/linux/ipq40xx/base-files/etc/inittab +@@ -2,3 +2,4 @@ + ::sysinit:/etc/init.d/rcS S boot + ::shutdown:/etc/init.d/rcS K shutdown + ttyMSM0::askfirst:/usr/libexec/login.sh ++ttyMSM1::askfirst:/usr/libexec/login.sh +diff --git a/target/linux/ipq40xx/base-files/lib/preinit/06_set_preinit_iface_ipq40xx.sh b/target/linux/ipq40xx/base-files/lib/preinit/06_set_preinit_iface_ipq40xx.sh +index be4b6322cb6a91f489dfec237ac6b79ce079e0eb..a0dec1042a3dd7416ece3307666c8ecf9d15d277 100644 +--- a/target/linux/ipq40xx/base-files/lib/preinit/06_set_preinit_iface_ipq40xx.sh ++++ b/target/linux/ipq40xx/base-files/lib/preinit/06_set_preinit_iface_ipq40xx.sh +@@ -4,6 +4,7 @@ set_preinit_iface() { + . /lib/functions.sh + + case $(board_name) in ++ aruba,ap-303| \ + asus,rt-ac58u| \ + avm,fritzbox-4040| \ + glinet,gl-b1300| \ +diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +index a7b7da1bf378f7cc19e960c497bc52efb3bae4fb..7253139497a8a8b9fab49cef3fce5eabe98d8002 100644 +--- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh ++++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +@@ -48,6 +48,7 @@ platform_do_upgrade() { + case "$(board_name)" in + 8dev,jalapeno |\ + alfa-network,ap120c-ac |\ ++ aruba,ap-303 |\ + avm,fritzbox-7530 |\ + avm,fritzrepeater-1200 |\ + avm,fritzrepeater-3000 |\ +diff --git a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4029-ap-303.dts b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4029-ap-303.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..7929494d027aca5c696910232a36d484f5ce6562 +--- /dev/null ++++ b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4029-ap-303.dts +@@ -0,0 +1,418 @@ ++// SPDX-License-Identifier: GPL-2.0 OR MIT ++ ++#include "qcom-ipq4019.dtsi" ++#include ++#include ++#include ++ ++/ { ++ model = "Aruba AP-303"; ++ compatible = "aruba,ap-303"; ++ ++ aliases { ++ led-boot = &led_system_green; ++ led-failsafe = &led_system_red; ++ led-running = &led_system_green; ++ led-upgrade = &led_system_red; ++ }; ++ ++ memory { ++ device_type = "memory"; ++ reg = <0x80000000 0x10000000>; ++ }; ++ ++ soc { ++ mdio@90000 { ++ status = "okay"; ++ pinctrl-0 = <&mdio_pins>; ++ pinctrl-names = "default"; ++ ++ /delete-node/ ethernet-phy@0; ++ /delete-node/ ethernet-phy@2; ++ /delete-node/ ethernet-phy@3; ++ /delete-node/ ethernet-phy@4; ++ ++ ethernet-phy@5 { ++ reg = <0x5>; ++ }; ++ }; ++ ++ counter@4a1000 { ++ compatible = "qcom,qca-gcnt"; ++ reg = <0x4a1000 0x4>; ++ }; ++ ++ ess_tcsr@1953000 { ++ compatible = "qcom,tcsr"; ++ reg = <0x1953000 0x1000>; ++ qcom,ess-interface-select = ; ++ }; ++ ++ tcsr@1949000 { ++ compatible = "qcom,tcsr"; ++ reg = <0x1949000 0x100>; ++ qcom,wifi_glb_cfg = ; ++ }; ++ ++ tcsr@1957000 { ++ compatible = "qcom,tcsr"; ++ reg = <0x1957000 0x100>; ++ qcom,wifi_noc_memtype_m0_m2 = ; ++ }; ++ ++ blsp1_uart2: serial@78b0000 { ++ }; ++ ++ crypto@8e3a000 { ++ status = "okay"; ++ }; ++ ++ watchdog@b017000 { ++ status = "okay"; ++ }; ++ ++ ess-switch@c000000 { ++ switch_mac_mode = <0x3>; /* mac mode for RGMII RMII */ ++ switch_lan_bmp = <0x0>; /* lan port bitmap */ ++ switch_wan_bmp = <0x10>; /* wan port bitmap */ ++ }; ++ ++ edma@c080000 { ++ qcom,single-phy; ++ qcom,num_gmac = <1>; ++ phy-mode = "rgmii-id"; ++ status = "okay"; ++ }; ++ ++ i2c_0: i2c@78b7000 { ++ pinctrl-0 = <&i2c_0_pins>; ++ pinctrl-names = "default"; ++ status = "ok"; ++ ++ tpm@29 { ++ /* No Driver */ ++ compatible = "atmel,at97sc3203"; ++ reg = <0x29>; ++ read-only; ++ }; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ wifi_green { ++ label = "ap-303:green:wifi"; ++ gpios = <&tlmm 39 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "phy0tpt"; ++ }; ++ ++ wifi_amber { ++ label = "ap-303:amber:wifi"; ++ gpios = <&tlmm 40 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "phy1tpt"; ++ }; ++ ++ led_system_red: system_red { ++ label = "ap-303:red:system"; ++ gpios = <&tlmm 46 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ led_system_green: system_green { ++ label = "ap-303:green:system"; ++ gpios = <&tlmm 47 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ ++ reset { ++ label = "Reset button"; ++ gpios = <&tlmm 50 GPIO_ACTIVE_LOW>; ++ linux,code = ; ++ }; ++ }; ++}; ++ ++&blsp_dma { ++ status = "okay"; ++}; ++ ++&blsp1_uart1 { ++ /* Texas Instruments CC2540T BLE radio */ ++ pinctrl-0 = <&serial_0_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++}; ++ ++&blsp1_uart2 { ++ pinctrl-0 = <&serial_1_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++}; ++ ++&cryptobam { ++ status = "okay"; ++}; ++ ++&gmac0 { ++ qcom,phy_mdio_addr = <5>; ++ qcom,poll_required = <1>; ++ vlan_tag = <0 0x20>; ++}; ++ ++&qpic_bam { ++ status = "okay"; ++}; ++ ++&tlmm { ++ /* ++ * In addition to the Pins listed below, ++ * the following GPIOs have "features": ++ * 54 - out - active low to force HW reset ++ * 41 - out - active low to reset TPM ++ * 43 - out - active low to reset BLE radio ++ * 19 - in - active high when DC powered ++ */ ++ mdio_pins: mdio_pinmux { ++ mux_1 { ++ pins = "gpio6"; ++ function = "mdio"; ++ bias-pull-up; ++ }; ++ mux_2 { ++ pins = "gpio7"; ++ function = "mdc"; ++ bias-pull-up; ++ }; ++ }; ++ ++ nand_pins: nand_pins { ++ pullups { ++ pins = "gpio53", "gpio58", "gpio59"; ++ function = "qpic"; ++ bias-pull-up; ++ }; ++ ++ pulldowns { ++ pins = "gpio54", "gpio55", "gpio56", ++ "gpio57", "gpio60", "gpio61", ++ "gpio62", "gpio63", "gpio64", ++ "gpio65", "gpio66", "gpio67", ++ "gpio68", "gpio69"; ++ function = "qpic"; ++ bias-pull-down; ++ }; ++ }; ++ ++ spi_0_pins: spi_0_pinmux { ++ pin { ++ function = "blsp_spi0"; ++ pins = "gpio13", "gpio14", "gpio15"; ++ drive-strength = <12>; ++ bias-disable; ++ }; ++ pin_cs { ++ function = "gpio"; ++ pins = "gpio12"; ++ drive-strength = <2>; ++ bias-disable; ++ output-high; ++ }; ++ }; ++ i2c_0_pins: i2c_0_pinmux { ++ mux { ++ pins = "gpio10", "gpio11"; ++ function = "blsp_i2c0"; ++ drive-strength = <4>; ++ bias-disable; ++ }; ++ }; ++ ++ serial_0_pins: serial_0_pinmux { ++ mux { ++ pins = "gpio16", "gpio17"; ++ function = "blsp_uart0"; ++ bias-disable; ++ }; ++ }; ++ ++ serial_1_pins: serial_1_pinmux { ++ mux { ++ pins = "gpio8", "gpio9"; ++ function = "blsp_uart1"; ++ bias-disable; ++ }; ++ }; ++ ++ phy-reset { ++ line-name = "PHY-reset"; ++ gpios = <42 GPIO_ACTIVE_HIGH>; ++ gpio-hog; ++ output-high; ++ }; ++}; ++ ++&nand { ++ pinctrl-0 = <&nand_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++ ++ nand@0 { ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ /* 'aos0' in Aruba firmware */ ++ label = "aos0"; ++ reg = <0x0 0x2000000>; ++ read-only; ++ }; ++ ++ partition@2000000 { ++ /* 'aos1' in AVM firmware */ ++ label = "ubi"; ++ reg = <0x2000000 0x2000000>; ++ }; ++ ++ partition@4000000 { ++ label = "aruba-ubifs"; ++ reg = <0x4000000 0x4000000>; ++ read-only; ++ }; ++ }; ++ }; ++}; ++ ++&blsp1_spi1 { ++ pinctrl-0 = <&spi_0_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++ cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>; ++ ++ flash@0 { ++ compatible = "jedec,spi-nor"; ++ reg = <0>; ++ spi-max-frequency = <24000000>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ /* ++ * There is no partition map for the NOR flash ++ * in the stock firmware. ++ * ++ * All partitions here are based on offsets ++ * found in the U-Boot GPL code and information ++ * from smem. ++ */ ++ ++ partition@0 { ++ label = "sbl1"; ++ reg = <0x0 0x40000>; ++ read-only; ++ }; ++ ++ partition@40000 { ++ label = "mibib"; ++ reg = <0x40000 0x20000>; ++ read-only; ++ }; ++ ++ partition@60000 { ++ label = "qsee"; ++ reg = <0x60000 0x60000>; ++ read-only; ++ }; ++ ++ partition@c0000 { ++ label = "cdt"; ++ reg = <0xc0000 0x10000>; ++ read-only; ++ }; ++ ++ partition@d0000 { ++ label = "ddrparams"; ++ reg = <0xd0000 0x10000>; ++ read-only; ++ }; ++ ++ partition@e0000 { ++ label = "ART"; ++ reg = <0xe0000 0x10000>; ++ read-only; ++ }; ++ ++ partition@f0000 { ++ label = "appsbl"; ++ reg = <0xf0000 0xf0000>; ++ read-only; ++ }; ++ ++ partition@1e0000 { ++ label = "mfginfo"; ++ reg = <0x1e0000 0x10000>; ++ read-only; ++ }; ++ ++ partition@1f0000 { ++ label = "apcd"; ++ reg = <0x1f0000 0x10000>; ++ read-only; ++ }; ++ ++ partition@200000 { ++ label = "osss"; ++ reg = <0x200000 0x180000>; ++ read-only; ++ }; ++ ++ partition@380000 { ++ /* This is empty */ ++ label = "appsblenv"; ++ reg = <0x380000 0x10000>; ++ read-only; ++ }; ++ ++ partition@390000 { ++ label = "pds"; ++ reg = <0x390000 0x10000>; ++ read-only; ++ }; ++ ++ partition@3a0000 { ++ label = "fcache"; ++ reg = <0x3a0000 0x10000>; ++ read-only; ++ }; ++ ++ partition@3b0000 { ++ /* Called osss1 in smem */ ++ label = "u-boot-env-bak"; ++ reg = <0x3b0000 0x10000>; ++ read-only; ++ }; ++ ++ partition@3f0000 { ++ label = "u-boot-env"; ++ reg = <0x3f0000 0x10000>; ++ read-only; ++ }; ++ }; ++ }; ++}; ++ ++&wifi0 { ++ status = "okay"; ++ qcom,ath10k-calibration-variant = "Aruba-AP-303"; ++}; ++ ++&wifi1 { ++ status = "okay"; ++ qcom,ath10k-calibration-variant = "Aruba-AP-303"; ++}; +diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile +index 98c81726d9c12bd466df2150c3e98a76cfb46f78..68dcbc59a42f6d8360b87c7b4e74cd34f697b465 100644 +--- a/target/linux/ipq40xx/image/Makefile ++++ b/target/linux/ipq40xx/image/Makefile +@@ -85,6 +85,15 @@ define Device/alfa-network_ap120c-ac + endef + TARGET_DEVICES += alfa-network_ap120c-ac + ++define Device/aruba_ap-303 ++ $(call Device/FitImageLzma) ++ DEVICE_TITLE := Aruba AP-303 ++ DEVICE_DTS := qcom-ipq4029-ap-303 ++ DEVICE_PACKAGES := ipq-wifi-aruba_ap-303 ++ IMAGES := sysupgrade.bin ++endef ++TARGET_DEVICES += aruba_ap-303 ++ + define Device/asus_map-ac2200 + $(call Device/FitImageLzma) + DEVICE_DTS := qcom-ipq4019-map-ac2200 +diff --git a/target/linux/ipq40xx/patches-4.14/304-mtd-spi-nor-Add-support-for-mx25r3235f.patch b/target/linux/ipq40xx/patches-4.14/304-mtd-spi-nor-Add-support-for-mx25r3235f.patch +new file mode 100644 +index 0000000000000000000000000000000000000000..d95923a1610d4764538e79bb783702903edcdcad +--- /dev/null ++++ b/target/linux/ipq40xx/patches-4.14/304-mtd-spi-nor-Add-support-for-mx25r3235f.patch +@@ -0,0 +1,26 @@ ++From 158acdbf0336f601971637f988b57a6a67a0869b Mon Sep 17 00:00:00 2001 ++From: David Bauer ++Date: Sun, 15 Dec 2019 13:10:50 +0100 ++Subject: [PATCH] mtd: spi-nor: Add support for mx25r3235f ++ ++Add MTD support for the Macronix MX25R3235F SPI NOR chip from Macronix. ++The chip has 4MB of total capacity, divided into a total of 64 sectors, ++each 64KB sized. The chip also supports 4KB large sectors. ++Additionally, it supports dual and quad read modes. ++ ++Signed-off-by: David Bauer ++--- ++ drivers/mtd/spi-nor/spi-nor.c | 2 ++ ++ 1 file changed, 2 insertions(+) ++ ++--- a/drivers/mtd/spi-nor/spi-nor.c +++++ b/drivers/mtd/spi-nor/spi-nor.c ++@@ -1024,6 +1024,8 @@ static const struct flash_info spi_nor_i ++ { "mx25l3205d", INFO(0xc22016, 0, 64 * 1024, 64, SECT_4K) }, ++ { "mx25l3255e", INFO(0xc29e16, 0, 64 * 1024, 64, SECT_4K) }, ++ { "mx25l6405d", INFO(0xc22017, 0, 64 * 1024, 128, SECT_4K) }, +++ { "mx25r3235f", INFO(0xc22816, 0, 64 * 1024, 64, +++ SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, ++ { "mx25u3235f", INFO(0xc22536, 0, 64 * 1024, 64, 0) }, ++ { "mx25u2033e", INFO(0xc22532, 0, 64 * 1024, 4, SECT_4K) }, ++ { "mx25u4035", INFO(0xc22533, 0, 64 * 1024, 8, SECT_4K) }, +diff --git a/target/linux/ipq40xx/patches-4.14/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-4.14/901-arm-boot-add-dts-files.patch +index f7efd415f1f1c000867793b3b133e44b3e50b0fd..fc8a88336491c2ac7c2a93fafb1f2b6fd38695be 100644 +--- a/target/linux/ipq40xx/patches-4.14/901-arm-boot-add-dts-files.patch ++++ b/target/linux/ipq40xx/patches-4.14/901-arm-boot-add-dts-files.patch +@@ -10,7 +10,7 @@ Signed-off-by: John Crispin + + --- a/arch/arm/boot/dts/Makefile + +++ b/arch/arm/boot/dts/Makefile +-@@ -697,7 +697,31 @@ dtb-$(CONFIG_ARCH_QCOM) += \ ++@@ -697,7 +697,32 @@ dtb-$(CONFIG_ARCH_QCOM) += \ + qcom-apq8074-dragonboard.dtb \ + qcom-apq8084-ifc6540.dtb \ + qcom-apq8084-mtp.dtb \ +@@ -37,6 +37,7 @@ Signed-off-by: John Crispin + + qcom-ipq4019-qxwlan-e2600ac-c1.dtb \ + + qcom-ipq4019-qxwlan-e2600ac-c2.dtb \ + + qcom-ipq4028-wpj428.dtb \ +++ qcom-ipq4029-ap-303.dtb \ + + qcom-ipq4029-gl-b1300.dtb \ + + qcom-ipq4029-mr33.dtb \ + qcom-ipq8064-ap148.dtb \ diff --git a/targets/ipq40xx-generic b/targets/ipq40xx-generic index f06e15f2..44864933 100644 --- a/targets/ipq40xx-generic +++ b/targets/ipq40xx-generic @@ -19,6 +19,13 @@ defaults { } +-- Aruba + +device('aruba-ap-303', 'aruba_ap-303', { + factory = false, +}) + + -- AVM device('avm-fritz-box-4040', 'avm_fritzbox-4040', { From b82686322df4d6c1c5f6306c706519b5a7d206e4 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sat, 4 Jan 2020 22:22:56 +0100 Subject: [PATCH 062/105] modules: bump OpenWrt f8543adb14 mt76: update to the latest openwrt-19.07 version bce5342fb6 mt76: fix incorrect firmware path --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index fe11f257..ad1b19ae 100644 --- a/modules +++ b/modules @@ -2,7 +2,7 @@ GLUON_FEEDS='packages routing gluon' OPENWRT_REPO=https://git.openwrt.org/openwrt/openwrt.git OPENWRT_BRANCH=openwrt-19.07 -OPENWRT_COMMIT=594f731e04f5442c94a4cfb57c7d46d7513fa9ce +OPENWRT_COMMIT=f8543adb149830a4549cf8691a02167e5d7cec95 PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git PACKAGES_PACKAGES_BRANCH=openwrt-19.07 From b6ec44d6affb853f9dc10c485f3cb23d64043b1e Mon Sep 17 00:00:00 2001 From: David Bauer Date: Thu, 2 Jan 2020 05:58:49 +0100 Subject: [PATCH 063/105] targets: remove ath10k-ct-smallbuffers Remove the ath10k-ct-smallbuffers variant from the default package-seleciton as it clashes with the QCA ath10k driver. --- targets/ar71xx-generic | 3 +++ targets/ath79-generic | 2 ++ targets/ipq40xx-generic | 2 ++ 3 files changed, 7 insertions(+) diff --git a/targets/ar71xx-generic b/targets/ar71xx-generic index fb69f3da..9f62917f 100644 --- a/targets/ar71xx-generic +++ b/targets/ar71xx-generic @@ -4,18 +4,21 @@ config 'CONFIG_TARGET_SQUASHFS_BLOCK_SIZE=64' local ATH10K_PACKAGES = { 'kmod-ath10k', '-kmod-ath10k-ct', + '-kmod-ath10k-ct-smallbuffers', 'ath10k-firmware-qca988x', '-ath10k-firmware-qca988x-ct', } local ATH10K_PACKAGES_QCA9887 = { 'kmod-ath10k', '-kmod-ath10k-ct', + '-kmod-ath10k-ct-smallbuffers', 'ath10k-firmware-qca9887', '-ath10k-firmware-qca9887-ct', } local ATH10K_PACKAGES_QCA9888 = { 'kmod-ath10k', '-kmod-ath10k-ct', + '-kmod-ath10k-ct-smallbuffers', 'ath10k-firmware-qca9888', '-ath10k-firmware-qca9888-ct', } diff --git a/targets/ath79-generic b/targets/ath79-generic index 75791cb0..60751389 100644 --- a/targets/ath79-generic +++ b/targets/ath79-generic @@ -1,6 +1,7 @@ local ATH10K_PACKAGES_QCA9880 = { 'kmod-ath10k', '-kmod-ath10k-ct', + '-kmod-ath10k-ct-smallbuffers', 'ath10k-firmware-qca988x', '-ath10k-firmware-qca988x-ct', } @@ -8,6 +9,7 @@ local ATH10K_PACKAGES_QCA9880 = { local ATH10K_PACKAGES_QCA9888 = { 'kmod-ath10k', '-kmod-ath10k-ct', + '-kmod-ath10k-ct-smallbuffers', 'ath10k-firmware-qca9888', '-ath10k-firmware-qca9888-ct', } diff --git a/targets/ipq40xx-generic b/targets/ipq40xx-generic index 44864933..a5f340a8 100644 --- a/targets/ipq40xx-generic +++ b/targets/ipq40xx-generic @@ -1,12 +1,14 @@ local ATH10K_PACKAGES_IPQ40XX = { 'kmod-ath10k', '-kmod-ath10k-ct', + '-kmod-ath10k-ct-smallbuffers', 'ath10k-firmware-qca4019', '-ath10k-firmware-qca4019-ct', } local ATH10K_PACKAGES_IPQ40XX_QCA9888 = { 'kmod-ath10k', '-kmod-ath10k-ct', + '-kmod-ath10k-ct-smallbuffers', 'ath10k-firmware-qca4019', '-ath10k-firmware-qca4019-ct', 'ath10k-firmware-qca9888', From 72e99aa2bac3a7b3c8ba2f76f67ea899c83583ba Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sun, 5 Jan 2020 14:32:57 +0100 Subject: [PATCH 064/105] ipq40xx-generic: add alias for Aruba Instant On AP11 The Aruba Instant On AP11 is the Aruba AP-303 with a stripped-down firmware. Add an alias for the device to remove confusion about the different naming. --- targets/ipq40xx-generic | 1 + 1 file changed, 1 insertion(+) diff --git a/targets/ipq40xx-generic b/targets/ipq40xx-generic index a5f340a8..8df11ea2 100644 --- a/targets/ipq40xx-generic +++ b/targets/ipq40xx-generic @@ -25,6 +25,7 @@ defaults { device('aruba-ap-303', 'aruba_ap-303', { factory = false, + aliases = {'aruba-instant-on-ap11'}, }) From c3435607e1c771003286fffcaa8e9446cee17709 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sun, 5 Jan 2020 15:34:52 +0100 Subject: [PATCH 065/105] generic: increase RootFS size when GLUON_DEBUG is enabled This increases the size of the root filesystem when GLUON_DEBUG is enabled. Otherwise, the filesystem is too small. Closes #1907 --- targets/generic | 1 + 1 file changed, 1 insertion(+) diff --git a/targets/generic b/targets/generic index 0153386d..9d87ba4e 100644 --- a/targets/generic +++ b/targets/generic @@ -54,6 +54,7 @@ end if envtrue.GLUON_DEBUG then config 'CONFIG_DEBUG=y' config 'CONFIG_NO_STRIP=y' + config 'CONFIG_TARGET_ROOTFS_PARTSIZE=500' config '# CONFIG_USE_STRIP is not set' config '# CONFIG_USE_SSTRIP is not set' end From 0e1cc743d77412738754d476fdd1c5183800c95b Mon Sep 17 00:00:00 2001 From: Dark4MD Date: Sat, 4 Jan 2020 22:39:00 +0100 Subject: [PATCH 066/105] ramips-mt7620: remove broken flag for Xiaomi MiWifi Mini WiFi driver is stable now. --- docs/user/supported_devices.rst | 4 ++++ targets/ramips-mt7620 | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index 508d6f5a..c781e616 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -300,6 +300,10 @@ ramips-mt7620 - WT3020AD/F/H +# Xiaomi + + - MiWiFi Mini + ramips-mt7621 ------------- diff --git a/targets/ramips-mt7620 b/targets/ramips-mt7620 index 8aa005f1..7236657b 100644 --- a/targets/ramips-mt7620 +++ b/targets/ramips-mt7620 @@ -36,5 +36,4 @@ device('nexx-wt3020-8m', 'wt3020-8M', { device('xiaomi-miwifi-mini', 'miwifi-mini', { factory = false, - broken = true, -- 2.4GHz WiFi is unstable }) From 351f46a7dbe55b475afb6791b26b6b37d1f53165 Mon Sep 17 00:00:00 2001 From: Andreas Ziegler Date: Sun, 29 Dec 2019 16:08:56 +0100 Subject: [PATCH 067/105] docs: add v2019.1.1 release notes (cherry picked from commit c612dfbabb0a42eeefbd2c26e3b7e6abdbdfb2cb) --- docs/index.rst | 1 + docs/releases/v2019.1.1.rst | 62 +++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 docs/releases/v2019.1.1.rst diff --git a/docs/index.rst b/docs/index.rst index 3052a6fe..037679ae 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -74,6 +74,7 @@ Several Freifunk communities in Germany use Gluon as the foundation of their Fre :caption: Releases :maxdepth: 1 + releases/v2019.1.1 releases/v2019.1 releases/v2018.2.4 releases/v2018.2.3 diff --git a/docs/releases/v2019.1.1.rst b/docs/releases/v2019.1.1.rst new file mode 100644 index 00000000..0385e8bf --- /dev/null +++ b/docs/releases/v2019.1.1.rst @@ -0,0 +1,62 @@ +Gluon 2019.1.1 +############## + +Bugfixes +******** + +* Fixes device alias for Ubiquiti UniFi AC LR. (`#1834 `_) + Autoupdates on this model were impossible before, since we were missing the proper device alias. + +* Add correct ath10k firmware package for OCEDO Koala. (`#1838 `_) + +* Fixes various batman-adv bugs with backports from 2019.4 and 2019.5 by updating the openwrt-routing packages feed. + +* Fixes node role list. (`#1851 `_) + With Gluon v2019.1 it became impossible to change the role of a node via the config mode. + +Other Changes +************* + +* Linux kernel has been updated to either + + - 4.9.207 (ar71xx, brcm2708, mpc85xx) or + - 4.14.160 (ipq40xx, ipq806x, mvebu, ramips, sunxi, x86). + +Known issues +************ + +* Out of memory situations with high client count on ath9k. + (`#1768 `_) + +* The integration of the BATMAN_V routing algorithm is incomplete. + + - | Mesh neighbors don't appear on the status page. (`#1726 `_) + | Many tools have the BATMAN_IV metric hardcoded, these need to be updated to account for the new throughput + | metric. + + - | Throughput values are not correctly acquired for different interface types. + | (`#1728 `_) + | This affects virtual interface types like bridges and VXLAN. + +* Default TX power on many Ubiquiti devices is too high, correct offsets are unknown + (`#94 `_) + + Reducing the TX power in the Advanced Settings is recommended. + +* The MAC address of the WAN interface is modified even when Mesh-on-WAN is disabled + (`#496 `_) + + This may lead to issues in environments where a fixed MAC address is expected (like VMware when promiscuous mode is + disallowed). + +* Inconsistent respondd API (`#522 `_) + + The current API is inconsistent and will be replaced eventually. The old API will still be supported for a while. + +* Frequent reboots due to out-of-memory or high load due to memory pressure on weak hardware especially in larger + meshes (`#1243 `_) + + Optimizations in Gluon 2018.1 have significantly improved memory usage. + There are still known bugs leading to unreasonably high load that we hope to + solve in future releases. + From 726ac5b87699a061cacd7e3def4dd75d0501b9ba Mon Sep 17 00:00:00 2001 From: Andreas Ziegler Date: Sun, 29 Dec 2019 16:09:15 +0100 Subject: [PATCH 068/105] docs, README: Gluon v2019.1.1 (cherry picked from commit 239c379d066b73dfc84c60ff57ed5e37a1af30c6) --- README.md | 2 +- docs/site-example/site.conf | 2 +- docs/user/getting_started.rst | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4917e82d..4052a913 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ the future development of Gluon. Please refrain from using the `master` branch for anything else but development purposes! Use the most recent release instead. You can list all releases by running `git tag` -and switch to one by running `git checkout v2019.1 && make update`. +and switch to one by running `git checkout v2019.1.1 && make update`. If you're using the autoupdater, do not autoupdate nodes with anything but releases. If you upgrade using random master commits the nodes *will break* eventually. diff --git a/docs/site-example/site.conf b/docs/site-example/site.conf index 2b9c9584..32aa4e20 100644 --- a/docs/site-example/site.conf +++ b/docs/site-example/site.conf @@ -1,4 +1,4 @@ --- This is an example site configuration for Gluon v2019.1 +-- This is an example site configuration for Gluon v2019.1.1 -- -- Take a look at the documentation located at -- https://gluon.readthedocs.io/ for details. diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index 95c4407a..9313e791 100644 --- a/docs/user/getting_started.rst +++ b/docs/user/getting_started.rst @@ -8,7 +8,7 @@ Gluon's releases are managed using `Git tags`_. If you are just getting started with Gluon we recommend to use the latest stable release of Gluon. Take a look at the `list of gluon releases`_ and notice the latest release, -e.g. *v2019.1*. Always get Gluon using git and don't try to download it +e.g. *v2019.1.1*. Always get Gluon using git and don't try to download it as a Zip archive as the archive will be missing version information. Please keep in mind that there is no "default Gluon" build; a site configuration @@ -44,7 +44,7 @@ Building the images ------------------- To build Gluon, first check out the repository. Replace *RELEASE* with the -version you'd like to checkout, e.g. *v2019.1*. +version you'd like to checkout, e.g. *v2019.1.1*. :: From bc5707340d53b0999805e61e1df68a31773a27e1 Mon Sep 17 00:00:00 2001 From: "Manu.WTF" <43337106+Dark4MD@users.noreply.github.com> Date: Tue, 7 Jan 2020 00:03:08 +0100 Subject: [PATCH 069/105] docs: supported_devices: fix small typo Just saw a small typo i made in the Xiaomi Mi Wifi Mini PR. This PR Corrects this. --- docs/user/supported_devices.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index c781e616..b80f75d0 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -300,7 +300,7 @@ ramips-mt7620 - WT3020AD/F/H -# Xiaomi +* Xiaomi - MiWiFi Mini From 13f16ed73765fbaeeafd89d033647e018674298e Mon Sep 17 00:00:00 2001 From: Dark4MD Date: Mon, 6 Jan 2020 00:02:44 +0100 Subject: [PATCH 070/105] ramips-mt7620: add support for TP-Link Archer C2 v1 --- docs/user/supported_devices.rst | 4 ++++ .../gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac | 2 +- targets/ramips-mt7620 | 7 +++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index b80f75d0..72691397 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -300,6 +300,10 @@ ramips-mt7620 - WT3020AD/F/H +* TP-Link + + - Archer C2 v1 + * Xiaomi - MiWiFi Mini diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac b/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac index 5520a81a..8fd6872f 100755 --- a/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac +++ b/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac @@ -61,7 +61,7 @@ elseif platform.match('mpc85xx', 'p1020', {'aerohive,hiveap-330'}) then table.insert(try_files, 1, '/sys/class/net/eth0/address') elseif platform.match('mpc85xx', 'p1020', {'ocedo,panda'}) then table.insert(try_files, 1, '/sys/class/net/eth1/address') -elseif platform.match('ramips', 'mt7620', {'miwifi-mini'}) then +elseif platform.match('ramips', 'mt7620', {'miwifi-mini', 'tplink,c2-v1'}) then table.insert(try_files, 1, '/sys/class/net/eth0/address') elseif platform.match('ramips', 'mt7621', {'dir-860l-b1'}) then table.insert(try_files, 1, '/sys/class/ieee80211/phy1/macaddress') diff --git a/targets/ramips-mt7620 b/targets/ramips-mt7620 index 7236657b..9872bdd8 100644 --- a/targets/ramips-mt7620 +++ b/targets/ramips-mt7620 @@ -32,6 +32,13 @@ device('nexx-wt3020-8m', 'wt3020-8M', { }) +-- TP-Link + +device('tp-link-archer-c2-v1', 'tplink_c2-v1', { + factory = false, +}) + + -- Xiaomi device('xiaomi-miwifi-mini', 'miwifi-mini', { From 19e0f7959efb897daf205a691c627f3332015e74 Mon Sep 17 00:00:00 2001 From: Dark4MD Date: Thu, 7 Nov 2019 09:58:28 +0100 Subject: [PATCH 071/105] ramips-mt7620: add support for TP-Link Archer C50 v1 --- docs/user/supported_devices.rst | 1 + .../gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac | 2 +- targets/ramips-mt7620 | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index 72691397..60fac6f1 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -303,6 +303,7 @@ ramips-mt7620 * TP-Link - Archer C2 v1 + - Archer C50 v1 * Xiaomi diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac b/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac index 8fd6872f..1f5c7a88 100755 --- a/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac +++ b/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac @@ -61,7 +61,7 @@ elseif platform.match('mpc85xx', 'p1020', {'aerohive,hiveap-330'}) then table.insert(try_files, 1, '/sys/class/net/eth0/address') elseif platform.match('mpc85xx', 'p1020', {'ocedo,panda'}) then table.insert(try_files, 1, '/sys/class/net/eth1/address') -elseif platform.match('ramips', 'mt7620', {'miwifi-mini', 'tplink,c2-v1'}) then +elseif platform.match('ramips', 'mt7620', {'miwifi-mini', 'tplink,c2-v1', 'c50'}) then table.insert(try_files, 1, '/sys/class/net/eth0/address') elseif platform.match('ramips', 'mt7621', {'dir-860l-b1'}) then table.insert(try_files, 1, '/sys/class/ieee80211/phy1/macaddress') diff --git a/targets/ramips-mt7620 b/targets/ramips-mt7620 index 9872bdd8..860193e5 100644 --- a/targets/ramips-mt7620 +++ b/targets/ramips-mt7620 @@ -34,10 +34,19 @@ device('nexx-wt3020-8m', 'wt3020-8M', { -- TP-Link +local tplink_region_suffix = '' +if (env.GLUON_REGION or '') ~= '' then + tplink_region_suffix = '-' .. env.GLUON_REGION +end + device('tp-link-archer-c2-v1', 'tplink_c2-v1', { factory = false, }) +device('tp-link-archer-c50', 'ArcherC50v1', { + factory = '-squashfs-factory' .. tplink_region_suffix, +}) + -- Xiaomi From 74bdf79be019c6f33bbebffb3f3dcb3611adbe64 Mon Sep 17 00:00:00 2001 From: lemoer Date: Thu, 9 Jan 2020 21:02:00 +0100 Subject: [PATCH 072/105] gluon-neighbour-info: use default port 1001 and default dest ::1 --- package/gluon-neighbour-info/src/gluon-neighbour-info.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package/gluon-neighbour-info/src/gluon-neighbour-info.c b/package/gluon-neighbour-info/src/gluon-neighbour-info.c index 24237bfe..6e255d87 100644 --- a/package/gluon-neighbour-info/src/gluon-neighbour-info.c +++ b/package/gluon-neighbour-info/src/gluon-neighbour-info.c @@ -37,8 +37,8 @@ void usage() { puts("Usage: gluon-neighbour-info [-h] [-s] [-l] [-c ] [-t ] -d -p -i -r "); - puts(" -p UDP port"); - puts(" -d destination address (unicast ip6 or multicast group, e.g. ff02:0:0:0:0:0:2:1001)"); + puts(" -p UDP port (default: 1001)"); + puts(" -d destination address (unicast ip6 or multicast group, e.g. ff02:0:0:0:0:0:2:1001, default: ::1)"); puts(" -i interface, e.g. eth0 "); puts(" -r request, e.g. nodeinfo"); puts(" -t timeout in seconds (default: 3)"); @@ -144,6 +144,8 @@ int main(int argc, char **argv) { exit(EXIT_FAILURE); } + client_addr.sin6_addr = in6addr_loopback; + client_addr.sin6_port = htons(1001); client_addr.sin6_family = AF_INET6; opterr = 0; From c1ed71096452817ea63fafb71cac68e76f33e833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20F=C3=B6rster?= Date: Sun, 17 Mar 2019 14:49:57 +0100 Subject: [PATCH 073/105] ramips-mt76x8: add support for TP-Link TL-WR902AC v3 TP-Link TL-WR902AC v3 is a pocket-size dual-band (AC750) router based on MediaTek MT7628N + MT7650E. Specification: - MediaTek MT7628N/N (580 Mhz) - 64 MB of RAM - 8 MB of FLASH - 2T2R 2.4 GHz and 1T1R 5 GHz - 1x 10/100 Mbps Ethernet --- docs/user/supported_devices.rst | 1 + targets/ramips-mt76x8 | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index 60fac6f1..a6547799 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -350,6 +350,7 @@ ramips-mt76x8 - TL-MR3420 v5 - TL-WR841N v13 + - TL-WR902AC v3 - Archer C50 v3 - Archer C50 v4 diff --git a/targets/ramips-mt76x8 b/targets/ramips-mt76x8 index 4c2f8fed..6ccbd6fd 100644 --- a/targets/ramips-mt76x8 +++ b/targets/ramips-mt76x8 @@ -43,6 +43,12 @@ device('tp-link-tl-wr841n-v13', 'tl-wr841n-v13', { }, }) +device('tp-link-tl-wr902ac-v3', 'tplink_tl-wr902ac-v3', { + factory = false, + extra_images = { + {'-squashfs-tftp-recovery', '-bootloader', '.bin'}, + }, +}) -- VoCore 2 From fbb59cfd608a124ca893cc58117b0f87f7b29d97 Mon Sep 17 00:00:00 2001 From: Dark4MD Date: Wed, 8 Jan 2020 00:31:19 +0100 Subject: [PATCH 074/105] ramips-mt7620: add support for TP-Link Archer C20i --- docs/user/supported_devices.rst | 1 + package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac | 2 +- targets/ramips-mt7620 | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index a6547799..c42824cd 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -303,6 +303,7 @@ ramips-mt7620 * TP-Link - Archer C2 v1 + - Archer C20i - Archer C50 v1 * Xiaomi diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac b/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac index 1f5c7a88..20ec1949 100755 --- a/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac +++ b/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac @@ -61,7 +61,7 @@ elseif platform.match('mpc85xx', 'p1020', {'aerohive,hiveap-330'}) then table.insert(try_files, 1, '/sys/class/net/eth0/address') elseif platform.match('mpc85xx', 'p1020', {'ocedo,panda'}) then table.insert(try_files, 1, '/sys/class/net/eth1/address') -elseif platform.match('ramips', 'mt7620', {'miwifi-mini', 'tplink,c2-v1', 'c50'}) then +elseif platform.match('ramips', 'mt7620', {'miwifi-mini', 'tplink,c2-v1', 'c20i', 'c50'}) then table.insert(try_files, 1, '/sys/class/net/eth0/address') elseif platform.match('ramips', 'mt7621', {'dir-860l-b1'}) then table.insert(try_files, 1, '/sys/class/ieee80211/phy1/macaddress') diff --git a/targets/ramips-mt7620 b/targets/ramips-mt7620 index 860193e5..74bf2e52 100644 --- a/targets/ramips-mt7620 +++ b/targets/ramips-mt7620 @@ -43,6 +43,8 @@ device('tp-link-archer-c2-v1', 'tplink_c2-v1', { factory = false, }) +device('tp-link-archer-c20i', 'ArcherC20i') + device('tp-link-archer-c50', 'ArcherC50v1', { factory = '-squashfs-factory' .. tplink_region_suffix, }) From 7220c596618cf4c06ba8472a99ed4c769f431db5 Mon Sep 17 00:00:00 2001 From: Ruben Barkow-Kuder Date: Sun, 12 Jan 2020 17:36:02 +0100 Subject: [PATCH 075/105] docs: gluon-radv-filterd: enhance documentation with example (#1900) --- docs/package/gluon-radv-filterd.rst | 33 ++++++++++++++++------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/docs/package/gluon-radv-filterd.rst b/docs/package/gluon-radv-filterd.rst index 509599d0..7b07ff9c 100644 --- a/docs/package/gluon-radv-filterd.rst +++ b/docs/package/gluon-radv-filterd.rst @@ -13,29 +13,32 @@ Selected router The router selection mechanism is independent from the batman-adv gateway mode. In contrast, the device originating the router advertisement could be any router or client connected to the mesh, as radv-filterd captures all router -advertisements originating from it. All nodes announcing router advertisement +advertisements originating from it. All nodes announcing router advertisement **with** a default lifetime greater than 0 are being considered as candidates. In case a router is not a batman-adv originator itself, its TQ is defined by the originator it is connected to. This lookup uses the batman-adv global translation table. -Initially the router is the selected by choosing the candidate with the -strongest TQ. When another candidate can provide a better TQ metric it is not -picked up as the selected router until it will outperform the currently -selected router by X metric units. The hysteresis threshold is configurable -and prevents excessive flapping of the gateway. +Initially the router is selected by choosing the candidate with the strongest +TQ. When another candidate can provide a better TQ metric, that outperforms the +currently selected router by X metric units, it will be picked as the new +selected router. The hysteresis threshold is configurable and prevents excessive +flapping of the gateway. -"Local" routers ---------------- +Local routers +------------- -The package has functionality to select "local" routers, i.e. those connected -via cable or WLAN instead of via the mesh (technically: appearing in the -``transtable_local``), a fake TQ of 512 so that they are always preferred. -However, if used together with the :doc:`gluon-ebtables-filter-ra-dhcp` -package, these router advertisements are filtered anyway and reach neither the -node nor any other client. You currently have to disable the package or insert -custom ebtables rules in order to use local routers. +Local routers (i.e. local internet gateways connected to some nodes) that are +connected to the client interface via cable or WLAN instead of via the mesh +(technically: appearing in the transtable_local) are taken into account with a +fake TQ of 512, so that they are always preferred. + +Be aware of problems if you plan to use local routers together with the +:doc:`gluon-ebtables-filter-ra-dhcp` package. These router advertisements are +filtered anyway and reach neither the node nor any other client. Therefore the +use of local routers is not possible as long as the package +``gluon-radv-filterd`` is used. respondd module --------------- From 0b6b2be4feca17e1dcce459f0499de79163e2c74 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Fri, 17 Jan 2020 20:52:49 +0100 Subject: [PATCH 076/105] modules: bump OpenWrt e18c87ef45 ramips: fix wps leds/btn for TP-Link TL-WA801ND v5 455ba76bf9 hostapd: cleanup IBSS-RSN dd4d49dcc1 cryptodev-linux: remove DEFAULT redefinition 44b37774f9 mac80211: fix a page refcounting issue leading to leaks/crashes in rx A-MSDU decap a3b6ffe01b mac80211: fix sta TID stats leak on a few nl80211 calls 25e1afb9e1 ucert: update to version 2019-12-19 fe197b8b09 ramips: mt7621: disable images for gehua_ghl-r-001 08d9828b76 ramips: fix leds for TP-Link Archer C20 v4 fd28ef59db ath79: add SUPPORTED_DEVICES for TP-Link TL-WR841N/ND v9 to v12 7a0d9b2eea ath79: add support for TP-Link TL-WR841N/ND v12 bd3eb071fd ath79: add support for TP-Link TL-WR841N/ND v10 19ff3f5105 ath79: add support for the TP-LINK CPE220 V3 44c827215d ethtool: fix PKG_CONFIG_DEPENDS eb15634541 OpenWrt v19.07.0: revert to branch defaults aca39acedf OpenWrt v19.07.0: adjust config defaults a3ffeb413b ramips: Fix sysupgrade for Xiaomi mir3g f58705b77e dnsmasq: Fix potential dnsmasq crash with TCP 54711e528d x86: fix missing led variable warning during boot abb0665bec ca-certificates: provide ca-certs by both ca-certificates and ca-bundle e9929ebeea ramips: Fix sysupgrade for Xiaomi mir3g dc399c4e12 ramips: remove duplicate dts nodes of MediaTek LinkIt Smart 7688 a5653ec87e package: remove accidentally added symlink 6395ac4126 fstools: update to latest Git HEAD f3439c4019 procd: update to version 2020-01-04 64c45d95d6 ubus: update to version 2019-12-27 04fd5e22b2 libubox: update to version 2019-12-28 bf99f79200 base-files: sysupgrade: exit if the firmware download failed 3140d38042 base-files: upgrade: add case to export_bootdevice 3c11032039 sunxi: Turn on CONFIG_PINCTRL_SUN4I_A10 for A20 3fc47dd443 wolfssl: bump to 4.3.0-stable 330046922b kernel: bump 4.14 to 4.14.162 084dfb8ebd kernel: bump 4.14 to 4.14.161 Compile-tested: ath79-generic Run-tested: ath79-generic --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index ad1b19ae..916de127 100644 --- a/modules +++ b/modules @@ -2,7 +2,7 @@ GLUON_FEEDS='packages routing gluon' OPENWRT_REPO=https://git.openwrt.org/openwrt/openwrt.git OPENWRT_BRANCH=openwrt-19.07 -OPENWRT_COMMIT=f8543adb149830a4549cf8691a02167e5d7cec95 +OPENWRT_COMMIT=e18c87ef45e0ce0e14a96c3a27e3f43ce5d23556 PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git PACKAGES_PACKAGES_BRANCH=openwrt-19.07 From c30a022e9489feef24932750631c1f6f4e5bfb05 Mon Sep 17 00:00:00 2001 From: Jan Alexander Date: Tue, 14 Jan 2020 15:52:03 +0100 Subject: [PATCH 077/105] ramips-mt76x8: add support for TP-Link TL-WA801ND v5 --- docs/user/supported_devices.rst | 3 ++- targets/ramips-mt76x8 | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index c42824cd..5bb41682 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -300,7 +300,7 @@ ramips-mt7620 - WT3020AD/F/H -* TP-Link +* TP-Link - Archer C2 v1 - Archer C20i @@ -350,6 +350,7 @@ ramips-mt76x8 * TP-Link - TL-MR3420 v5 + - TL-WA801ND v5 - TL-WR841N v13 - TL-WR902AC v3 - Archer C50 v3 diff --git a/targets/ramips-mt76x8 b/targets/ramips-mt76x8 index 6ccbd6fd..6aba5dca 100644 --- a/targets/ramips-mt76x8 +++ b/targets/ramips-mt76x8 @@ -36,6 +36,13 @@ device('tp-link-tl-mr3420-v5', 'tplink_tl-mr3420-v5', { }, }) +device('tp-link-tl-wa801nd-v5', 'tplink_tl-wa801nd-v5', { + factory = false, + extra_images = { + {'-squashfs-tftp-recovery', '-bootloader', '.bin'}, + }, +}) + device('tp-link-tl-wr841n-v13', 'tl-wr841n-v13', { factory = false, extra_images = { From b25a05eec4cc17c5421db479bd1878fcaa42068b Mon Sep 17 00:00:00 2001 From: lemoer Date: Sat, 18 Jan 2020 19:32:00 +0100 Subject: [PATCH 078/105] contrib/ci: add build dependency versioning (#1915) --- contrib/ci/Jenkinsfile | 12 +++++++++++- contrib/ci/jenkins-community-slave/README.md | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/contrib/ci/Jenkinsfile b/contrib/ci/Jenkinsfile index 443d78ef..112dd128 100644 --- a/contrib/ci/Jenkinsfile +++ b/contrib/ci/Jenkinsfile @@ -15,7 +15,7 @@ pipeline { } } stage('lint-sh') { - agent { label 'gluon-docker' } + agent { label 'gluon-docker-v1' } steps { sh 'make lint-sh' } @@ -38,3 +38,13 @@ pipeline { } } } + +# api-history: +# +# Every time the build dependencies of gluon change, the version +# every container has to be rebuilt. Therefore, we use Jenkins +# labels which intoduce a version number which is documented here. +# As soon, as you properly rebuilt your docker container, you +# can notify lemoer, that you have updated your node. +# +# - gluon-docker-v1: add shellcheck binary to the build environment diff --git a/contrib/ci/jenkins-community-slave/README.md b/contrib/ci/jenkins-community-slave/README.md index aebc78e8..7d049133 100644 --- a/contrib/ci/jenkins-community-slave/README.md +++ b/contrib/ci/jenkins-community-slave/README.md @@ -26,7 +26,7 @@ docker run --detach --restart always \ - Your node should appear [here](https://build.ffh.zone/label/gluon-docker/). - When clicking on it, Jenkins should state "Agent is connected." like here: ![Screenshot from 2019-09-24 01-00-52](https://user-images.githubusercontent.com/601153/65469209-dac6c180-de66-11e9-9d62-0d1c3b6b940b.png) -5. **Your docker container needs to be rebuilt, when the build dependencies of gluon change. So please be aware of that and update your docker container in that case.** +5. **Your docker container needs to be rebuilt, when the build dependencies of gluon change. As soon as build dependencies have changed, the build dependency api level has to be raised.** After you rebuilt your docker container, notifiy @lemoer, so he can bump the versioning number. ## Backoff - If @lemoer is not reachable, please be patient at first if possible. Otherwise contact info@hannover.freifunk.net or join the channel `#freifunkh` on hackint. From 055a2337aa21a91a6ca1729f9b0542142ff39730 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 18 Jan 2020 19:52:50 +0100 Subject: [PATCH 079/105] contrib/ci: fix commenting in Jenkinsfile (#1919) --- contrib/ci/Jenkinsfile | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/contrib/ci/Jenkinsfile b/contrib/ci/Jenkinsfile index 112dd128..4a4cbc4c 100644 --- a/contrib/ci/Jenkinsfile +++ b/contrib/ci/Jenkinsfile @@ -39,12 +39,14 @@ pipeline { } } -# api-history: -# -# Every time the build dependencies of gluon change, the version -# every container has to be rebuilt. Therefore, we use Jenkins -# labels which intoduce a version number which is documented here. -# As soon, as you properly rebuilt your docker container, you -# can notify lemoer, that you have updated your node. -# -# - gluon-docker-v1: add shellcheck binary to the build environment +/* + api-history: + + Every time the build dependencies of gluon change, the version + every container has to be rebuilt. Therefore, we use Jenkins + labels which intoduce a version number which is documented here. + As soon, as you properly rebuilt your docker container, you + can notify lemoer, that you have updated your node. + + - gluon-docker-v1: add shellcheck binary to the build environment +*/ From 79ca7a7baaefe926c571c6d5901cdee29e7fdd48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20F=C3=B6rster?= Date: Mon, 20 Jan 2020 23:26:04 +0100 Subject: [PATCH 080/105] ramips-mt7620: add support for tp-link archer c20 v1 (#1866) Specification: - MediaTek MT7620A (580 Mhz) - 64 MB of RAM - 8 MB of FLASH - 2T2R 2.4 GHz and 1T1R 5 GHz - 5x 10/100 Mbps Ethernet - 2x external, non-detachable antennas - UART (J1) header on PCB (115200 8n1) - 8x LED (GPIO-controlled*), 2x button, power input switch - 1 x USB 2.0 port --- docs/user/supported_devices.rst | 1 + package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac | 2 +- targets/ramips-mt7620 | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index 5bb41682..89191e35 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -303,6 +303,7 @@ ramips-mt7620 * TP-Link - Archer C2 v1 + - Archer C20 (v1) - Archer C20i - Archer C50 v1 diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac b/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac index 20ec1949..f4ad37a9 100755 --- a/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac +++ b/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac @@ -61,7 +61,7 @@ elseif platform.match('mpc85xx', 'p1020', {'aerohive,hiveap-330'}) then table.insert(try_files, 1, '/sys/class/net/eth0/address') elseif platform.match('mpc85xx', 'p1020', {'ocedo,panda'}) then table.insert(try_files, 1, '/sys/class/net/eth1/address') -elseif platform.match('ramips', 'mt7620', {'miwifi-mini', 'tplink,c2-v1', 'c20i', 'c50'}) then +elseif platform.match('ramips', 'mt7620', {'miwifi-mini', 'tplink,c2-v1', 'c20-v1', 'c20i', 'c50'}) then table.insert(try_files, 1, '/sys/class/net/eth0/address') elseif platform.match('ramips', 'mt7621', {'dir-860l-b1'}) then table.insert(try_files, 1, '/sys/class/ieee80211/phy1/macaddress') diff --git a/targets/ramips-mt7620 b/targets/ramips-mt7620 index 74bf2e52..6b24084f 100644 --- a/targets/ramips-mt7620 +++ b/targets/ramips-mt7620 @@ -31,7 +31,6 @@ device('nexx-wt3020-8m', 'wt3020-8M', { }, }) - -- TP-Link local tplink_region_suffix = '' @@ -43,6 +42,8 @@ device('tp-link-archer-c2-v1', 'tplink_c2-v1', { factory = false, }) +device('tp-link-archer-c20-v1', 'tplink_c20-v1') + device('tp-link-archer-c20i', 'ArcherC20i') device('tp-link-archer-c50', 'ArcherC50v1', { From b01327b5d6b47e1699bede9688c12dfd87a1fe34 Mon Sep 17 00:00:00 2001 From: Nudelsalat Date: Mon, 20 Jan 2020 18:33:28 +0100 Subject: [PATCH 081/105] ramips-mt7621: add support for Netgear EX6150 --- docs/user/supported_devices.rst | 1 + targets/ramips-mt7621 | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index 89191e35..521cd0ec 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -324,6 +324,7 @@ ramips-mt7621 * NETGEAR + - EX6150 - R6220 * Ubiquiti diff --git a/targets/ramips-mt7621 b/targets/ramips-mt7621 index 196022b0..9b3ddf86 100644 --- a/targets/ramips-mt7621 +++ b/targets/ramips-mt7621 @@ -12,6 +12,10 @@ device('d-link-dir-860l-b1', 'dir-860l-b1') -- Netgear +device('netgear-ex6150', 'netgear_ex6150', { + factory_ext = '.chk', +}) + device('netgear-r6220', 'r6220', { factory_ext = '.img', }) From a0926f64bb1b8f2cf2e6bf6f8eefe112631e87f9 Mon Sep 17 00:00:00 2001 From: Andreas Ziegler Date: Tue, 28 Jan 2020 01:04:18 +0100 Subject: [PATCH 082/105] docs: supported devices: clarify version numbers of Netgear EX61x0 --- docs/user/supported_devices.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index 521cd0ec..c163bf5a 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -225,8 +225,8 @@ ipq40xx-generic * NETGEAR - - EX6100v2 - - EX6150v2 + - EX6100 (v2) + - EX6150 (v2) * OpenMesh @@ -324,7 +324,7 @@ ramips-mt7621 * NETGEAR - - EX6150 + - EX6150 (v1) - R6220 * Ubiquiti From 8315a279bde51a71fd95e747f890c7129d084166 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Wed, 29 Jan 2020 20:39:09 +0100 Subject: [PATCH 083/105] modules: bump OpenWrt a229907150 ramips: remove duplicate DEVICE_PACKAGES for TP-Link Archer C20i 4668ae3bed OpenWrt v19.07.1: revert to branch defaults 901bbe2ab9 OpenWrt v19.07.1: adjust config defaults c155900f66 opkg: update to latest Git HEAD 8ab2b42fac kernel: fix dst reference leak in flow offload 47935940d6 ath79: fix SUPPORTED_DEVICES not matching ar71xx board names da5b5ae9b9 ath79: remove SUPPORTED_DEVICES for TP-Link Archer D50 v1 f84981f6f8 mac80211: Update to version 4.19.98 3212290a3b lantiq: ltq-ptm: vr9: fix skb handling in ptm_hard_start_xmit() 6ee0138a6c mbedtls: update to 2.16.4 1c5ac590c4 kernel: bump 4.14 to 4.14.167 8038846b62 procd: update to version 2020-01-24 4e91c4e156 ramips: mt7621: ubnt-erx: allow sysupgrade from master 4a58a871c4 hostapd: fix faulty WMM IE parameters with ETSI regulatory domains abaf329dad tools: tplink-safeloader: update soft_ver for TP-Link Archer C6 v2 (EU) 177c9ed4b0 uboot-envtools: ath79: add support for glinet,gl-ar150 a1502b0443 uboot-envtools: ar71xx: add support for gl-ar150/-domino/-mifi b6675c2b2e ar71xx: change u-boot-env to read-write for gl-ar150/-domino/mifi eed8f30b98 urngd: update to version 2020-01-21 1636e99e80 urngd: update to latest Git head 1b4b4e3fae ar71xx: ubnt-rocket-m-ti: fix RSSI LED definitions c1245ebc96 brcm47xx: fix switch port order for Netgear WN2500RP V1 f638ef4325 kirkwood: fix HDD LED labels for Zyxel NSA325 in 01_leds d3c2547cf1 brcm47xx: fix switch port order for Netgear WNR3500 V2 f6ab1f1566 ramips: rt305x: remove unnecessary mediatek,portmap 1d56a7b75d ramips: mt76x8: fix bogus mediatek,portmap 49b240cde8 ramips: fix portmap for TP-Link Archer C50 v4 d3eabe44d0 ramips: mt7620/mt7621: remove invalid mediatek,portmap 67595ce380 ramips: add factory image for Netgear R6350 9c6913ccad ramips: add mt7615e support to Netgear R6350 f8902d1ae6 libubox: update to version 2020-01-20 5ca066a5c2 fstools: backport fix from version 2020-01-18 ae953449f2 kernel: bump 4.14 to 4.14.166 945db9fb01 kernel: bump 4.14 to 4.14.165 9298c443df kernel: bump 4.14 to 4.14.164 d46b00cf0f ramips: fix HiWiFi HC5962 status LED 03c35bda03 ramips: fix HiWiFi HC5962 switch configuration a885f7d3d0 ramips: add kmod-mt7615e to Xiaomi Mi Router 3 Pro images 67c8e586c8 ar71xx/mikrotik: use ath10k-ct-smallbuffers for 64 MiB devices Compile-tested: ramips-mt76x8 Runtime-tested: ramips-mt76x8 --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 916de127..03bf5cca 100644 --- a/modules +++ b/modules @@ -2,7 +2,7 @@ GLUON_FEEDS='packages routing gluon' OPENWRT_REPO=https://git.openwrt.org/openwrt/openwrt.git OPENWRT_BRANCH=openwrt-19.07 -OPENWRT_COMMIT=e18c87ef45e0ce0e14a96c3a27e3f43ce5d23556 +OPENWRT_COMMIT=a229907150e01d8c32293cc0a48630e7c4f0cb00 PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git PACKAGES_PACKAGES_BRANCH=openwrt-19.07 From 7ee910e1b5f298217c713b3bc60877a06daa8441 Mon Sep 17 00:00:00 2001 From: Jan Alexander Date: Fri, 31 Jan 2020 19:04:09 +0100 Subject: [PATCH 084/105] modules: bump OpenWrt aed6632d31 ramips: use tpt DTS trigger for TP-Link TL-MR3020 v3 and TL-WA801ND v5 Compile-tested: ramips-mt76x8 Runtime-tested: ramips-mt76x8 --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 03bf5cca..ef5997c4 100644 --- a/modules +++ b/modules @@ -2,7 +2,7 @@ GLUON_FEEDS='packages routing gluon' OPENWRT_REPO=https://git.openwrt.org/openwrt/openwrt.git OPENWRT_BRANCH=openwrt-19.07 -OPENWRT_COMMIT=a229907150e01d8c32293cc0a48630e7c4f0cb00 +OPENWRT_COMMIT=aed6632d31ff5d29045dc904dedc840d902aad97 PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git PACKAGES_PACKAGES_BRANCH=openwrt-19.07 From 9741fb316d05f2080b3a42cf8b3b0e204b337a22 Mon Sep 17 00:00:00 2001 From: Jan Alexander Date: Fri, 31 Jan 2020 19:05:04 +0100 Subject: [PATCH 085/105] ramips-mt76x8: add support for TP-Link TL-MR3020 v3 --- docs/user/supported_devices.rst | 1 + targets/ramips-mt76x8 | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index c163bf5a..fb7d2319 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -351,6 +351,7 @@ ramips-mt76x8 * TP-Link + - TL-MR3020 v3 - TL-MR3420 v5 - TL-WA801ND v5 - TL-WR841N v13 diff --git a/targets/ramips-mt76x8 b/targets/ramips-mt76x8 index 6aba5dca..c1e0354f 100644 --- a/targets/ramips-mt76x8 +++ b/targets/ramips-mt76x8 @@ -29,6 +29,13 @@ device('tp-link-archer-c50-v4', 'tplink_c50-v4', { factory = false, }) +device('tp-link-tl-mr3020-v3', 'tplink_tl-mr3020-v3', { + factory = false, + extra_images = { + {'-squashfs-tftp-recovery', '-bootloader', '.bin'}, + }, +}) + device('tp-link-tl-mr3420-v5', 'tplink_tl-mr3420-v5', { factory = false, extra_images = { From 255c0045e7801db7262a7b1e33623077e67c99b4 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Fri, 31 Jan 2020 22:53:59 +0100 Subject: [PATCH 086/105] docs supported-devices: fix alphabetical order --- docs/user/supported_devices.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index fb7d2319..cfd3f5f6 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -351,13 +351,13 @@ ramips-mt76x8 * TP-Link + - Archer C50 v3 + - Archer C50 v4 - TL-MR3020 v3 - TL-MR3420 v5 - TL-WA801ND v5 - TL-WR841N v13 - TL-WR902AC v3 - - Archer C50 v3 - - Archer C50 v4 * VoCore From 0e832c175c05272de5ed7bb94ef2fea8b088ed91 Mon Sep 17 00:00:00 2001 From: Andreas Ziegler Date: Wed, 29 Jan 2020 00:47:43 +0100 Subject: [PATCH 087/105] ath79-generic: add support for GL.iNet GL-AR300M-Lite --- docs/user/supported_devices.rst | 6 +++++- targets/ath79-generic | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index cfd3f5f6..1d3e1152 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -192,7 +192,11 @@ ath79-generic - WiFi pro 1750i - WiFi pro 1750x - * OCEDO +* GL.iNet + + - GL-AR300M-Lite + +* OCEDO - Raccoon diff --git a/targets/ath79-generic b/targets/ath79-generic index 60751389..7caf6578 100644 --- a/targets/ath79-generic +++ b/targets/ath79-generic @@ -46,6 +46,12 @@ device('devolo-wifi-pro-1750x', 'devolo_dvl1750x', { factory = false, }) +-- GL.iNet + +device('gl.inet-gl-ar300m-lite', 'glinet_gl-ar300m-lite', { + factory = false, +}) + -- OCEDO device('ocedo-raccoon', 'ocedo_raccoon', { From 390884819c40baffcb94ebcb4f99845daf7e1487 Mon Sep 17 00:00:00 2001 From: Andreas Ziegler Date: Fri, 31 Jan 2020 19:42:12 +0100 Subject: [PATCH 088/105] docs: rename vendor to GL.iNet for uniformity --- docs/user/supported_devices.rst | 8 ++++---- targets/ar71xx-generic | 2 +- targets/ramips-mt7620 | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index 1d3e1152..49e8d90b 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -37,13 +37,13 @@ ar71xx-generic - DIR-505 (A1, A2) - DIR-825 (B1) -* GL Innovations +* GL.iNet - GL-AR150 - GL-AR300M - GL-AR750 - - GL-iNet 6408A (v1) - - GL-iNet 6416A (v1) + - GL.iNet 6408A (v1) + - GL.iNet 6416A (v1) * Linksys @@ -294,7 +294,7 @@ mpc85xx-p1020 ramips-mt7620 ------------- -* GL Innovations +* GL.iNet - GL-MT300A - GL-MT300N diff --git a/targets/ar71xx-generic b/targets/ar71xx-generic index 9f62917f..497a00e5 100644 --- a/targets/ar71xx-generic +++ b/targets/ar71xx-generic @@ -102,7 +102,7 @@ device('d-link-dir-825-rev-b1', 'dir-825-b1', { }) --- GL Innovations +-- GL.iNet device('gl-inet-6408a-v1', 'gl-inet-6408A-v1') diff --git a/targets/ramips-mt7620 b/targets/ramips-mt7620 index 6b24084f..9dd6a2d9 100644 --- a/targets/ramips-mt7620 +++ b/targets/ramips-mt7620 @@ -6,7 +6,7 @@ device('asus-rt-ac51u', 'rt-ac51u', { }) --- GL Innovations +-- GL.iNet device('gl-mt300a', 'gl-mt300a', { factory = false, From 9a75e2c05b9cdd64b81dab334c1ec8d89f951c7c Mon Sep 17 00:00:00 2001 From: Andreas Ziegler Date: Sun, 2 Feb 2020 00:26:44 +0100 Subject: [PATCH 089/105] docs: GL.iNet 64xx: remove vendor and version - vendor name should not be part of model name - there's no other version, hence mentioning the version is superfluous --- docs/user/supported_devices.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst index 49e8d90b..3c23eda0 100644 --- a/docs/user/supported_devices.rst +++ b/docs/user/supported_devices.rst @@ -39,11 +39,11 @@ ar71xx-generic * GL.iNet + - 6408A + - 6416A - GL-AR150 - GL-AR300M - GL-AR750 - - GL.iNet 6408A (v1) - - GL.iNet 6416A (v1) * Linksys From 40ec99764189d0ae0133c884b31845b681febe89 Mon Sep 17 00:00:00 2001 From: "Manu.WTF" <43337106+Dark4MD@users.noreply.github.com> Date: Sun, 2 Feb 2020 20:41:55 +0100 Subject: [PATCH 090/105] brcm2708-bcm2710: add manifest_alias for raspberry-pi-3-model-b-rev-1.2 --- targets/brcm2708-bcm2710 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/targets/brcm2708-bcm2710 b/targets/brcm2708-bcm2710 index c0133f52..fc647365 100644 --- a/targets/brcm2708-bcm2710 +++ b/targets/brcm2708-bcm2710 @@ -1,3 +1,7 @@ include 'brcm2708.inc' -device('raspberry-pi-3', 'rpi-3') +device('raspberry-pi-3', 'rpi-3', { + manifest_aliases = { + 'raspberry-pi-3-model-b-rev-1.2', + }, +}) From ba276dcfbd8f6d64e9571a9d4e681b6913a239fc Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 20 Nov 2019 22:54:58 +0100 Subject: [PATCH 091/105] docs: add a note that hopglass-server needs an update to work with the new respondd address --- docs/releases/v2019.1.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/releases/v2019.1.rst b/docs/releases/v2019.1.rst index 9c1ce60b..a9e0a829 100644 --- a/docs/releases/v2019.1.rst +++ b/docs/releases/v2019.1.rst @@ -15,6 +15,7 @@ possible. With Gluon v2019.1, nodes will not answer respondd queries on ``[ff02::2:1001]:1001`` anymore. Respondd querier setups still using this address must be updated to the new address ``[ff05::2:1001]:1001`` (supported since Gluon v2017.1). This change was required due to cross-domain leakage of respondd data. +If you are using hopglass-server to query respondd data, you need to update it to at least commit f0e2c0a5. If you are upgrading from a version prior to v2018.1, please note that the flash layout on some devices (TP-Link CPE/WBS 210/510) was changed. To avoid upgrade failures, make sure to upgrade From af21f912b2421797b6ca4284dc75d5e9a242166b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 4 Feb 2020 02:04:36 +0100 Subject: [PATCH 092/105] generic: fix GLUON_DEBUG on targets without configurable rootfs size Fixes: c3435607e1c7 ("generic: increase RootFS size when GLUON_DEBUG is enabled") --- targets/generic | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/targets/generic b/targets/generic index 9d87ba4e..65982ef4 100644 --- a/targets/generic +++ b/targets/generic @@ -54,9 +54,10 @@ end if envtrue.GLUON_DEBUG then config 'CONFIG_DEBUG=y' config 'CONFIG_NO_STRIP=y' - config 'CONFIG_TARGET_ROOTFS_PARTSIZE=500' config '# CONFIG_USE_STRIP is not set' config '# CONFIG_USE_SSTRIP is not set' + + try_config 'CONFIG_TARGET_ROOTFS_PARTSIZE=500' end From 2f3714e3551c8c065dfa168082a0c4b440ff61eb Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sun, 2 Feb 2020 14:16:47 +0100 Subject: [PATCH 093/105] docs: add v2019.1.2 release notes (cherry picked from commit f1f188f804edb7fae607e21a62a750167ec52089) --- docs/index.rst | 1 + docs/releases/v2019.1.2.rst | 58 +++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 docs/releases/v2019.1.2.rst diff --git a/docs/index.rst b/docs/index.rst index 037679ae..bfaf6735 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -74,6 +74,7 @@ Several Freifunk communities in Germany use Gluon as the foundation of their Fre :caption: Releases :maxdepth: 1 + releases/v2019.1.2 releases/v2019.1.1 releases/v2019.1 releases/v2018.2.4 diff --git a/docs/releases/v2019.1.2.rst b/docs/releases/v2019.1.2.rst new file mode 100644 index 00000000..7d44fd49 --- /dev/null +++ b/docs/releases/v2019.1.2.rst @@ -0,0 +1,58 @@ +Gluon 2019.1.2 +############## + +Bugfixes +******** + +* Fixes a buffer-overflow vulnerability in libubox, a core component of OpenWrt + (CVE-2020-7248) + +* Fixes a vulnerability in the OpenWrt package manager (opkg). By using this vulnerability, + an attacker could bypass the integrity check of the package artifacts. (CVE-2020-7982) + +Other Changes +************* + +* Linux kernel has been updated to either + + - 4.9.211 (ar71xx, brcm2708, mpc85xx) or + - 4.14.167 (ipq40xx, ipq806x, mvebu, ramips, sunxi, x86). + +Known issues +************ + +* Out of memory situations with high client count on ath9k. + (`#1768 `_) + +* The integration of the BATMAN_V routing algorithm is incomplete. + + - | Mesh neighbors don't appear on the status page. (`#1726 `_) + | Many tools have the BATMAN_IV metric hardcoded, these need to be updated to account for the new throughput + | metric. + + - | Throughput values are not correctly acquired for different interface types. + | (`#1728 `_) + | This affects virtual interface types like bridges and VXLAN. + +* Default TX power on many Ubiquiti devices is too high, correct offsets are unknown + (`#94 `_) + + Reducing the TX power in the Advanced Settings is recommended. + +* The MAC address of the WAN interface is modified even when Mesh-on-WAN is disabled + (`#496 `_) + + This may lead to issues in environments where a fixed MAC address is expected (like VMware when promiscuous mode is + disallowed). + +* Inconsistent respondd API (`#522 `_) + + The current API is inconsistent and will be replaced eventually. The old API will still be supported for a while. + +* Frequent reboots due to out-of-memory or high load due to memory pressure on weak hardware especially in larger + meshes (`#1243 `_) + + Optimizations in Gluon 2018.1 have significantly improved memory usage. + There are still known bugs leading to unreasonably high load that we hope to + solve in future releases. + From 78e5ece527bc6569484a5833c0bbaa0c9919789f Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sun, 2 Feb 2020 14:20:06 +0100 Subject: [PATCH 094/105] docs readme: Gluon v2019.1.2 (cherry picked from commit 63ebeb25c0b3a7eec4c70efc92dfcfa760dd85b6) --- README.md | 2 +- docs/site-example/site.conf | 2 +- docs/user/getting_started.rst | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4052a913..94e65740 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ the future development of Gluon. Please refrain from using the `master` branch for anything else but development purposes! Use the most recent release instead. You can list all releases by running `git tag` -and switch to one by running `git checkout v2019.1.1 && make update`. +and switch to one by running `git checkout v2019.1.2 && make update`. If you're using the autoupdater, do not autoupdate nodes with anything but releases. If you upgrade using random master commits the nodes *will break* eventually. diff --git a/docs/site-example/site.conf b/docs/site-example/site.conf index 32aa4e20..f1592178 100644 --- a/docs/site-example/site.conf +++ b/docs/site-example/site.conf @@ -1,4 +1,4 @@ --- This is an example site configuration for Gluon v2019.1.1 +-- This is an example site configuration for Gluon v2019.1.2 -- -- Take a look at the documentation located at -- https://gluon.readthedocs.io/ for details. diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index 9313e791..01ff8a69 100644 --- a/docs/user/getting_started.rst +++ b/docs/user/getting_started.rst @@ -8,7 +8,7 @@ Gluon's releases are managed using `Git tags`_. If you are just getting started with Gluon we recommend to use the latest stable release of Gluon. Take a look at the `list of gluon releases`_ and notice the latest release, -e.g. *v2019.1.1*. Always get Gluon using git and don't try to download it +e.g. *v2019.1.2*. Always get Gluon using git and don't try to download it as a Zip archive as the archive will be missing version information. Please keep in mind that there is no "default Gluon" build; a site configuration @@ -44,7 +44,7 @@ Building the images ------------------- To build Gluon, first check out the repository. Replace *RELEASE* with the -version you'd like to checkout, e.g. *v2019.1.1*. +version you'd like to checkout, e.g. *v2019.1.2*. :: From df0e3526dcdeb9a0f0682d5e1c148325e7636389 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 4 Feb 2020 23:21:51 +0100 Subject: [PATCH 095/105] modules: update Gluon packages 12e41d0ff07e libplatforminfo: brcm2708: use board_name instead of model for image name 033401c18ecb mmfd: bump version 7cdfb66ece7b l3roamd: bump version 85af24315855 autoupdater: Fixed segfault on wrong long option --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index ef5997c4..833bcb97 100644 --- a/modules +++ b/modules @@ -13,4 +13,4 @@ PACKAGES_ROUTING_BRANCH=openwrt-19.07 PACKAGES_ROUTING_COMMIT=8d5ee29f088e9dfaa49dc74573edb1919f14dbf4 PACKAGES_GLUON_REPO=https://github.com/freifunk-gluon/packages.git -PACKAGES_GLUON_COMMIT=208d9ccd14ba21cf077c928e59dc4e39e71f3068 +PACKAGES_GLUON_COMMIT=12e41d0ff07ec54bbd67a31ab50d12ca04f2238c From 0af45b70f936eb5e309b8135c49e753218cf2199 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 4 Feb 2020 23:59:16 +0100 Subject: [PATCH 096/105] brcm2708: update image names and manifest aliases for new libplatforminfo --- targets/brcm2708-bcm2708 | 6 +++++- targets/brcm2708-bcm2709 | 3 ++- targets/brcm2708-bcm2710 | 5 ++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/targets/brcm2708-bcm2708 b/targets/brcm2708-bcm2708 index 15ebd193..4d4068ab 100644 --- a/targets/brcm2708-bcm2708 +++ b/targets/brcm2708-bcm2708 @@ -1,7 +1,11 @@ include 'brcm2708.inc' -device('raspberry-pi', 'rpi', { +device('raspberrypi-model-b', 'rpi', { manifest_aliases = { + 'raspberrypi-model-b-plus', + 'raspberrypi-model-b-rev2', + + -- from Gluon 2019.1 and older 'raspberry-pi-model-b-rev-2', 'raspberry-pi-model-b-plus-rev-1.2', }, diff --git a/targets/brcm2708-bcm2709 b/targets/brcm2708-bcm2709 index e0fbf0cd..e5af9c89 100644 --- a/targets/brcm2708-bcm2709 +++ b/targets/brcm2708-bcm2709 @@ -1,7 +1,8 @@ include 'brcm2708.inc' -device('raspberry-pi-2', 'rpi-2', { +device('raspberrypi-2-model-b', 'rpi-2', { manifest_aliases = { + -- from Gluon 2019.1 and older 'raspberry-pi-2-model-b-rev-1.1', }, }) diff --git a/targets/brcm2708-bcm2710 b/targets/brcm2708-bcm2710 index fc647365..1cf9ef36 100644 --- a/targets/brcm2708-bcm2710 +++ b/targets/brcm2708-bcm2710 @@ -1,7 +1,10 @@ include 'brcm2708.inc' -device('raspberry-pi-3', 'rpi-3', { +device('raspberrypi-3-model-b', 'rpi-3', { manifest_aliases = { + 'raspberrypi-3-model-b-plus', + + -- from Gluon 2019.1 and older 'raspberry-pi-3-model-b-rev-1.2', }, }) From a8134ecb40c7981ecf2b651ad70867bda881a614 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 10 Feb 2020 15:43:10 +0100 Subject: [PATCH 097/105] Revert "docs: features/multidomain.rst: use gluon-reload instead of reboot (#1888)" This reverts commit 4e070312f982f182cff21dda824914815b7cf9e6. The recommendation is not sufficient at this time, so revert it. See #1898 for further discussion. --- docs/features/multidomain.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/multidomain.rst b/docs/features/multidomain.rst index cf61ba05..1f9a729e 100644 --- a/docs/features/multidomain.rst +++ b/docs/features/multidomain.rst @@ -94,7 +94,7 @@ Switching the domain uci set gluon.core.domain="newdomaincode" gluon-reconfigure - gluon-reload + reboot **via config mode:** From d6c9ab1a81c54abb5b13114ca2a02e2fd5fc4b8b Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 10 Feb 2020 16:39:42 +0100 Subject: [PATCH 098/105] docs: add v2020.1 release notes --- docs/index.rst | 1 + docs/releases/v2020.1.rst | 191 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 192 insertions(+) create mode 100644 docs/releases/v2020.1.rst diff --git a/docs/index.rst b/docs/index.rst index bfaf6735..261b4f52 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -74,6 +74,7 @@ Several Freifunk communities in Germany use Gluon as the foundation of their Fre :caption: Releases :maxdepth: 1 + releases/v2020.1 releases/v2019.1.2 releases/v2019.1.1 releases/v2019.1 diff --git a/docs/releases/v2020.1.rst b/docs/releases/v2020.1.rst new file mode 100644 index 00000000..9fc8566e --- /dev/null +++ b/docs/releases/v2020.1.rst @@ -0,0 +1,191 @@ +Gluon 2020.1 +============ + +This is the first release of Gluon in 2020, based on OpenWrt 19.07. It +introduces the ath79 target, which will replace ar71xx in the short +term. + +Added hardware support +---------------------- + +ath79-generic +~~~~~~~~~~~~~ + +- devolo WiFi pro 1200e +- devolo WiFi pro 1200i +- devolo WiFi pro 1750c +- devolo WiFi pro 1750e +- devolo WiFi pro 1750i +- devolo WiFi pro 1750x +- GL.iNet GL-AR300M-Lite +- OCEDO Raccoon +- TP-Link Archer C6 v2 + +ipq40xx-generic +~~~~~~~~~~~~~~~ + +- Aruba AP-303 +- Aruba Instant On AP11 +- AVM FRITZ!Repeater 1200 + +ipq806x-generic +~~~~~~~~~~~~~~~ + +- Netgear R7800 + +lantiq-xway +~~~~~~~~~~~ + +- AVM FRITZ!Box 7312 +- AVM FRITZ!Box 7320 +- AVM FRITZ!Box 7330 +- AVM FRITZ!Box 7330 SL + +lantiq-xrx200 +~~~~~~~~~~~~~ + +- AVM FRITZ!Box 7360 (v1, v2) +- AVM FRITZ!Box 7360 SL +- AVM FRITZ!Box 7362 SL +- AVM FRITZ!Box 7412 + +mpc85xx-p1020 +~~~~~~~~~~~~~ + +- Enterasys WS-AP3710i +- OCEDO Panda + +ramips-mt7620 +~~~~~~~~~~~~~ + +- TP-Link Archer C2 (v1) +- TP-Link Archer C20 (v1) +- TP-Link Archer C20i +- TP-Link Archer C50 (v1) +- Xiaomi MiWifi Mini + +ramips-mt7621 +~~~~~~~~~~~~~ + +- Netgear EX6150 (v1) +- Netgear R6220 + +ramips-mt76x8 +~~~~~~~~~~~~~ + +- GL.iNet VIXMINI +- TP-Link TL-MR3020 (v3) +- TP-Link TL-WA801ND (v5) +- TP-Link TL-WR902AC (v3) + +Removed hardware support +------------------------ + +- ALFA Network Hornet-UB [#kernelpartition_too_small]_ +- ALFA Network Tube2H [#kernelpartition_too_small]_ +- ALFA Network N2 [#kernelpartition_too_small]_ +- ALFA Network N5 [#kernelpartition_too_small]_ + +.. [#kernelpartition_too_small] + The kernel partition on this device is too small to build a working image. + +Major changes +------------- + +OpenWrt 19.07 +~~~~~~~~~~~~~ + +Gluon v2020.1 is the first release to use OpenWrt 19.07. All targets +therefore use Linux 4.14.166. + +batman-adv compat v14 removal +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Support for the long deprecated compat 14 version of batman-adv has been +dropped. Communities still using this version should migrate to batman-adv +using the scheduled domain switch. + +IBSS wireless mesh removal +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Support for the IBSS wireless protocol has been dropped. Communities +still using IBSS are suggested to migrate to 802.11s using the scheduled +domain switch. + +Performance enhancements +~~~~~~~~~~~~~~~~~~~~~~~~ + +We install zram-swap by default on ``ar71xx`` devices with 8MB of flash +and 32MB of RAM. + +Renamed targets +~~~~~~~~~~~~~~~ + +- The ``ipq40xx`` target was renamed to ``ipq40xx-generic``. +- The ``ipq806x`` target was renamed to ``ipq806x-generic``. + +Status Page +~~~~~~~~~~~ + +- Gateway nexthop information has been added to the statuspage when batman-adv + is used. This includes its MAC address and prettyname as well as the interface + name towards the selected gateway. +- The site name has been added to the statuspage. If the node is in a multidomain + setup it will also show the domain name. + +DECT button to enter config mode +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Many AVM devices don't feature a separate RESET/WPS button, therefore +starting this release we support entering the config mode via DECT buttons. + +X86 partition size +~~~~~~~~~~~~~~~~~~ + +The x86 partition size has been reduced to fit on disks with a capacity of 128 MB. + +Bugfixes +-------- + +Autoupdater aliases +~~~~~~~~~~~~~~~~~~~ + +We have added several new aliases for autoupdater compatibility on +the following devices: + +- Ubiquiti UniFi AC LR +- Raspberry Pi + +Site changes +------------ + +site.mk +~~~~~~~ + +- The ``GLUON_WLAN_MESH`` variable can be dropped, as 802.11s is + the only supported wireless transport from now on. + +Internals +--------- + +Linting Targets +~~~~~~~~~~~~~~~ + +Support for linter make targets was added. + +- ``make lint`` +- ``make lint-sh`` to only check shell scripts +- ``make lint-lua`` to only check lua scripts + +These require the shellcheck and luacheck tools. The docker image has +been updated accordingly. + +Continuous integration +~~~~~~~~~~~~~~~~~~~~~~ + +We have implemented continuous integration testing using Jenkins and thereby +ensure that all lua and shell scripts are linted, that the documentation +still builds and warnings are highlighted, and that Gluon still +compiles, by testing a build on the ``x86_64`` target. We expect this to +significantly improve the feedback cycle and quality of contributions. + From f83d6764424910bd2a154d80c0d7cda4d52ba382 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 10 Feb 2020 16:40:14 +0100 Subject: [PATCH 099/105] docs, README: Gluon v2020.1 --- README.md | 2 +- docs/conf.py | 4 ++-- docs/site-example/site.conf | 2 +- docs/user/getting_started.rst | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 94e65740..676d580b 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ the future development of Gluon. Please refrain from using the `master` branch for anything else but development purposes! Use the most recent release instead. You can list all releases by running `git tag` -and switch to one by running `git checkout v2019.1.2 && make update`. +and switch to one by running `git checkout v2020.1 && make update`. If you're using the autoupdater, do not autoupdate nodes with anything but releases. If you upgrade using random master commits the nodes *will break* eventually. diff --git a/docs/conf.py b/docs/conf.py index bbc9fa70..4f7e5191 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,11 +20,11 @@ # -- Project information ----------------------------------------------------- project = 'Gluon' -copyright = '2015-2019, Project Gluon' +copyright = '2015-2020, Project Gluon' author = 'Project Gluon' # The short X.Y version -version = '2019.1+' +version = '2020.1+' # The full version, including alpha/beta/rc tags release = version diff --git a/docs/site-example/site.conf b/docs/site-example/site.conf index f1592178..405daca3 100644 --- a/docs/site-example/site.conf +++ b/docs/site-example/site.conf @@ -1,4 +1,4 @@ --- This is an example site configuration for Gluon v2019.1.2 +-- This is an example site configuration for Gluon v2020.1 -- -- Take a look at the documentation located at -- https://gluon.readthedocs.io/ for details. diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index 01ff8a69..36eac715 100644 --- a/docs/user/getting_started.rst +++ b/docs/user/getting_started.rst @@ -8,7 +8,7 @@ Gluon's releases are managed using `Git tags`_. If you are just getting started with Gluon we recommend to use the latest stable release of Gluon. Take a look at the `list of gluon releases`_ and notice the latest release, -e.g. *v2019.1.2*. Always get Gluon using git and don't try to download it +e.g. *v2020.1*. Always get Gluon using git and don't try to download it as a Zip archive as the archive will be missing version information. Please keep in mind that there is no "default Gluon" build; a site configuration @@ -44,7 +44,7 @@ Building the images ------------------- To build Gluon, first check out the repository. Replace *RELEASE* with the -version you'd like to checkout, e.g. *v2019.1.2*. +version you'd like to checkout, e.g. *v2020.1*. :: From ed91ec97c86b5071afcce81d96f98ea23324568e Mon Sep 17 00:00:00 2001 From: Andreas Ziegler Date: Thu, 20 Feb 2020 02:03:37 +0100 Subject: [PATCH 100/105] docs: minor grammar fix fixes #1935 found by @lrnzo --- docs/user/getting_started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index 36eac715..57996a56 100644 --- a/docs/user/getting_started.rst +++ b/docs/user/getting_started.rst @@ -120,7 +120,7 @@ There are two levels of `make clean`:: make clean GLUON_TARGET=ar71xx-generic -will ensure all packages are rebuilt for a single target. This normally not +will ensure all packages are rebuilt for a single target. This is usually not necessary, but may fix certain kinds of build failures. :: From 1191fda363c7bab02c80ff7bbe699352685ac1d1 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 1 Mar 2020 13:12:40 +0100 Subject: [PATCH 101/105] modules: update OpenWrt c56ed72d2b OpenWrt v19.07.2: revert to branch defaults 33732f4a9c OpenWrt v19.07.2: adjust config defaults 65030d81f3 libubox: update to latest Git HEAD b33cfb7eb2 ath79: add missing reset-gpios for NanoStation Loco M (XW) 4edadfb997 ath79: add support for Ubiquiti NanoStation Loco M (XW) cf118077cd ppp: backport security fixes 0e9e5b1553 Revert "ppp: backport security fixes" 9e2a1af62f uhttpd: update to latest Git HEAD af79c3bccc kernel: bump 4.14 to 4.14.171 bc0ca20ca9 ipq806x: fix bug in L2 cache scaling 191822b59f ipq806x: add missing core1 voltage tolerance d0c8875faf ath79: ar934x: use reset for usb-phy-analog c9b6bb43ce ath79: phy-ar7200-usb: adapt old behavior of arch/mips/ath79/dev-usb.c b2660e67f0 Revert "ath79: add support for Ubiquiti NanoStation Loco M (XW)" 21bf718b8c ath79: add support for Ubiquiti NanoStation Loco M (XW) 2d3a93335a ramips: append tail to WF2881 initramfs image 8fa6107aee ath79: add support for Ubiquiti Picostation M (XM) 6a950afde1 ath79: add support for Ubiquiti Nanostation Loco M (XM) 7cbd39421e ath79: add gpio4 pinmux on TL-WR841N/ND v8, WR842N v2, MR3420 v2 085f38351f ath79: enable forceless sysupgrade from ar71xx on fritz300e 6b7eeb74db ppp: backport security fixes 95d5cbdec3 ath79: add wmac migration for all ar93xx/qca95xx SoCs 2d21357b65 ath79: ar93xx/qca95xx: move gmac/wmac/pcie node out of apb bus b6c01fec92 hostapd: remove erroneous $(space) redefinition 5000fc53a1 ath79: fix DTS node names for Ubiquiti XW partitions a0ca72d9ab uboot-envtools: ath79: add Netgear WNDR3700v2 53cd2299ee ath79: WNDR3700 v1/v2: make u-boot env partition writable cff3795450 bcm53xx: build images for Luxul ABR-4500 and XBR-4500 routers cf2b042855 firmware-utils: add lxlfw tool for generating Luxul firmwares 887eb669f9 mac80211: brcm: backport remaining 5.6 kernel patches d91b52b1a2 kernel: add missing symbol 2a844349fa kernel: add support for GD25D05 SPI NOR eca8a2ee0d kernel: bump 4.14 to 4.14.169 3d1c84d424 ramips: reenable image creation for the D-Link DIR-645 Build-tested: x86-64, ipq40xx Fixes: CVE-2020-8597 --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 833bcb97..b28f55a9 100644 --- a/modules +++ b/modules @@ -2,7 +2,7 @@ GLUON_FEEDS='packages routing gluon' OPENWRT_REPO=https://git.openwrt.org/openwrt/openwrt.git OPENWRT_BRANCH=openwrt-19.07 -OPENWRT_COMMIT=aed6632d31ff5d29045dc904dedc840d902aad97 +OPENWRT_COMMIT=c56ed72d2bc6dbee3ff82b4bd42e1768f1a2c737 PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git PACKAGES_PACKAGES_BRANCH=openwrt-19.07 From 027aa49d91ab05a47d964c94e504f6232887ae73 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 1 Mar 2020 13:14:26 +0100 Subject: [PATCH 102/105] modules: update packages 99efce0cd pagekite: add simple websockets and update syntax 42c7a7adb pagekite: avoid redundant information in syslog 13e8c6ffe pagekite: bump to v0.91.200218 c3ff03a34 ocserv: updated to 0.12.6 8b1101bbd gnutls: updated to 3.6.12 95c72d8ab php7: update to 7.2.28 61970ece5 xl2tpd: fix building failure caused by pfc 7fe207375 xl2tpd: bump to version 1.3.15 e9ea875a1 zip: remove package 11b2c1ea1 nnn: update to version 3.0 47dc62ba2 nnn: update to version 2.9 201ec1470 youtube-dl: update to version 2020.2.16 7153a1f7f youtube-dl: update to version 2020.1.24 3a4d88f5d youtube-dl: update to version 2020.1.15 2c0a307ee acme: update to 2.8.5 e29cc586f Merge pull request #11381 from wvdakker/openwrt-19.07 1c7b7cfdf Shorewall6: Bump to version 5.2.3.6 481e63feb Shorewall: Bump to version 5.2.3.6 4f0e5c49d Shorewall6-lite: Bump to version 5.2.3.6 7c8f5fd70 Shorewall-lite: Bump to version 5.2.3.6 1fbf3e179 Shorewall-core: Bump to version 5.2.3.6 3cf36f145 Merge pull request #11375 from jefferyto/golang-1.13.8-openwrt-19.07 12b84e6ac golang: Update to 1.13.8 156dd4ad0 Merge pull request #11360 from gladiac1337/haproxy-2.0.13-openwrt-19.07 2f5b20987 haproxy: Update HAProxy to v2.0.13 bd24f9bb3 ffmpeg: disable x86 asm for old CPU types dbef69927 ffmpeg: update to 3.4.7 c53055aa1 ffmpeg: Fix fdkaac patches 9d6855be1 ffmpeg: Fix pkgconfig files to be more cross compile friendly 1e97faf11 zabbix: remove configure patch 2058e86fa zabbix: Fix compilation with uClibc-ng 403c98169 Merge pull request #11356 from neheb/boostkkk 2b15682da sshpass: add new package 76947a8be boost: reintroduce uClibc-ng patch 78d7c8aef knot: Do not try to build under ARC b4febf32c liburcu: Don't build under ARC, not even InstallDev fc5935729 perl: define $sysroot for extensions 5c856ff55 perl: Don't build InstallDev under ARC c7e1106d1 nss: Fix compilation with uClibc-ng bdca0e7bf measurement-kit: Fix compilation with uClibc-ng 8e746461f measurement-kit: update to version 0.10.9 659b1b807 boost: Fix embarassing ARC typo 8640d243e Merge pull request #11296 from Andy2244/samba4-update-4.11.6-(19.07) a0c00a213 Merge pull request #11297 from Andy2244/ksmbd-update-3.1.3-(19.07) f5be481a4 ksmbd: update to 3.1.3, ksmbd-tools: update to 3.2.1, add smb1 support, add avahi support package 1a503986f samba4: update to 4.11.6, add new UCI option 490685093 dnsdist: fix compilation on PIE ARM64 f815a7416 Merge pull request #11281 from micmac1/apache-19.07-up 9be5706a7 Merge pull request #11245 from Robby-/openwrt-19.07-rlmpython_and_fixproxycfgconflict 9e551f1b3 apache: add postinstall script 019b8fd05 subversion: fix build failure 8b238c840 subversion: add libsqlite3 depend 623ae4614 apache: bump to 2.4.41 & sync with master 4cba41ac1 apr-util: sync with master 391f5f087 apr: bump to 1.7.0 & sync with master 04da60f17 nano: update to 4.8 3cf0c61f2 php7: update to 7.2.27 c417bddda freeradius3: Enable the rlm_python and rlm_python3 modules. 4d16e3ae3 freeradius3: Fix proxy.conf file conflict. da2071507 syslog-ng: listen not globally but just locally 268ea7a78 python-importlib-metadata: add new package 90e596693 shadow: update to 4.8.1 433264290 Merge pull request #11213 from adde88/openwrt-19.07 f8999d963 Merge pull request #11229 from jefferyto/golang-env-fixes-openwrt-19.07 1d7cda2ed golang: Improve build isolation from user environment 6ac743909 Merge pull request #11226 from micmac1/sqlite3-19.07 0263d2273 sqlite3: update to version 3.31.1 f828174de hcxtools: update to 5.3.0 + changes to Makefile to include latest binaries being compiled afb4bb4c2 dnscrypt-proxy2: update to version 2.0.39 ba9262f04 dnscrypt-proxy2: update to version 2.0.36 3c95786ac Merge pull request #11219 from jefferyto/golang-1.13.7-openwrt-19.07 9a792f41c golang: Update to 1.13.7, add PKG_CPE_ID to Makefile 98499ee44 Merge pull request #11214 from Andy2244/wsdd2-fix_typos-(19.07) 24c1ebc2b Merge pull request #11216 from dibdot/19.07-2 8dffab34b adblock: update 3.8.15 00a1294d0 wsdd2: fix typos da3df8f6c hcxdumptool: update to 6.0.1 e73b2a0a0 Merge pull request #11203 from micmac1/19.07-xml2 0eb7b3e4e libxml2: install xml2-config with host triplet 6e5977094 libxml2/host: revert xml2-config prefix fix 752070f84 nextdns: Update to version 1.4.23 266917ae5 Merge pull request #11197 from Ansuel/backport 2c4e6a539 uwsgi: backport master changes to 19.07 8b5c2901c nginx: backport master changes to 19.07 f7b3d0062 Merge pull request #11184 from micmac1/19.07-maria-10.2.31 cff7a04a6 Merge pull request #11176 from jefferyto/python-fix-float-byte-order-openwrt-19.07 265e444d3 mariadb: security bump to 10.2.31 36a1c0c5a python-certify: bump to 2019.11.28 ad50eb7c0 python3: Fix float byte order detection a76dd0635 python: Fix float byte order detection 30d0c2ee0 python: Replace utime with utimes 1ec76dd7c libxslt/host: depend on libxml2/host 4689c0998 libxslt: patch security issues db7c84f67 libxslt: add host build 4d2cbcadc Merge pull request #11149 from nickberry17/add_mm_to_19 cac10393e modemmanager: add ModemManager to packages c9cf3c277 libqmi: add libqmi to packages 5f27a4701 libmbim: add libmbim to packages cd81e4f06 Merge pull request #11143 from Andy2244/smbd-rename_ksmbd-update-3.1.1-(19.07) f5f35a72a Merge pull request #11144 from Andy2244/wsdd2-rename_ksmbd-(19.07) e6c686454 glib2: fix mips16 build, add size reducing static link, fpic CFLAGS ef940752d glib2: Disable Werror fd5a51ac0 wsdd2: update for renamed smbd->ksmbd 82b463b19 smbd: update to 3.1.1, rename to "ksmbd", "ksmbd-tools" 1e43dc8f8 Merge pull request #11123 from stangri/19.07-https-dns-proxy 045e54e6b Merge pull request #11129 from Robby-/openwrt-19.07-freeradius3_update_3_0_20 885c9ed6c Merge pull request #11126 from micmac1/19.07-tiff b3c1a67ff freeradius3: Update to 3.0.20 eee4d0830 tiff: update version to 4.1.0 a9fd019a3 https-dns-proxy: fix deleting server items, configurable dnsmasq settings change eab36f8a6 avrdude: Fix GPIO path building 9cb0c7f4a Merge pull request #10990 from BKPepe/django-19.07 5afe3fd1d Merge pull request #11078 from ddast/radicale_add_urllib_dep ea93089af radicale-py3: Add python3-urllib dependency 72af40f2b nut: fix other/otherflag custom variables in nut-server.init e1aa905ab nut: update OpenSSL 1.1.0 patch 154da8aa0 nut: fix CGI setup 7b07ac9e3 Merge pull request #11063 from EricLuehrsen/openwrt-19.07-unbound bc4f3c11c unbound: improve dependencies for okpg 895200940 Merge pull request #11061 from cotequeiroz/afalg_1.1.0-19.07 1410d6b73 afalg_engine: bump to v1.1.0 162974f80 btrfs-progs: update to version 5.4.1 072fcb5ce libseccomp: add seccomp-syscalls.h to InstallDev 3ab34b50d Merge pull request #11051 from wvdakker/openwrt-19.07 5022caf86 Shorewall6-lite: Bump to 5.2.3.5 0b890cf4b Shorewall6: Bump to 5.2.3.5 1201cdcd5 Shorewall: Bump to 5.2.3.5 4cb0ff831 Shorewall-lite: Bump to 5.2.3.5 c2a5aa1a5 Shorewall-core: Bump to 5.2.3.5 8ba3c7b19 afalg_engine: fix ENGINES location, zero-copy 776216a65 afalg_engine: add new package 995226d95 strongswan: bump to 5.8.2 243673b2d strongswan: allow to specify per-connection reqid with UCI 3880d65a0 strongswan: bump to 5.8.1 ba43556ae libarchive: update to version 3.4.1 (security fix) ff87e8dbf oniguruma: bump to version 6.9.4 3030d0fc1 vpn-policy-routing: bugfix: remove conflict with vpnbypass d0bdd3252 Merge pull request #11021 from jefferyto/golang-updates-openwrt-19.07 2dbc88762 golang: Update to 1.13.6 fdd202bd1 golang: Fix selection of GOARM value 6a64b7aff libseccomp: update to version 2.4.2 a50eeb01f django: update to version 1.11.27 8f3dcbcee unbound: fix TLS forwards with optional suffix ffdbf4e7c measurement-kit: update to version 0.10.8 8f037084b measurement-kit: update package 8f2eb8f2d measurement-kit: update to version 0.10.6 3dfabe79f smbd: Update to 3.0.2 670f336d7 transmission: Sync with master e847333d1 python,python3: split python[3]-pkg-resources from setuptools 1f293771c openvswitch: bump PKG_RELEASE dc097661c openvswitch: backport patch to fix compilation 74e160df2 openvswitch: fix building failure caused by dst_ops api change a4a54d0f3 openvswitch: bump to version 2.11.1 d974cd367 Merge pull request #10920 from Rixerx/openwrt-19.07 26c23f3b9 Merge pull request #10881 from mstorchak/stubby-19.07 9adadfd8e sqlite3: bump to version 3.30.1 3bfc11ea2 sqlite3: bump to 3.29.0 e2bca1026 nginx: update to 1.16.1 74e9ca74f tor: add respawn to init script b85cbaf7e tor: update to version 0.4.2.5 2da2cf43b youtube-dl: update to version 2020.1.1 9ec865253 Merge pull request #10940 from Andy2244/samba-4.11.4-(19.07) 7472cc742 Merge pull request #10938 from Andy2244/smbd-rename-3.0.1-(19.07) 396c5fc9b Merge pull request #10939 from Andy2244/wsdd2-init-update-(19.07) bff320497 Merge pull request #10937 from Andy2244/libtirpc-1.2.5-(19.07) 85066d81d samba4: update to 4.11.4 (python3 version), add rpcsvc-proto, add libasn1 host build 28e84aacf wsdd2: update to git (2019-12-15), bind to 'lan' only, update init for smbd 8bc58d175 smbd: rename from cifsd, update to 3.0.1 71d639a45 libtirpc: update to 1.2.5 3a82973ae zabbix: update to 4.0.16 34938d03f Merge pull request #10903 from stangri/19.07-vpn-policy-routing a015cc1bd youtube-dl: update to version 2019.12.25 86b48645f vpn-policy-routing: initial release d22c35e58 nano: update to 4.7 10a7a8763 Merge pull request #10897 from jefferyto/golang-format-ldflags-openwrt-19.07 fc313e772 golang: Format TARGET_LDFLAGS for gcc 8df00a88e Merge pull request #10892 from cshoredaniel/pr-19.07-radicale2-doc-passlib-bcrypt 3b5c73f85 Merge pull request #10893 from cshoredaniel/pr-19.07-update-passlib-1-7-2 64d4fc6e6 radicale2: Document suggested use of passlib and bcrypt 9f39817c7 Merge pull request #10888 from mwarning/zerotier 479b45b8a zerotier: update to 1.4.6 f0c5a95a4 zerotier: make sure the /var/lib exists 38a3ed1c7 zerotier: change license to BSL 1.1 e42648f3c zerotier: update to release 1.4.4 70f4c1d19 zerotier: udpate to 1.4.2 61291196d zerotier: fix linking to libnatpmp and build with uclibc 1961985f8 zerotier: update to zerotier 1.4.0 7b5cc70fa zerotier: keep configuration file on update bcdb9d00a passlib: Update passlib to 1.7.2 ed6e1024b stubby: switch to ca-bundle in 19.07 73a965aea Merge pull request #10875 from jefferyto/golang-ldflags-fix-openwrt-19.07 db9a8a1e7 golang: Fix ldflags when GO_PKG_LDFLAGS is set a25849997 Merge pull request #10865 from nxhack/libuv_1_32_0 a23285c00 libuv: update to 1.32.0 b710855ef Merge pull request #10762 from leonghui/wiki-link-update-19.07 07cda0edc Merge pull request #10862 from gladiac1337/haproxy-2.0.12-openwrt-19.07 02985327b haproxy: Update HAProxy to v2.0.12 ef82bba48 unbound: update to 1.9.6 c9cb6a0b1 dnscrypt-proxy2: Update to version 2.0.34 b8bd94ef8 mtr: update to 0.93 5fe674a86 knot: update to version 2.9.2 20d3d99a5 meson: Update to version 0.52.1 c1b410d7a lmdb: use toolchain AR for compilation 38c0db06b shadow: change default encryption method from DES to SHA512 4a8f7d124 netdata: Update to version 1.19.0 39dce33ac syslog-ng: Update to version 3.25.1 cbb329ac7 btrfs-progs: Update to version 5.4 94c4f61b5 Merge pull request #10856 from BKPepe/python3-19.07 198d01f78 Merge pull request #10852 from gekmihesg/19.07-restic-rest-server 0f18984d4 Merge pull request #10853 from gekmihesg/19.07-restic c5d6ffaf1 python3: Updated to version 3.7.6 34b31493e restic: add package a018b5149 restic-rest-server: add package 9fffb2b68 icu: Backport C++11 math patch fff198e7f Merge pull request #10753 from stangri/19.07-https-dns-proxy e3de8dd08 Merge pull request #10822 from cshoredaniel/pr-19.07-remove-msmtp-scripts 90ef9c18c git: update to version 2.24.1 (security fix) dc2c25ccf git: Update to version 2.24.0 96c667a12 nspr: update to 4.24 ad246b363 nspr: update to 4.23 8f48dc334 nspr: update to 4.22 78e241c54 nss: update to 3.48 7e51bdee0 nss: update to 3.47.1 and fix xscale da51495aa nss: update to 3.47 5b1beec9d nss: update to 3.46.1 d4d798baa nss: update to 3.46 0b2a73d15 nss: Replace usleep with nanosleep 666cce12c nss: update to 3.45 01b9bf1a1 nss: update to 3.44.1 ceeac3b37 vpnc-script: bumped release version 13de8da3b php7: update to 7.2.26 b46f4ecd3 vpnc-script: enable reconnect f57ca519a cgi-io: close pipe descriptors early 9e434da4e cgi-io: implement exec action 59ca5bda3 msmtp-scripts: Remove as abandoning upstream; msmtp-queue works a84d8ddce https-dns-proxy: switch to https-dns-proxy package name 80c42c968 Merge pull request #10809 from etactica/mb-1907 7ebd7011c libmodbus: update to 3.1.6 a70432b78 tor: update to 0.4.1.6 9147f9d72 tor: update to version 0.4.1.5 2c434727b Merge pull request #10801 from gladiac1337/haproxy-2.0.11-openwrt-19.07 90180becf haproxy: Update HAProxy to v2.0.11 18e9050e3 treewide: update wiki links 10d2e63dd Merge pull request #10776 from rs/nextdns-1.3.1_19.07 d40052862 nextdns: update to version 1.3.1 b4f3e5085 collectd: add vmem uci config 3a65e659d adblock: bugfix 3.8.14 111e84674 net/pagekitec: Update to 20191211 version a82cbd584 adblock: bugfix 3.8.13 c61579b56 meson: add new package fd5ef39e8 ninja: add new package c1dd9499b golang: Update to 1.13.5 e67c39546 transmission: bump PKG_RELEASE 8acf58bf6 geth: Update to 1.9.9 54cbc535d geth: Update to 1.9.6 710c325be nnn: Update to version 2.8.1 b88b43dd1 python-more-itertools: add new package bc30298f5 motion: fix streaming 77d230b52 motion: add basic procd init script b1b53e61c motion: Update to 4.2.2 350716771 Merge pull request #10682 from hnyman/collectd-backport 2591e8220 mosquitto: bump to version 1.6.8 12be725fa Merge pull request #10697 from jefferyto/byobu-1.130-openwrt-19.07 1781209be gnutls: fixed pkg-hash to the right one 1c28d8cc2 openconnect: updated to 8.05 b551c5329 gnutls: updated to 3.6.11 6aebfb2df byobu: Update to 5.130 879a1e25b byobu: Update to 5.129 0116633d0 nano: update to 4.6 3dd9ef2f1 banip: update 0.3.11 a9b5f0657 collectd: update to 5.10.0 e33b3f8ca collectd: adjust reaction to ntp time at boot time a681b766e collectd: update to 5.9.2 bbf35c736 collectd: bump PKG_PACKAGE version e7ed36702 collectd: add reload and service trigger ac29330c5 collectd: add logfile plugin definitions 5dd077e95 collectd: add iptables uci config 6884430d4 collectd: add network uci config df7d418c9 collectd: add curl uci config 53e546854 collectd: add apcups uci config eb6798351 collectd: add new memory config values 0f9ae62e2 collectd: add new cpu config values 4d54186f1 collectd: use uname to get default Hostname 2bd0a56f0 collectd: log stderr output c4083af7b collectd: enable threshold plugin 1920eb60f collectd: move jshn.sh include to remove warning 00803ffc9 collectd: enable cpufreq module for ipq40xx and brcm2708_bcm2709 e6ced2769 Merge pull request #10676 from gladiac1337/haproxy-2.0.10-openwrt-19.07 5dd5b3365 haproxy: Update HAProxy to v2.0.10 a79d6df67 transmission: sync with master branch 7c1c00735 Merge pull request #10646 from Andy2244/softethervpn5-9672_19.07 a881ab43c softethervpn5: update to 5.01.9672 Build-tested: x86-64, ipq40xx --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index b28f55a9..1450a063 100644 --- a/modules +++ b/modules @@ -6,7 +6,7 @@ OPENWRT_COMMIT=c56ed72d2bc6dbee3ff82b4bd42e1768f1a2c737 PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git PACKAGES_PACKAGES_BRANCH=openwrt-19.07 -PACKAGES_PACKAGES_COMMIT=03b412db2e3f9b42c4a55e13ce0c6de3c757895b +PACKAGES_PACKAGES_COMMIT=99efce0cd27adfcc53384fba93f37e5ee2e517de PACKAGES_ROUTING_REPO=https://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_BRANCH=openwrt-19.07 From 1c4f1feb36425f72aa464d17963c44812e414e90 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 1 Mar 2020 13:15:37 +0100 Subject: [PATCH 103/105] modules: update routing efa6e54 luci-app-bmx6: bugfix querying bmx6-info (p2) f1b0476 luci-app-bmx6: bugfix format to query bmx6-info 839ea37 quagga: update to version 1.1.1 (#541) c82ce8d Merge pull request #536 from ecsv/batadv-for-19.07 242185e batman-adv: Merge bugfixes from 2019.5 Build-tested: x86-64, ipq40xx --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 1450a063..a7a52e2b 100644 --- a/modules +++ b/modules @@ -10,7 +10,7 @@ PACKAGES_PACKAGES_COMMIT=99efce0cd27adfcc53384fba93f37e5ee2e517de PACKAGES_ROUTING_REPO=https://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_BRANCH=openwrt-19.07 -PACKAGES_ROUTING_COMMIT=8d5ee29f088e9dfaa49dc74573edb1919f14dbf4 +PACKAGES_ROUTING_COMMIT=efa6e5445adda9c6545f551808829ec927cbade8 PACKAGES_GLUON_REPO=https://github.com/freifunk-gluon/packages.git PACKAGES_GLUON_COMMIT=12e41d0ff07ec54bbd67a31ab50d12ca04f2238c From 5af0080c24dc986e2a8a7ed8c19d72c4a04fdd42 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sun, 1 Mar 2020 18:44:19 +0100 Subject: [PATCH 104/105] modules: bump OpenWrt ef391799e3 ar71xx: correct AVM FRITZ Repeater 450E WPS button flag (#1940) --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index a7a52e2b..88d95d7f 100644 --- a/modules +++ b/modules @@ -2,7 +2,7 @@ GLUON_FEEDS='packages routing gluon' OPENWRT_REPO=https://git.openwrt.org/openwrt/openwrt.git OPENWRT_BRANCH=openwrt-19.07 -OPENWRT_COMMIT=c56ed72d2bc6dbee3ff82b4bd42e1768f1a2c737 +OPENWRT_COMMIT=ef391799e3821dad0654a95bfeaf67e12f232f9e PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git PACKAGES_PACKAGES_BRANCH=openwrt-19.07 From add560b18f1db642bd19dbc4e3ef95c3a334d535 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sun, 1 Mar 2020 23:49:18 +0100 Subject: [PATCH 105/105] modules: bump OpenWrt 1713707673 ar71xx: add missing LED migration for Archer C7 (#1941) --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 88d95d7f..650f294b 100644 --- a/modules +++ b/modules @@ -2,7 +2,7 @@ GLUON_FEEDS='packages routing gluon' OPENWRT_REPO=https://git.openwrt.org/openwrt/openwrt.git OPENWRT_BRANCH=openwrt-19.07 -OPENWRT_COMMIT=ef391799e3821dad0654a95bfeaf67e12f232f9e +OPENWRT_COMMIT=17137076732b18442202e75c7edf10bccbc5f2a2 PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git PACKAGES_PACKAGES_BRANCH=openwrt-19.07