Commit Graph

3717 Commits

Author SHA1 Message Date
Matthias Schiffer
e384f899b7
gluon-radv-filterd: remove unneeded memset 2020-07-02 00:10:29 +02:00
Matthias Schiffer
97f1515284 build: add luacheck support for package/features 2020-07-01 20:35:22 +02:00
Matthias Schiffer
ee5ec5afe5 build: rewrite features.sh in Lua
The `features` file is converted to a Lua-based DSL.

A helper function `_` is used in the DSL; this will return the original
string for enabled features, and nil for disabled features. This allows
to use boolean operations on features without making the code too
verbose.

Besides having more readable and robust code, this also fixes the bug
that all files `packages/*/features` were evaluated instead of only
using the feature definitions of currently active feeds.
2020-07-01 20:35:22 +02:00
Matthias Schiffer
0fd5905fc2
build: target_config_lib: introduce concat_list helper 2020-07-01 20:10:40 +02:00
Matthias Schiffer
8a79d0249f
gluon-scheduled-domain-switch: move gluon-switch-domain to /lib/gluon/scheduled-domain-switch
This script is an implementation detail - let's not clutter the global
$PATH namespace with a script with such a generic name.
2020-06-30 23:49:01 +02:00
Matthias Schiffer
60351a1f19
gluon-core: allow to switch domains during reconfiguration
When gluon.core.switch_domain is set, it replaces the old domain.

This also replaces an unnecessary uci:commit() with uci:save().
2020-06-30 23:49:01 +02:00
Matthias Schiffer
62e71fbc40
gluon-core: run gluon-reconfigure on boot when gluon.core.need_reconfigure is set 2020-06-30 23:49:00 +02:00
Matthias Schiffer
cf0dc24463
gluon-setup-mode: create symlinks in install script
The package rebuild logic of OpenWrt only checks regular files. Avoid
symlinks in the files directory to make rebuilds more robust.
2020-06-30 23:48:55 +02:00
David Bauer
9be7a5cad7
gluon-wan-dnsmasq: read interfaces to update from flag-files (#2060)
This commit changes the behavior for the wan-dnsmasq to read the
interfaces to update the DNS servers on from flag-files.

This way, external custom packages which add a custom VPN WAN interface
can update the DNS server gluon is using for WAN resolving.
2020-06-30 16:37:09 +02:00
Matthias Schiffer
fa0e2d06b6
gluon-core: lantiq: use WAN interface from switch0 configuration
On lantiq, the default WAN ifname is 'dsl0' even on devices that have a
separate WAN port. At least on devices using swconfig we can override
this with the switch port labelled as 'wan'.
2020-06-21 17:47:45 +02:00
David Bauer
5696be7240 mt76: mt76x0: disable GTK offloading
When the GTK is offloaded, MT7610 won't transmit any multicast frames.
This is most likely due to a bug in the offloading datapath. MT7612 is
not affected.

Disable GTK offloading for now. It can be re-enabled once the bug in the
offloading path is fixed.

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-06-14 17:11:17 +02:00
David Bauer
efb6b9d555 gluon-core: allow WPA3 features on ramips-mt7620
Backporting the MFP patch allows us to utilize WPA3 features on this
target.

Tested on TP-Link Archer C20i
2020-06-14 17:11:04 +02:00
David Bauer
f9008851d5 mac80211: rt2800: enable MFP support unconditionally
This gives us WPA3 support out of the box without having to manually disable
hardware crypto. The driver will fall back to software crypto if the connection
requires management frame protection.

THis allows us to use WPA3 features (Private-WiFi SAE & OWE) on
ramips-mt7620.
2020-06-14 17:10:55 +02:00
David Bauer
2be6fe32e6 modules: update OpenWrt
b515edb775 ipq40xx: essedma: Disable TCP segmentation offload for IPv6
f7f15f8033 ath79: wndr3700 series: fix wifi range & throughput
1f5cbd6be7 ca-certificates: update to version 20200601
fa72f2646a oxnas: build with 8021Q VLAN support
e752fc1ff9 ath79: add support for TP-Link TL-WR802N V1 and V2
6488d2f7cc ath79: update WA/XC devices UBNT_VERSION to 8.5.3
fb79e5d9fe ipq806x: EA8500 fix boot partition detection
e36bdd5dc5 ath79: fix LEDs for GL.inet GL-AR150
21454a772b ar71xx: fix reset key for TP-Link TL-WR802N V1/V2
a32b0ec4cf generic: fix flow table hw offload

Closes #2055
2020-06-14 15:49:17 +02:00
Matthias Schiffer
5e44f7cdde
gluon-core: get LAN and WAN interfaces from board.json
Instead of looking at the initial UCI config, we can read this
information from board.json.
2020-06-14 12:38:53 +02:00
David Bauer
2891454f16 mt76: mt76x0: disable GTK offloading
When the GTK is offloaded, MT7610 won't transmit any multicast frames.
This is most likely due to a bug in the offloading datapath. MT7612 is
not affected.

Disable GTK offloading for now. It can be re-enabled once the bug in the
offloading path is fixed.

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-06-13 23:07:05 +02:00
David Bauer
baa53b4d8b
Merge pull request #2052 from blocktrron/rt2x00-80211w
mac80211: rt2800: enable MFP support unconditionally
2020-06-13 19:07:52 +02:00
Matthias Schiffer
3926717998
gluon-mesh-batman-adv: do not delete bat0 during hardif teardown (#2057)
With very bad timing, it is possible that the teardown script of a
gluon_mesh interface runs when bat0 was just created, but primary0 is not
yet added to it. Although there is no hardif to remove in this case,
bat0 will still be deleted, because there is no hardif in bat0.

Disable the interface removal logic by passing `-M` to `batctl interface`.

(cherry picked from commit 92647cd47a)
2020-06-13 18:45:13 +02:00
Matthias Schiffer
92647cd47a
gluon-mesh-batman-adv: do not delete bat0 during hardif teardown (#2057)
With very bad timing, it is possible that the teardown script of a
gluon_mesh interface runs when bat0 was just created, but primary0 is not
yet added to it. Although there is no hardif to remove in this case,
bat0 will still be deleted, because there is no hardif in bat0.

Disable the interface removal logic by passing `-M` to `batctl interface`.
2020-06-13 18:44:46 +02:00
Matthias Schiffer
6cb5a2ac7a
docs: update version number to v2020.2+
v2020.2.x has been branched, so the current master is v2020.2+.
2020-06-13 13:21:47 +02:00
Matthias Schiffer
ee473ce2a4
gluon-config-mode-outdoor: enable 5GHz mesh interfaces when disabling outdoor mode
There is no setting to explicitly enable mesh interfaces in the config
wizard, so we need to enable mesh interfaces by default when the outdoor
mode is disabled (unless site.conf dictates otherwise).

The simplest way to achieve this is to delete the 5GHz mesh interface
sections when outdoor mode is disabled: 200-wireless would delete and
recreate them a moment later anyways, but by deleting them earlier we
ensure that the disabled status is initialized from site.conf again.

(cherry picked from commit 17bc622892)
2020-06-12 22:12:01 +02:00
Matthias Schiffer
b466d00d3f
gluon-web-wifi-config: default to enabled 5GHz mesh interfaces when disabling outdoor mode
When disabling outdoor mode, 5GHz mesh interfaces should be enabled by
default again (unless disabled in site.conf).

(cherry picked from commit d2052431dd)
2020-06-12 22:12:01 +02:00
Matthias Schiffer
86b0a60d8d
gluon-core: fix handling of 'disabled' site.conf attributes for mesh interfaces
Because is_disabled() was always returning true or false, the
first_non_nil() would never actually check the default setting from
site.conf. This was broken since v2017.1.

Fixes: 6cf03bab37 ("treewide: replace normal uses of luci.model.uci with simple-uci to reduce LuCI dependencies")
(cherry picked from commit 3c2593b684)
2020-06-12 22:12:01 +02:00
Matthias Schiffer
41d13742f6
build: target_config_lib: do not build unused packages for targets without opkg (#2051)
Normally, we build all nonshared packages (which includes all kernel
modules) to generate an opkg feed for later package installations by
users. On targets without opkg, this just wastes time - disable it.

(cherry picked from commit b3edfd292a)
2020-06-12 22:12:01 +02:00
Matthias Schiffer
a426312cb8
Merge pull request #2054 from freifunk-gluon/outdoor-mesh-enable
Enable 5GHz mesh interfaces when disabling outdoor mode, fix default status from site.conf
2020-06-12 22:10:42 +02:00
Matthias Schiffer
17bc622892
gluon-config-mode-outdoor: enable 5GHz mesh interfaces when disabling outdoor mode
There is no setting to explicitly enable mesh interfaces in the config
wizard, so we need to enable mesh interfaces by default when the outdoor
mode is disabled (unless site.conf dictates otherwise).

The simplest way to achieve this is to delete the 5GHz mesh interface
sections when outdoor mode is disabled: 200-wireless would delete and
recreate them a moment later anyways, but by deleting them earlier we
ensure that the disabled status is initialized from site.conf again.
2020-06-12 19:27:01 +02:00
Matthias Schiffer
d2052431dd
gluon-web-wifi-config: default to enabled 5GHz mesh interfaces when disabling outdoor mode
When disabling outdoor mode, 5GHz mesh interfaces should be enabled by
default again (unless disabled in site.conf).
2020-06-12 19:13:20 +02:00
Matthias Schiffer
3c2593b684
gluon-core: fix handling of 'disabled' site.conf attributes for mesh interfaces
Because is_disabled() was always returning true or false, the
first_non_nil() would never actually check the default setting from
site.conf. This was broken since v2017.1.

Fixes: 6cf03bab37 ("treewide: replace normal uses of luci.model.uci with simple-uci to reduce LuCI dependencies")
2020-06-11 23:52:22 +02:00
Matthias Schiffer
b3edfd292a
build: target_config_lib: do not build unused packages for targets without opkg (#2051)
Normally, we build all nonshared packages (which includes all kernel
modules) to generate an opkg feed for later package installations by
users. On targets without opkg, this just wastes time - disable it.
2020-06-11 02:16:49 +02:00
David Bauer
2611e86438 gluon-core: allow WPA3 features on ramips-mt7620
Backporting the MFP patch allows us to utilize WPA3 features on this
target.

Tested on TP-Link Archer C20i
2020-06-10 22:45:01 +02:00
David Bauer
e8cc866db2 mac80211: rt2800: enable MFP support unconditionally
This gives us WPA3 support out of the box without having to manually disable
hardware crypto. The driver will fall back to software crypto if the connection
requires management frame protection.

THis allows us to use WPA3 features (Private-WiFi SAE & OWE) on
ramips-mt7620.
2020-06-10 22:41:01 +02:00
Matthias Schiffer
e6491287ba
gluon-core: create disabled mesh interface sections in outdoor mode
The interfaces should always exist and just be disabled when outdoor
mode is enabled. Not creating them at all leads to an issue in the
advanced wifi settings where an additional reload of the page is
necessary after enabling or disabling the ourdoor mode to make the mesh
VIF options appear or disappear.

(cherry picked from commit b15b008e69)
2020-06-07 10:56:40 +02:00
Matthias Schiffer
3d091912af
gluon-web-wifi-config: make mesh VIF options depend on outdoor=false
Instead of relying on the existence of interface sections only (which is
still used for the case of interface types that are not configured at
all in the site config), add a proper dependency.

This fixes section visiblity with enabled outdoor mode after the following
fix, and gives the user immediate feedback (allowing to disable outdoor
mode and enable meshing in a single step).

(cherry picked from commit d012d7d32f)
2020-06-07 10:56:39 +02:00
Matthias Schiffer
63ca8f8bfa
gluon-web-wifi-config: rename and simplify filter_active_interfaces()
- Return early
- Rename to has_active_interfaces(), as it returns a boolean

(cherry picked from commit 53c33acaf9)
2020-06-07 10:56:39 +02:00
Matthias Schiffer
8ecc5d89cc
gluon-config-mode-outdoor, gluon-web-wifi-config: commit network config
200-wireless will add or remove the mesh network sections of
/etc/config/network. Commit this file, so the modified setting doesn't
get lost on reboot.

Fixes: #2048
(cherry picked from commit 600ab99f80)
2020-06-07 10:56:39 +02:00
Matthias Schiffer
11beb822a5
build: target_config_check: make check more lenient
Always allow options set to builtin (=y) when modular setting (=m) is
expected. This can happen when a package is added explicitly (in a
target defintion or site.mk) that is also pulled in as a dependency of
another builtin package.

Fixes: 9e23534ec3 ("build: rework config generation")
Fixes: #2046
(cherry picked from commit 8b64517f1b)
2020-06-07 10:55:01 +02:00
David Bauer
60d7288255
Merge pull request #2047 from freifunk-gluon/fix-config-check
build: target_config_check: make check more lenient
2020-06-07 03:10:24 +02:00
David Bauer
5d51b7dc2a
Merge pull request #2049 from freifunk-gluon/outdoor-mode-commit
Fix /etc/config/network commit for outdoor mode change, and related fixes
2020-06-07 03:09:00 +02:00
Matthias Schiffer
e8c65ef75f
gluon-web-model: fix conflicting table fields "reset"
With 11a3b56617 ("gluon-web-model: add dependency support for
sections"), a "reset" function was added to all model nodes. This
conflicts with the "reset" field of the Form object, making reset
buttons show labels like "function: 0xbb8d50" and possibly breaking form
processing when packages override the reset field.
2020-06-06 17:23:21 +02:00
Matthias Schiffer
b15b008e69
gluon-core: create disabled mesh interface sections in outdoor mode
The interfaces should always exist and just be disabled when outdoor
mode is enabled. Not creating them at all leads to an issue in the
advanced wifi settings where an additional reload of the page is
necessary after enabling or disabling the ourdoor mode to make the mesh
VIF options appear or disappear.
2020-06-06 17:12:13 +02:00
Matthias Schiffer
d012d7d32f
gluon-web-wifi-config: make mesh VIF options depend on outdoor=false
Instead of relying on the existence of interface sections only (which is
still used for the case of interface types that are not configured at
all in the site config), add a proper dependency.

This fixes section visiblity with enabled outdoor mode after the following
fix, and gives the user immediate feedback (allowing to disable outdoor
mode and enable meshing in a single step).
2020-06-06 17:12:13 +02:00
Matthias Schiffer
53c33acaf9
gluon-web-wifi-config: rename and simplify filter_active_interfaces()
- Return early
- Rename to has_active_interfaces(), as it returns a boolean
2020-06-06 17:12:12 +02:00
Matthias Schiffer
600ab99f80
gluon-config-mode-outdoor, gluon-web-wifi-config: commit network config
200-wireless will add or remove the mesh network sections of
/etc/config/network. Commit this file, so the modified setting doesn't
get lost on reboot.

Fixes: #2048
2020-06-06 16:47:35 +02:00
Matthias Schiffer
8b64517f1b
build: target_config_check: make check more lenient
Always allow options set to builtin (=y) when modular setting (=m) is
expected. This can happen when a package is added explicitly (in a
target defintion or site.mk) that is also pulled in as a dependency of
another builtin package.

Fixes: 9e23534ec3 ("build: rework config generation")
Fixes: #2046
2020-06-05 22:27:10 +02:00
Matthias Schiffer
45b518df11 gluon-web-model: remove unused field error message code
Validation errors are mostly handled in the frontend (by displaying
invalid fields with a red background). There was some code left in the
backend for handling different kinds of errors, and returning custom
error messages from validate(), but the resulting value was not used
anywhere.
2020-06-05 21:46:30 +02:00
Matthias Schiffer
5adbaf2907 gluon-web-model: remove dead code for section errors 2020-06-05 21:46:30 +02:00
Matthias Schiffer
e6859ca031 gluon-web-model: remove unused tag_invalid and tag_missing fields 2020-06-05 21:46:30 +02:00
Matthias Schiffer
11a3b56617 gluon-web-model: add dependency support for sections
- Add a dependency array to section template
- Lift dependency handling from AbstractValue to Node
- Split resolve_depends() into a function handling dependencies of a
  node itself (resolve_node_depends()), which now is used for all nodes,
  and the existing recursive descent through the node tree
- When any node's dependencies are not satisfied, all descendents are
  reset recursively, meaning that an option in a section that is hidden
  will always be ignored, as if the option's own dependencies were
  unsatisfied

Fixes: #1349
2020-06-04 22:54:28 +02:00
Matthias Schiffer
35950b44b7 gluon-web-model: fix passing additional variables from form template to sections
This is currently unused in our packages.
2020-06-04 22:54:28 +02:00
Matthias Schiffer
3951607e53 gluon-web-model: fix deplist() argument list
Fixes dependency tracking for individual <option> elements (currently
unused).
2020-06-04 22:54:28 +02:00