Commit Graph

239 Commits

Author SHA1 Message Date
J. Burfeind
02edf564bd
ath79-generic: (re)add CPE210v3 (#2506)
Gone due to
commit 45c84a117b ("ar71xx: drop target")
2022-05-13 23:36:34 +02:00
Matthias Schiffer
a8d25670ce
gluon-core: use copy of "WAN" role list for "single" default (#2478)
Instead of using roles.wan directly as the default for roles.single,
create a copy of the table, so subsequent modifications of roles.single
don't affect roles.wan as well.

Fixes migration of Mesh-on-WAN status when no default for "single"
interfaces is set in site.conf.
2022-04-17 20:46:53 +02:00
Matthias Schiffer
1252871217
gluon-core: fix gluon.util.get_role_interfaces() with empty role list (#2472)
The function failed when an interface has no roles assigned, breaking
several upgrade scripts.

Closes #2471
2022-04-17 01:19:22 +02:00
Matthias Schiffer
4225bd3853
gluon-core: fix setting interface default roles from site.conf (#2463)
Make the code match the docs and check_site.lua by actually looking up
the "default_roles" field, not "roles".
2022-04-13 00:49:46 +02:00
J. Burfeind
684b4a80a0
ath79-generic: (re)add support for wbs210v1 (#2461)
Gone due to
commit 45c84a117b ("ar71xx: drop target")
2022-04-08 00:18:34 +02:00
J. Burfeind
dfa209a88a
ath79-generic: (re)add NanoStation M2/M5 (XW) (#2443)
Gone due to
commit 45c84a117b ("ar71xx: drop target")
2022-04-03 00:01:38 +02:00
J. Burfeind
39c3c7adf3
ath79-generic: (re)add support for UniFi AP PRO (#2416)
Ubiquiti UniFi AP PRO

Gone due to
commit 45c84a1 ("ar71xx: drop target")
2022-03-26 11:11:32 +01:00
J. Burfeind
087c15ae0c
ath79-generic: (re)add support for UniFi AC Mesh (#2428)
Gone due to
commit 45c84a117b ("ar71xx: drop target")
2022-03-26 10:52:35 +01:00
J. Burfeind
1bfad8ff02
ath79-generic: (re)add support for CPE510 v1.x (#2430)
Gone due to
commit 45c84a117b ("ar71xx: drop target")
2022-03-25 23:39:19 +01:00
J. Burfeind
fd8d5a3cdb
ath79-generic: (re)add support for CPE210 v2.x (#2429)
Gone due to
commit 45c84a117b ("ar71xx: drop target")
2022-03-25 18:21:24 +01:00
J. Burfeind
a5ada094bf
ath79-generic: (re)add support for CPE210 v1.x (#2410)
Gone due to
commit 45c84a117b ("ar71xx: drop target")
2022-03-24 19:21:45 +01:00
Matthias Schiffer
a671b5081c
gluon-core: preserve explicitly marked network and system sections
A section can be marked as preseved by setting the gluon_preserve option
to 1. In addition the following conditions must hold:

- The preserved section must not already exist after OpenWrt's and
  Gluons setup scripts run. Modifying existing sections is currently
  unsupported.
- Preserved sections must be named, so it can be detected whether a
  section conflicts with a preexisting one.
2022-02-22 18:52:15 +01:00
Matthias Schiffer
316e96a467
gluon-core, gluon-setup-mode: reset ifname sysconfigs on each update, introduce single_ifname
Allow interface names to change on updates to handle hwconfig -> DSA and
similar migrations.

On devices with only a single interface, a sysconfig single_ifname is
created instead of wan_ifname or lan_ifname to allow separate
configuration in site.conf.
2022-02-22 18:52:15 +01:00
Matthias Schiffer
c779d12369
treewide: use interface roles as basis for network configuration
With the new role-based interface configuration, it would be better to
rename the wan/wan6 interfaces to uplink/uplink6, but that would cause
unnecessary churn for the firewall configuration, so it is left for a
later update.

As all interfaces with the 'uplink' role are in the br-wan bridge, it is
not possible to assign these to the 'mesh' role independently - instead,
br-wan is added as a mesh interface as soon as a single interface has
both the 'uplink' and 'mesh' roles. The UCI section for this
configuration is now called 'mesh_uplink' instead of 'mesh_wan'.

For all interfaces that have the 'mesh', but not the 'uplink' role a
second configuration 'mesh_other' is created. If there is more than one
such interface, all these interfaces are bridged as well (creating a
bridge 'br-mesh_other'). This replaces the 'mesh_lan' section with its
optional 'br-mesh_lan' bridge, but can also include interfaces that were
not considered "LAN" when interfaces roles are modified (via site.conf
or manually).
2022-02-22 18:52:15 +01:00
Matthias Schiffer
4b8251c988
gluon-core: initialize interfaces role configuration
The new configuration generates sections iface_single/lan/wan in
/etc/config/gluon. These sections usually refer to a sysconfig-controlled
interface list, but adding custom sections with verbatim interfaces names
is also possible.

Each interface section contains a list of roles. The supported roles are
'client', 'uplink' and 'mesh'. Multiple roles can be configured on the
same interface (for example the old 'mesh_on_wan' setting would become
'uplink'+'mesh').

'client' is subsumed by any other role configured on the same interface
('client'+'mesh' is equivalent to 'mesh'). This property is important, as
it allows the Wired Mesh settings in gluon-web-network to simply add and
remove the mesh role without having to care what other roles are set -
so in the default setup, this would switch between 'client' and
'client'+'mesh' for the LAN interface.

By default, the WAN interface has role 'uplink' and the LAN interface
'client'; if only a single interface exists, the roles from the WAN
interface are used by default. The default for each of the three
interfaces (WAN/LAN/single) can be changed separated in site.conf,
superseding the old mesh_on_wan, mesh_on_lan and single_as_lan settings.
2022-02-22 18:52:15 +01:00
Matthias Schiffer
05c29512ec
gluon-core: sysconfig: avoid unnecessary writes
Do not write files when the content is unchanged.

Avoids a few unnecessary filesystem writes when resetting ifname
sysconfigs on each upgrade.
2022-02-22 18:52:15 +01:00
Matthias Schiffer
c2a5f57c40
treewide: regenerate network and system configs on every reconfigure 2022-02-22 18:52:15 +01:00
Matthias Schiffer
1041014cf3
Merge pull request #2382 from freifunk-gluon/cleanup
Removal of more obsolete migrations, minor cleanup and improvements to lsupgrade.sh
2022-02-01 23:31:41 +01:00
Matthias Schiffer
3ea770db73
ath79-generic: swap interfaces on TP-Link WBS210 v2 (#2385)
Swap the interfaces so than the PoE input port LAN0 is used for WAN and
config mode, and LAN1 becomes LAN.

To this end, the code previously used for ar71xx and removed in
commit 9fdc57c175 ("treewide: drop ar71xx platform specific code") is
reintroduced.

Fixes #2384
2022-01-28 19:45:34 +01:00
Matthias Schiffer
12127813c5
gluon-core: move preserve_channels setting to /etc/config/gluon
/etc/config/gluon-core is used for nothing else.

As /etc/config/gluon uses a named wireless section, also change the
get_first() to get().
2022-01-23 14:44:06 +01:00
Luflosi
55e95dd49b
ath79-generic: add support for TP-Link Archer A7 v5 (#2374) 2022-01-14 23:20:22 +01:00
Maciej Krüger
a8d6a99f5b
gluon-mesh-vpn-wireguard: fix empty string key
Co-Authored-By: Matthias Schiffer <mschiffer@universe-factory.net>
2022-01-14 04:53:28 +01:00
Maciej Krüger
816d2796be
gluon-core: add gluon info binary
This copies the code from web-admin and uses it to create a neat
cli-accessible summary about a node

This could also be extended or possibly have all the data the status
page has

Co-Authored-By: Matthias Schiffer <mschiffer@universe-factory.net>
2022-01-14 04:53:19 +01:00
Matthias Schiffer
97ef7889c6
gluon-core: remove more obsolete migrations 2022-01-01 01:45:52 +01:00
Matthias Schiffer
bae14abca4
gluon-core: remove obsolete proto 'batadv' -> 'gluon_mesh' migration
More migration code from 2016.
2021-12-31 22:51:29 +01:00
Matthias Schiffer
16bf5e3e5d
gluon-core: remove obsolete sysconfig.gluon_version handling
The file /lib/gluon/version/core hasn't existed since early 2014, so
this whole script is obsolete.
2021-12-31 22:51:29 +01:00
Matthias Schiffer
17e1aa4ffd
gluon-core: migrate wireless configuration from hwmode to band
The migration is done very early, as other upgrade scripts depend on the
band setting through platform.device_uses_11a().
2021-12-19 16:43:19 +01:00
David Bauer
c52089fcda
treewide: use radio band option to determine frequency band
The 'hwmode' setting has been replaced with 'band' in OpenWrt to add
support for newer bands outside of 2.4G and 5G. Adjust Gluon accordingly.

[Matthias Schiffer: rebased, extended commit message]
2021-12-19 16:43:12 +01:00
Matthias Schiffer
5f1f960753
gluon-core: introduce device_uses_wlan() helper 2021-09-13 17:47:04 +02:00
Matthias Schiffer
7a2cd66cb9
gluon-core: move a few WLAN-specific functions from gluon.platform to gluon.wireless
Avoid requiring gluon.wireless from gluon.platform, and requiring
gluon.platform from various other scripts.
2021-09-13 17:41:15 +02:00
Tom Herbers
5a034be6b3
ath79-generic: add support for TP-Link EAP225-Outdoor v1 2021-08-28 18:52:52 +02:00
citronalco
34fc9544b8
ath79-generic: add support for TP-Link WBS210 v2 (#2299) 2021-08-27 23:15:04 +02:00
micw
a1b961994a
Add support for tp-link CPE510 V2 (#2287)
Co-authored-by: Michael Wyraz <michael.wyraz@evermind.de>
2021-08-12 17:14:38 +02:00
micw
6b699f376c
Add support for tp-link CPE510 V3 (#2283) 2021-08-11 19:15:37 +02:00
David Bauer
14b1224f97
ipq40xx: add support for Aruba AP-365 / InstantOn AP17 (#2290) 2021-08-11 01:14:30 +02:00
Matthias Schiffer
bfec08546b
gluon-core: use uci:delete_all() instead of foreach()+delete() (#2273) 2021-07-17 23:24:01 +02:00
David Bauer
f01c62e594
gluon-core: wireless: support PHY lookup for multi-PHY devices (#2267)
The PHY lookup helper "find_phy_by_path" could not lookup the PHY name
for paths from multi-phy devices.

An example for such a path would be:
'1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0+1'

The integer after the plus (+) character determines the PHY index of the
specific device in relation to the PHY with the lowest index of the
device.

For example, if the device provides phy2 and phy3, the above path would
describe phy3. In case the device provides phy0 and phy1, it would
describe phy1.

Rewrite the "find_phy_by_path" function to support those paths as well
as regular device paths in a universal manner.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-07-17 22:50:02 +02:00
aiyion.prime
e410a9c2e5 gluon-core: implement popen3() in gluon/util.lua
[Matthias Schiffer: simplify close_fds() helper and use in child process]
2021-07-15 17:53:07 +02:00
Matthias Schiffer
14236ed8f6
Merge pull request #2237 from freifunk-gluon/installed-check-site
Run site check for manual package installations
2021-07-14 16:20:20 +02:00
Matthias Schiffer
76a242b595
Merge pull request #2271 from freifunk-gluon/tiny-flash-cleanup
Remove ramips-rt305x and now unused build features
2021-07-14 16:20:01 +02:00
David Bauer
5ec8676b28
gluon-core: delete all network device sections (#2263)
Delete all default network device sections upon first boot.

Only LAN & WAN networks are defined at this point. We are using the
legacy way of definiting bridges via the interface sections ifname
option.

The prior filtering was based upon a single device and didn't take into
consideration that DSA interface names can be named arbitrarily.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-07-14 01:49:33 +02:00
Matthias Schiffer
09c9b78e30 ramips-rt305x: drop target
VoCores aren't exactly useful mesh nodes except for experimentation.
They certainly aren't worth maintaining a whole target, in particular
one that has a WLAN driver not used by any other target.
2021-07-13 21:37:39 +02:00
Matthias Schiffer
298723c22b
gluon-core: gluon-check-site: do not fail when IPKG_INSTROOT is unset 2021-07-12 17:06:49 +02:00
Matthias Schiffer
eb3fad4bae
build: move check_site.lua main script into gluon-core package
Installing the script into the image allows site checks to run for
manual package installations via opkg.
2021-07-12 17:06:35 +02:00
Martin Weinelt
97f6710d45
Merge pull request #2259 from blocktrron/bugfix-util-file-contains-line-exists
gluon-core: util: check if file exists prior to reading
2021-07-01 03:42:36 +02:00
David Bauer
ff9f295f7d gluon-core: util: check if file exists prior to reading
The file_contains_line helper function was not testing whether a file
exists or not prior attempting to read from it.

Add this check to circumvent errors on the private WiFi config in
case the hwflags file is missing.

Reported-by: Tom Herbers <freifunk@tomherbers.de>
Tested-by: Tom Herbers <freifunk@tomherbers.de>
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-07-01 03:14:08 +02:00
David Bauer
439b3e0208 gluon-core: read NanoPi R2S primary MAC from LAN board data
The relevant entry for the primary MAC location was lost when rebasing
the patch on OpenWrt 21.02.

Fixes commit ded4b8a711 ("rockchip-armv8: add FriendlyARM NanoPi R2S")

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-07-01 03:05:50 +02:00
David Bauer
260a75cd59 gluon-core: use HE radio mode if available
Configure a radio for HE (802.11ax) operation in case it's supported by
the hardware. This can be the case for 2.4 GHz as well as 5 GHz.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-06-29 22:23:05 +02:00
Martin Weinelt
4f53b9848c
Merge pull request #2248 from blocktrron/pr-ar71xx-cleanup 2021-06-26 23:53:23 +02:00
David Bauer
69ba8e3cfe gluon-core: fix handling of multi-port interfaces
Multi-port interfaces are stored in the network config as an array using
the ports key.
2021-06-26 19:56:17 +02:00