diff --git a/.github/filters.yml b/.github/filters.yml
index 0a812af9..4ef57a1b 100644
--- a/.github/filters.yml
+++ b/.github/filters.yml
@@ -4,6 +4,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk"
],
@@ -12,6 +13,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk"
],
@@ -20,6 +22,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk",
"targets/bcm27xx.inc"
@@ -29,6 +32,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk",
"targets/bcm27xx.inc"
@@ -38,6 +42,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk"
],
@@ -46,6 +51,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk"
],
@@ -54,6 +60,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk"
],
@@ -62,6 +69,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk"
],
@@ -70,6 +78,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk"
],
@@ -78,6 +87,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk"
],
@@ -86,6 +96,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk"
],
@@ -94,6 +105,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk"
],
@@ -102,6 +114,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk"
],
@@ -110,6 +123,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk"
],
@@ -118,6 +132,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk"
],
@@ -126,6 +141,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk"
],
@@ -134,6 +150,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk",
"targets/x86.inc"
@@ -143,6 +160,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk"
],
@@ -151,6 +169,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk",
"targets/x86.inc"
@@ -160,6 +179,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk",
"targets/x86.inc",
@@ -171,6 +191,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk",
"targets/bcm27xx.inc"
@@ -180,6 +201,7 @@
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk"
]
diff --git a/contrib/actions/generate-target-filters.py b/contrib/actions/generate-target-filters.py
index b74bfe4e..d3a0adf1 100755
--- a/contrib/actions/generate-target-filters.py
+++ b/contrib/actions/generate-target-filters.py
@@ -13,6 +13,7 @@ common = [
"modules",
"Makefile",
"patches/**",
+ "scripts/**",
"targets/generic",
"targets/targets.mk",
]
diff --git a/docs/dev/wan.rst b/docs/dev/uplink.rst
similarity index 86%
rename from docs/dev/wan.rst
rename to docs/dev/uplink.rst
index ec9d942b..4d48168d 100644
--- a/docs/dev/wan.rst
+++ b/docs/dev/uplink.rst
@@ -1,5 +1,5 @@
-WAN support
-===========
+Uplink support
+==============
As the WAN port of a node will be connected to a user's private network, it
is essential that the node only uses the WAN when it is absolutely necessary.
@@ -11,11 +11,12 @@ 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 (labelled as WAN/LAN), this port is used as WAN.
-
-This behavior can be reversed using the ``single_as_lan`` site.conf option.
+If a device has only a single Ethernet port (or group of ports), it will be
+used as an uplink port even when it is not labelled as "WAN" by default. This
+behavior can be controlled using the ``interfaces.single.default_roles``
+site.conf option. It is also possible to alter the interface assignment after
+installation by modifying ``/etc/config/gluon`` and running
+``gluon-reconfigure``.
Routing tables
~~~~~~~~~~~~~~
diff --git a/docs/dev/web/controller.rst b/docs/dev/web/controller.rst
index 3f63ef01..2f0ab733 100644
--- a/docs/dev/web/controller.rst
+++ b/docs/dev/web/controller.rst
@@ -74,8 +74,7 @@ Useful functions:
- *header* (*key*, *value*): Adds an HTTP header to the reply to be sent to
the client. Has no effect when non-header data has already been written.
- *prepare_content* (*mime*): Sets the *Content-Type* header to the given MIME
- type, potentially setting additional headers or modifying the MIME type to
- accommodate browser quirks
+ type
- *write* (*data*, ...): Sends the given data to the client. If headers have not
been sent, it will be done before the data is written.
diff --git a/docs/features/multidomain.rst b/docs/features/multidomain.rst
index 80cae0de..43f343bb 100644
--- a/docs/features/multidomain.rst
+++ b/docs/features/multidomain.rst
@@ -130,9 +130,7 @@ site.conf only variables
- authorized_keys
- default_domain
- poe_passthrough
- - mesh_on_wan
- - mesh_on_lan
- - single_as_lan
+ - interfaces.*.default_roles
- setup_mode.skip
- autoupdater.branch
- mesh_vpn.enabled
diff --git a/docs/features/private-wlan.rst b/docs/features/private-wlan.rst
index 3c26c8f8..41664b73 100644
--- a/docs/features/private-wlan.rst
+++ b/docs/features/private-wlan.rst
@@ -1,8 +1,8 @@
Private WLAN
============
-It is possible to set up a private WLAN that bridges the WAN port and is separated from the mesh network.
-Please note that you should not enable ``mesh_on_wan`` simultaneously.
+It is possible to set up a private WLAN that bridges the uplink port and is separated from the mesh network.
+Please note that you should not enable Wired Mesh on the uplink port at the same time.
The private WLAN is encrypted using WPA2 by default. On devices with enough flash and a supported radio,
WPA3 or WPA2/WPA3 mixed-mode can be used instead of WPA2. For this to work, the ``wireless-encryption-wpa3``
diff --git a/docs/features/vpn.rst b/docs/features/vpn.rst
index c1ed9336..bc2bf733 100644
--- a/docs/features/vpn.rst
+++ b/docs/features/vpn.rst
@@ -1,57 +1,121 @@
-Mesh-VPN
+Mesh VPN
========
-Gluon integrates several OSI-Layer 2 tunneling protocols to
-enable interconnects between local meshes and provide
-internetwork access. Available protocols currently are:
+Gluon integrates several layer 2 tunneling protocols to
+allow connections between local meshes through the internet.
-- fastd
-- L2TPv3 (via tunneldigger)
+Protocol handlers
+^^^^^^^^^^^^^^^^^
-fastd is a lightweight userspace tunneling daemon, that
+There are currently three protocol handlers which can be selected
+via ``GLUON_FEATURES`` in ``site.mk``:
+
+mesh-vpn-fastd
+~~~~~~~~~~~~~~
+
+fastd is a lightweight userspace tunneling daemon that
implements cipher suites that are specifically designed
to work well on embedded devices. It offers encryption
-and authentication. Its primary drawback are the necessary
-context-switches when forwarding packets.
+and authentication.
+The primary drawback of fastd's encrypted connection modes
+is the necessary context switches when forwarding packets.
+A kernel-supported L2TPv3 offloading option is available to
+work around the context-switching bottleneck, but it comes
+at the cost of losing the ability to protect tunnel connections
+against eavesdropping or manipulation.
-L2TPv3 is an in-kernel tunneling protocol that performs well,
-but offers no security properties by itself.
-The brokering of the tunnel happens through tunneldigger,
-its primary drawback being the lack of IPv6 support.
+mesh-vpn-tunneldigger
+~~~~~~~~~~~~~~~~~~~~~
+
+Tunneldigger always uses L2TPv3, generally achieving the same
+performance as fastd with the ``null@l2tp`` method, but offering
+no security.
+Tunneldigger's primary drawback is the lack of IPv6 support.
+It also provides less configurability than fastd.
+
+mesh-vpn-wireguard (experimental)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Wireguard is a new tunneling software that offers modern encryption
+methods and is implemented in the kernel, resulting in high throughput.
+It is implemented in Gluon using the *wgpeerselector* tool.
fastd
------
+^^^^^
-Configurable Cipher
-^^^^^^^^^^^^^^^^^^^
+Methods
+~~~~~~~
+fastd offers various different connection "methods" with different
+security properties that can be configured in the site configuration.
-From the site configuration fastd can be allowed to offer
+The following methods are currently recommended:
+
+- ``salsa2012+umac``: Encrypted + authenticated
+- ``null+salsa2012+umac``: Unencrypted, authenticated
+- ``null@l2tp``: Unencrypted, unauthenticated
+
+Multiple methods can be listed in ``site.conf``. The first listed method
+supported by both the node and its peer will be used.
+
+The use of the ``null@l2tp`` method with offloading enabled can provide a
+considerable performance gain, especially on weaker embedded hardware.
+For L2TP offloading, the ``mesh-vpn-fastd-l2tp`` feature needs to be enabled in
+``site.mk``.
+
+Configurable Method
+~~~~~~~~~~~~~~~~~~~
+
+From the site configuration, fastd can be allowed to offer
toggleable encryption in the config mode with the intent to
-increase throughput, although in practice the gain is minimal.
+increase throughput.
-**Site configuration:**
+There is also an older unprotected method ``null``. Use of the newer
+``null@l2tp`` method is generally recommended over ``null``, as the
+performance gains provided by the latter (compared to the encrypted
+and authenticated methods) are very small.
-1) Add the feature ``web-mesh-vpn-fastd`` in ``site.mk``
-2) Set ``mesh_vpn.fastd.configurable = true`` in ``site.conf``
-3) Optionally add ``null`` to the ``mesh_vpn.fastd.methods`` table if you want "Performance mode" as default (not recommended)
+Site configuration
+------------------
-**Gateway configuration:**
+1)
+ Add the feature ``web-mesh-vpn-fastd`` in ``site.mk``
+2)
+ Set ``mesh_vpn.fastd.configurable = true`` in ``site.conf``
+3)
+ Optionally, add ``null@l2tp`` to the ``mesh_vpn.fastd.methods`` table if you want
+ "Performance mode" as default (not recommended)
-1) Prepend the ``null`` cipher in fastd's method list
+Gateway / Supernode Configuration
+---------------------------------
+When only using the ``null`` or ``null@l2tp`` methods without offloading,
+simply add these methods to the front of the method list. ``null@l2tp``
+should always appear before ``null`` in the configuration when both are enabled.
+fastd v22 or newer is needed for the ``null@l2tp`` method.
+
+It is often not necessary to enable L2TP offloading on supernodes for
+performance reasons. Nodes using offloading can communicate with supornodes that
+don't use offloading as long as both use the ``null@l2tp`` method.
+
+To enable L2TP offloading on the supornodes as well, it is recommended to study
+the fastd documentation section pertaining to the `offload configuration option
+`_.
+
+Note that in ``multitap`` mode, which is required when using
+L2TP offloading, fastd will create one interface per peer
+on the supernode's side and it is the administrator's
+responsibility to ensure that these interfaces are handled correctly.
+In batman-adv-based setups this involves adding the dynamically created
+interfaces to an batadv interface using fastd's ``on up`` scripts or some
+network configuration daemon like systemd-networkd.
+
+Config Mode
+-----------
-**Config Mode:**
The resulting firmware will allow users to choose between secure (encrypted) and fast (unencrypted) transport.
.. image:: fastd_mode.gif
-**Unix socket:**
-To confirm whether the correct cipher is being used, fastd's unix
-socket can be interrogated, after installing for example `socat`.
-
-::
-
- opkg update
- opkg install socat
- socat - UNIX-CONNECT:/var/run/fastd.mesh_vpn.socket
+To confirm whether the correct cipher is being used, the log output
+of fastd can be checked using ``logread``.
diff --git a/docs/features/wired-mesh.rst b/docs/features/wired-mesh.rst
index 7f99c3c0..b48ec072 100644
--- a/docs/features/wired-mesh.rst
+++ b/docs/features/wired-mesh.rst
@@ -50,8 +50,8 @@ Configuration
Both Mesh-on-WAN and Mesh-on-LAN can be configured on the "Network" page
of the *Advanced settings* (if the package ``gluon-web-network`` is installed).
-It is also possible to enable Mesh-on-WAN and Mesh-on-LAN by default by
-adding ``mesh_on_wan = true`` and ``mesh_on_lan = true`` to ``site.conf``.
+It is also possible to enable Mesh-on-WAN and Mesh-on-LAN by default by adding
+the ``mesh`` role to the ``interfaces.*.default_roles`` options in site.conf.
Commandline
===========
diff --git a/docs/index.rst b/docs/index.rst
index d8e39465..daa91d1d 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -39,7 +39,7 @@ Several Freifunk communities in Germany use Gluon as the foundation of their Fre
dev/hardware
dev/packages
dev/upgrade
- dev/wan
+ dev/uplink
dev/mac_addresses
dev/site_library
dev/build
@@ -78,61 +78,7 @@ Several Freifunk communities in Germany use Gluon as the foundation of their Fre
:caption: Releases
:maxdepth: 1
- releases/v2021.1.1
- releases/v2021.1
- releases/v2020.2.3
- releases/v2020.2.2
- releases/v2020.2.1
- releases/v2020.2
- releases/v2020.1.4
- releases/v2020.1.3
- releases/v2020.1.2
- releases/v2020.1.1
- releases/v2020.1
- releases/v2019.1.3
- releases/v2019.1.2
- releases/v2019.1.1
- releases/v2019.1
- releases/v2018.2.4
- releases/v2018.2.3
- releases/v2018.2.2
- releases/v2018.2.1
- releases/v2018.2
- releases/v2018.1.4
- releases/v2018.1.3
- releases/v2018.1.2
- releases/v2018.1.1
- releases/v2018.1
- releases/v2017.1.8
- releases/v2017.1.7
- releases/v2017.1.6
- releases/v2017.1.5
- releases/v2017.1.4
- releases/v2017.1.3
- releases/v2017.1.2
- releases/v2017.1.1
- releases/v2017.1
- releases/v2016.2.7
- releases/v2016.2.6
- releases/v2016.2.5
- releases/v2016.2.4
- releases/v2016.2.3
- releases/v2016.2.2
- releases/v2016.2.1
- releases/v2016.2
- releases/v2016.1.6
- releases/v2016.1.5
- releases/v2016.1.4
- releases/v2016.1.3
- releases/v2016.1.2
- releases/v2016.1.1
- releases/v2016.1
- releases/v2015.1.2
- releases/v2015.1.1
- releases/v2015.1
- releases/v2014.4
- releases/v2014.3.1
- releases/v2014.3
+ releases/index
License
-------
diff --git a/docs/releases/index.rst b/docs/releases/index.rst
new file mode 100644
index 00000000..ddda8511
--- /dev/null
+++ b/docs/releases/index.rst
@@ -0,0 +1,118 @@
+Release Notes
+=============
+
+.. toctree::
+ :caption: Gluon 2021.1
+ :maxdepth: 2
+
+ v2021.1.1
+ v2021.1
+
+.. toctree::
+ :caption: Gluon 2020.2
+ :maxdepth: 2
+
+ v2020.2.3
+ v2020.2.2
+ v2020.2.1
+ v2020.2
+
+.. toctree::
+ :caption: Gluon 2020.1
+ :maxdepth: 2
+
+ v2020.1.4
+ v2020.1.3
+ v2020.1.2
+ v2020.1.1
+ v2020.1
+
+.. toctree::
+ :caption: Gluon 2019.1
+ :maxdepth: 2
+
+ v2019.1.3
+ v2019.1.2
+ v2019.1.1
+ v2019.1
+
+.. toctree::
+ :caption: Gluon 2018.2
+ :maxdepth: 2
+
+ v2018.2.4
+ v2018.2.3
+ v2018.2.2
+ v2018.2.1
+ v2018.2
+
+.. toctree::
+ :caption: Gluon 2018.1
+ :maxdepth: 2
+
+ v2018.1.4
+ v2018.1.3
+ v2018.1.2
+ v2018.1.1
+ v2018.1
+
+.. toctree::
+ :caption: Gluon 2017.1
+ :maxdepth: 2
+
+ v2017.1.8
+ v2017.1.7
+ v2017.1.6
+ v2017.1.5
+ v2017.1.4
+ v2017.1.3
+ v2017.1.2
+ v2017.1.1
+ v2017.1
+
+.. toctree::
+ :caption: Gluon 2016.2
+ :maxdepth: 2
+
+ v2016.2.7
+ v2016.2.6
+ v2016.2.5
+ v2016.2.4
+ v2016.2.3
+ v2016.2.2
+ v2016.2.1
+ v2016.2
+
+.. toctree::
+ :caption: Gluon 2016.1
+ :maxdepth: 2
+
+ v2016.1.6
+ v2016.1.5
+ v2016.1.4
+ v2016.1.3
+ v2016.1.2
+ v2016.1.1
+ v2016.1
+
+.. toctree::
+ :caption: Gluon 2015.1
+ :maxdepth: 2
+
+ v2015.1.2
+ v2015.1.1
+ v2015.1
+
+.. toctree::
+ :caption: Gluon 2014.4
+ :maxdepth: 2
+
+ v2014.4
+
+.. toctree::
+ :caption: Gluon 2014.3
+ :maxdepth: 2
+
+ v2014.3.1
+ v2014.3
+
diff --git a/docs/site-example/i18n/de.po b/docs/site-example/i18n/de.po
index 51b8e71c..f2db6eef 100644
--- a/docs/site-example/i18n/de.po
+++ b/docs/site-example/i18n/de.po
@@ -45,7 +45,7 @@ msgstr ""
"selbstverständlich vertraulich behandelt und nicht weitergegeben."
"
Dein Knoten startet gerade neu und wird anschließend versuchen, sich mit "
diff --git a/docs/site-example/i18n/en.po b/docs/site-example/i18n/en.po
index eef8bd08..4f393860 100644
--- a/docs/site-example/i18n/en.po
+++ b/docs/site-example/i18n/en.po
@@ -41,7 +41,7 @@ msgstr ""
"\">keys@alpha-centauri.freifunk.net. Of course, your e-mail address will "
"be treated confidentially and will not be passed on.
"
diff --git a/docs/user/site.rst b/docs/user/site.rst
index 28297e38..5b2e0eeb 100644
--- a/docs/user/site.rst
+++ b/docs/user/site.rst
@@ -399,17 +399,49 @@ mesh_vpn
},
}
-mesh_on_wan \: optional
- Enables the mesh on the WAN port (``true`` or ``false``).
+interfaces \: optional
+ Default setup for Ethernet ports.
::
- mesh_on_wan = true,
+ interfaces = {
+ lan = {
+ default_roles = { 'client', 'mesh' },
+ },
+ wan = {
+ default_roles = { 'uplink', 'mesh' },
+ },
+ single = {
+ default_roles = { 'uplink', 'mesh' },
+ },
+ },
-mesh_on_lan \: optional
- Enables the mesh on the LAN port (``true`` or ``false``).
- ::
+ For devices that have two distinct Ethernet ports or port groups (often
+ labelled WAN and LAN), the ``lan`` and ``wan`` sections are used. When there
+ is only one port (group), ``single`` is used instead.
- mesh_on_lan = true,
+ Available interface roles:
+
+ - ``client``: Port allows regular clients to connect to the mesh
+ - ``uplink``: Port is used to establish Mesh VPN connections
+ - ``mesh``: Wired meshing to another Gluon or Gluon-compatible node
+
+ The ``client`` role requires exclusive control over an interface. When
+ the ``client`` role is assigned to an interface at the same time as other
+ roles (like ``'client', 'mesh'`` in the above example), the other roles take
+ precedence (enabling ``mesh``, but not ``client`` in the example).
+
+ Such a default configuration still fulfills a purpose (and is in fact the
+ recommended way to enable "Mesh-on-LAN" by default): The "LAN interface
+ meshing" checkbox in the advanced network settings will only add or remove
+ the ``mesh`` role, so the ``client`` role must already be in the configuration
+ to make the LAN port a regular client interface when the checkbox is disabled.
+
+ All interface settings are optional. If unset, the following defaults are
+ used:
+
+ - ``lan``: ``{ 'client' }``
+ - ``wan``: ``{ 'uplink' }``
+ - ``single``: Same as ``wan``
poe_passthrough \: optional
Enable PoE passthrough by default on hardware with such a feature.
@@ -471,7 +503,7 @@ config_mode \: optional
*openlayers_url* allows to override the base URL of the
*build/ol.js* and *css/ol.css* files (the default is
- ``https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.2.0``).
+ ``https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@35ffe7626ce16c372143f3c903950750075e7068/en/v5.3.0``).
It is also possible to replace the default tile layer (which is OpenStreetMap)
with a custom one using the *tile_layer* section. Only XYZ layers are supported
at this point.
diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst
index ec7808dd..378a17ad 100644
--- a/docs/user/supported_devices.rst
+++ b/docs/user/supported_devices.rst
@@ -4,6 +4,10 @@ Supported Devices & Architectures
ath79-generic
--------------
+* AVM
+
+ - Fritz!WLAN Repeater 450E [#avmflash]_
+
* devolo
- WiFi pro 1200e [#lan_as_wan]_
@@ -13,6 +17,14 @@ ath79-generic
- WiFi pro 1750i
- WiFi pro 1750x
+* D-Link
+
+ - DAP-1330 A1 [#lan_as_wan]_
+ - DAP-1365 A1 [#lan_as_wan]_
+ - DAP-2660 A1 [#lan_as_wan]_
+ - DIR-505 A1 [#lan_as_wan]_
+ - DIR-505 A2 [#lan_as_wan]_
+
* Enterasys
- WS-AP3705i
@@ -33,6 +45,20 @@ ath79-generic
- Omega [#modular_ethernet]_
+* OpenMesh
+
+ - A40
+ - A60
+ - MR600 (v1, v2)
+ - MR900 (v1, v2)
+ - MR1750 (v1, v2)
+ - OM2P (v1, v2, v4)
+ - OM2P-HS (v1, v2, v3, v4)
+ - OM2P-LC
+ - OM5P
+ - OM5P-AC (v1, v2)
+ - OM5P-AN
+
* Plasma Cloud
- PA300
@@ -46,14 +72,25 @@ ath79-generic
- Archer A7 (v5)
- Archer C6 (v2)
+ - Archer C7 (v2)
+ - CPE210 (v1.0, v1.1, v2.0)
- CPE220 (v3.0)
+ - CPE510 (v1.0, v1.1)
- CPE510 (v2.0)
- CPE510 (v3.0)
- EAP225-Outdoor (v1)
- TL-WDR3600 (v1)
- TL-WDR4300 (v1)
+ - TL-WR1043N/ND (v3, v4)
- WBS210 (v2.0)
+* Ubiquiti
+
+ - UniFi AC Mesh
+ - UniFi AP
+ - UniFi AP LR
+ - UniFi AP PRO
+
ath79-nand
----------
@@ -330,7 +367,7 @@ Footnotes
developer documentation: :ref:`device-class-definition`.
.. [#avmflash]
- For instructions on how to flash AVM devices, visit https://fritzfla.sh
+ For instructions on how to flash AVM devices, visit https://fritz-tools.readthedocs.io
.. [#eva_ramboot]
For instructions on how to flash AVM NAND devices, see the respective
diff --git a/modules b/modules
index 5654db74..27efc295 100644
--- a/modules
+++ b/modules
@@ -2,15 +2,15 @@ GLUON_FEEDS='packages routing gluon'
OPENWRT_REPO=https://github.com/openwrt/openwrt.git
OPENWRT_BRANCH=openwrt-21.02
-OPENWRT_COMMIT=97b95ef8b9186518cda6f2d3cec8a01860fae2e7
+OPENWRT_COMMIT=cd17ca7d6f305ff93ee5436b883bc5ad3767e3a7
PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git
PACKAGES_PACKAGES_BRANCH=openwrt-21.02
-PACKAGES_PACKAGES_COMMIT=444b64e36cfb9d1dbbb6733bd713aacd2f91a821
+PACKAGES_PACKAGES_COMMIT=ee69afe6f1c0ff9d257b5478ae6d50b18e023519
PACKAGES_ROUTING_REPO=https://github.com/openwrt/routing.git
PACKAGES_ROUTING_BRANCH=openwrt-21.02
-PACKAGES_ROUTING_COMMIT=c2e138d49fa4796ab03f0eadb7b4d37aac75498a
+PACKAGES_ROUTING_COMMIT=7c7d11e2904494820d5c28249bff8abd46493184
PACKAGES_GLUON_REPO=https://github.com/freifunk-gluon/packages.git
PACKAGES_GLUON_COMMIT=308166e3c6b2d571606dd1dbfadd2bb8e31d8f90
diff --git a/package/features b/package/features
index c6e94a1a..da68b369 100644
--- a/package/features
+++ b/package/features
@@ -16,7 +16,12 @@ when(_'web-wizard' and _'autoupdater', {
'gluon-config-mode-autoupdater',
})
-when(_'web-wizard' and (_'mesh-vpn-fastd' or _'mesh-vpn-tunneldigger' or _'mesh-vpn-wireguard'), {
+when(_'web-wizard' and (
+ _'mesh-vpn-fastd' or
+ _'mesh-vpn-fastd-l2tp' or
+ _'mesh-vpn-tunneldigger' or
+ _'mesh-vpn-wireguard'
+), {
'gluon-config-mode-mesh-vpn',
})
diff --git a/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/300-gluon-client-bridge-network b/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/300-gluon-client-bridge-network
index 490325cf..3d4dbac3 100755
--- a/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/300-gluon-client-bridge-network
+++ b/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/300-gluon-client-bridge-network
@@ -6,26 +6,9 @@ local util = require 'gluon.util'
local uci = require('simple-uci').cursor()
-local interfaces = uci:get('network', 'client', 'ifname') or {}
-
-if type(interfaces) == 'string' then
- local ifname = interfaces
- interfaces = {}
- for iface in ifname:gmatch('%S+') do
- util.add_to_set(interfaces, iface)
- end
-end
-
-if sysconfig.lan_ifname and uci:get_bool('network', 'mesh_lan', 'disabled') then
- for lanif in sysconfig.lan_ifname:gmatch('%S+') do
- util.add_to_set(interfaces, lanif)
- end
-end
-
+local interfaces = util.get_role_interfaces(uci, 'client', true)
util.add_to_set(interfaces, 'local-port')
-
-uci:delete('network', 'client')
uci:section('network', 'interface', 'client', {
type = 'bridge',
ifname = interfaces,
diff --git a/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/310-gluon-client-bridge-local-node b/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/310-gluon-client-bridge-local-node
index 824d8d40..e67dc7d5 100755
--- a/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/310-gluon-client-bridge-local-node
+++ b/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/310-gluon-client-bridge-local-node
@@ -10,7 +10,6 @@ local uci = require('simple-uci').cursor()
local next_node = site.next_node({})
-uci:delete('network', 'local_node_dev')
uci:section('network', 'device', 'local_node_dev', {
type = 'veth',
name = 'local-node',
@@ -31,7 +30,6 @@ if next_node.ip6 then
ip6 = next_node.ip6 .. '/128'
end
-uci:delete('network', 'local_node')
uci:section('network', 'interface', 'local_node', {
ifname = 'local-node',
proto = 'static',
diff --git a/package/gluon-config-mode-core/files/lib/gluon/config-mode/www/index.html b/package/gluon-config-mode-core/files/lib/gluon/config-mode/www/index.html
index 292129f6..e42b9eed 100644
--- a/package/gluon-config-mode-core/files/lib/gluon/config-mode/www/index.html
+++ b/package/gluon-config-mode-core/files/lib/gluon/config-mode/www/index.html
@@ -1,10 +1,10 @@
-
+
-
-
-
-
+
+
+
+
diff --git a/package/gluon-config-mode-core/luasrc/lib/gluon/config-mode/model/gluon-config-mode/wizard.lua b/package/gluon-config-mode-core/luasrc/lib/gluon/config-mode/model/gluon-config-mode/wizard.lua
index dfc4ab4c..edfe0bc3 100644
--- a/package/gluon-config-mode-core/luasrc/lib/gluon/config-mode/model/gluon-config-mode/wizard.lua
+++ b/package/gluon-config-mode-core/luasrc/lib/gluon/config-mode/model/gluon-config-mode/wizard.lua
@@ -22,7 +22,7 @@ function f:write()
uci:set("gluon-setup-mode", uci:get_first("gluon-setup-mode", "setup_mode"), "configured", true)
uci:save("gluon-setup-mode")
- os.execute('gluon-reconfigure')
+ os.execute('exec gluon-reconfigure >/dev/null')
f.template = "wizard/reboot"
f.package = "gluon-config-mode-core"
diff --git a/package/gluon-config-mode-theme/files/lib/gluon/config-mode/view/theme/layout.html b/package/gluon-config-mode-theme/files/lib/gluon/config-mode/view/theme/layout.html
index c80cd4b3..865ec2aa 100644
--- a/package/gluon-config-mode-theme/files/lib/gluon/config-mode/view/theme/layout.html
+++ b/package/gluon-config-mode-theme/files/lib/gluon/config-mode/view/theme/layout.html
@@ -82,7 +82,7 @@ You may obtain a copy of the License at
end
%>
-
+
<%
subtree(append(prefix, name), node.nodes[name], ...)
%>
@@ -94,13 +94,13 @@ You may obtain a copy of the License at
subtree({path}, root.nodes[category], ...)
end
- http:prepare_content("application/xhtml+xml")
+ http:prepare_content("text/html")
-%>
-
+
-
-
+
+
<%| hostname .. ((rnode and rnode.title) and ' - ' .. title(rnode) or '') %>
@@ -134,7 +134,7 @@ You may obtain a copy of the License at
diff --git a/package/gluon-core/check_site.lua b/package/gluon-core/check_site.lua
index 4cb44d5b..103cb929 100644
--- a/package/gluon-core/check_site.lua
+++ b/package/gluon-core/check_site.lua
@@ -74,6 +74,11 @@ need_string_match(in_domain({'next_node', 'ip4'}), '^%d+.%d+.%d+.%d+$', false)
need_boolean(in_domain({'mesh', 'vxlan'}), false)
-need_boolean(in_site({'mesh_on_wan'}), false)
-need_boolean(in_site({'mesh_on_lan'}), false)
-need_boolean(in_site({'single_as_lan'}), false)
+local interfaces_roles = {'client', 'uplink', 'mesh'}
+for _, config in ipairs({'wan', 'lan', 'single'}) do
+ need_array_of(in_site({'interfaces', config, 'default_roles'}), interfaces_roles, false)
+end
+
+obsolete({'mesh_on_wan'}, 'Use interfaces.wan.default_roles.')
+obsolete({'mesh_on_lan'}, 'Use interfaces.lan.default_roles.')
+obsolete({'single_as_lan'}, 'Use interfaces.single.default_roles.')
diff --git a/package/gluon-core/files/lib/gluon/upgrade/001-reset-uci b/package/gluon-core/files/lib/gluon/upgrade/001-reset-uci
new file mode 100755
index 00000000..4981390d
--- /dev/null
+++ b/package/gluon-core/files/lib/gluon/upgrade/001-reset-uci
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+NETWORK_CFG='/etc/config/network'
+NETWORK_SAVED="${NETWORK_CFG}_gluon-old"
+
+SYSTEM_CFG='/etc/config/system'
+SYSTEM_SAVED="${SYSTEM_CFG}_gluon-old"
+
+# Make sure everything is saved before we move away the config files
+uci commit
+
+# Save old configs (unless there is already a saved config,
+# which means that the previous upgrade was interrupted)
+if [ -s "$NETWORK_CFG" ] && ! [ -s "$NETWORK_SAVED" ]; then
+ mv -f "$NETWORK_CFG" "$NETWORK_SAVED"
+fi
+if [ -s "$SYSTEM_CFG" ] && ! [ -s "$SYSTEM_SAVED" ]; then
+ mv -f "$SYSTEM_CFG" "$SYSTEM_SAVED"
+fi
+
+# Generate a new network config
+rm -f /etc/board.json "$NETWORK_CFG" "$SYSTEM_CFG"
+config_generate
diff --git a/package/gluon-core/files/lib/gluon/upgrade/998-commit b/package/gluon-core/files/lib/gluon/upgrade/998-commit
index 8b4be6a9..9e781f34 100755
--- a/package/gluon-core/files/lib/gluon/upgrade/998-commit
+++ b/package/gluon-core/files/lib/gluon/upgrade/998-commit
@@ -4,3 +4,6 @@ uci -q batch <<-EOF
delete gluon.core.reconfigure
commit
EOF
+
+# New config is saved, we can delete the old one
+rm -f /etc/config/*_gluon-old
diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/002-migrate-system b/package/gluon-core/luasrc/lib/gluon/upgrade/002-migrate-system
new file mode 100755
index 00000000..b08dc8a3
--- /dev/null
+++ b/package/gluon-core/luasrc/lib/gluon/upgrade/002-migrate-system
@@ -0,0 +1,31 @@
+#!/usr/bin/lua
+
+local uci = require('simple-uci').cursor()
+
+-- Migrate system section
+local system = uci:get_all('system_gluon-old', '@system[0]')
+if system then
+ uci:tset('system', '@system[0]', system)
+end
+
+-- Migrate ntp section
+local ntp = uci:get_all('system_gluon-old', 'ntp')
+if ntp then
+ uci:tset('system', 'ntp', ntp)
+end
+
+-- Migrate gpio_switch sections
+--
+-- Only the value is copied from the old config, so updates to names and
+-- pins are preserved
+uci:foreach('system', 'gpio_switch', function(s)
+ local name = s['.name']
+ local value = uci:get('system_gluon-old', name, 'value')
+ if value then
+ uci:set('system', name, 'value', value)
+ end
+end)
+
+-- No other sections are migrated, so updated LED and RSSI configs can take effect
+
+uci:save('system')
diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/020-interfaces b/package/gluon-core/luasrc/lib/gluon/upgrade/020-interfaces
index 6371cc61..25542d19 100755
--- a/package/gluon-core/luasrc/lib/gluon/upgrade/020-interfaces
+++ b/package/gluon-core/luasrc/lib/gluon/upgrade/020-interfaces
@@ -1,15 +1,7 @@
#!/usr/bin/lua
-local sysconfig = require 'gluon.sysconfig'
-
--- Are we already set up?
-if sysconfig.lan_ifname or sysconfig.wan_ifname then
- os.exit(0)
-end
-
-
local platform = require 'gluon.platform'
-local site = require 'gluon.site'
+local sysconfig = require 'gluon.sysconfig'
local json = require 'jsonc'
local uci = require('simple-uci').cursor()
@@ -51,7 +43,11 @@ local lan_ifname = iface_exists(lan_interfaces)
local wan_ifname = iface_exists(wan_interfaces)
if platform.match('ath79', 'generic', {
+ 'tplink,cpe210-v1',
+ 'tplink,cpe210-v2',
+ 'tplink,cpe510-v1',
'tplink,wbs210-v2',
+ 'ubnt,unifi-ap-pro',
}) then
lan_ifname, wan_ifname = wan_ifname, lan_ifname
elseif platform.match('lantiq') then
@@ -69,19 +65,15 @@ end
if wan_ifname and lan_ifname then
sysconfig.wan_ifname = wan_ifname
sysconfig.lan_ifname = lan_ifname
+ sysconfig.single_ifname = nil
else
- local single_ifname = lan_ifname or wan_ifname
- if site.single_as_lan(false) then
- sysconfig.lan_ifname = single_ifname
- else
- sysconfig.wan_ifname = single_ifname
- end
+ sysconfig.wan_ifname = nil
+ sysconfig.lan_ifname = nil
+ sysconfig.single_ifname = lan_ifname or wan_ifname
end
-uci:delete('network', 'lan')
-uci:delete('network', 'wan')
-
uci:delete_all('network', 'device')
+uci:delete_all('network', 'interface')
uci:save('network')
diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/021-interface-roles b/package/gluon-core/luasrc/lib/gluon/upgrade/021-interface-roles
new file mode 100755
index 00000000..182c8903
--- /dev/null
+++ b/package/gluon-core/luasrc/lib/gluon/upgrade/021-interface-roles
@@ -0,0 +1,66 @@
+#!/usr/bin/lua
+
+local site = require 'gluon.site'
+local sysconfig = require 'gluon.sysconfig'
+local uci = require('simple-uci').cursor()
+local util = require 'gluon.util'
+
+-- Defaults from site.conf
+local roles = {
+ lan = site.interfaces.lan.roles({'client'}),
+ wan = site.interfaces.wan.roles({'uplink'}),
+}
+roles.single = site.interfaces.single.roles(roles.wan)
+
+-- Migration of Mesh-on-WAN/LAN setting from Gluon 2021.1 and older (to be removed in 2024)
+--
+-- Wired meshing is enabled for single interfaces if either of the settings
+-- was previously enabled
+local mesh_lan_disabled = uci:get('network_gluon-old', 'mesh_lan', 'disabled')
+local mesh_wan_disabled = uci:get('network_gluon-old', 'mesh_wan', 'disabled')
+if mesh_wan_disabled == '0' then
+ util.add_to_set(roles.wan, 'mesh')
+ util.add_to_set(roles.single, 'mesh')
+elseif mesh_wan_disabled == '1' then
+ util.remove_from_set(roles.wan, 'mesh')
+ util.remove_from_set(roles.single, 'mesh')
+end
+if mesh_lan_disabled == '0' then
+ util.add_to_set(roles.lan, 'mesh')
+ util.add_to_set(roles.single, 'mesh')
+elseif mesh_lan_disabled == '1' then
+ util.remove_from_set(roles.lan, 'mesh')
+ util.remove_from_set(roles.single, 'mesh')
+end
+
+-- Migration of single to WAN/LAN or vice-versa (an interface was added or removed)
+-- We identify the WAN with the single interface in this case
+--
+-- These settings only take effect when the section that is the target of the
+-- migration does not exist yet.
+if uci:get('gluon', 'iface_wan') then
+ roles.single = uci:get_list('gluon', 'iface_wan', 'role')
+end
+if uci:get('gluon', 'iface_single') then
+ roles.wan = uci:get_list('gluon', 'iface_single', 'role')
+end
+
+-- Non-existing interfaces are nil, so they will not be added to the table
+local interfaces = {
+ lan = sysconfig.lan_ifname,
+ wan = sysconfig.wan_ifname,
+ single = sysconfig.single_ifname,
+}
+
+for iface in pairs(interfaces) do
+ local section_name = 'iface_' .. iface
+ if not uci:get('gluon', section_name) then
+ uci:section('gluon', 'interface', section_name, {
+ -- / prefix refers to sysconfig ifnames
+ name = '/' .. iface,
+ role = roles[iface],
+ })
+ end
+end
+
+uci:save('gluon')
diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/110-network b/package/gluon-core/luasrc/lib/gluon/upgrade/110-network
index 79c50d27..ac084e6a 100755
--- a/package/gluon-core/luasrc/lib/gluon/upgrade/110-network
+++ b/package/gluon-core/luasrc/lib/gluon/upgrade/110-network
@@ -1,11 +1,24 @@
#!/usr/bin/lua
local uci = require('simple-uci').cursor()
-local sysconfig = require 'gluon.sysconfig'
+local util = require 'gluon.util'
+local wan = uci:get_all('network_gluon-old', 'wan') or {}
+local wan6 = uci:get_all('network_gluon-old', 'wan6') or {}
+
+uci:section('network', 'interface', 'loopback', {
+ ifname = 'lo',
+ proto = 'static',
+ ipaddr = '127.0.0.1',
+ netmask = '255.0.0.0',
+})
uci:section('network', 'interface', 'wan', {
- ifname = sysconfig.wan_ifname,
+ proto = wan.proto or 'dhcp',
+ ipaddr = wan.ipaddr,
+ netmask = wan.netmask,
+ gateway = wan.gateway,
+ ifname = util.get_role_interfaces(uci, 'uplink'),
type = 'bridge',
igmp_snooping = true,
multicast_querier = false,
@@ -13,12 +26,10 @@ uci:section('network', 'interface', 'wan', {
auto = true,
})
-if not uci:get('network', 'wan', 'proto') then
- uci:set('network', 'wan', 'proto', 'dhcp')
-end
-
-
uci:section('network', 'interface', 'wan6', {
+ proto = wan6.proto or 'dhcpv6',
+ ip6addr = wan6.ip6addr,
+ ip6gw = wan6.ip6gw,
ifname = 'br-wan',
peerdns = false,
ip6table = 1,
@@ -26,11 +37,6 @@ uci:section('network', 'interface', 'wan6', {
reqprefix = 'no',
})
-if not uci:get('network', 'wan6', 'proto') then
- uci:set('network', 'wan6', 'proto', 'dhcpv6')
-end
-
-
uci:section('network', 'rule6', 'wan6_lookup', {
mark = '0x01/0x01',
lookup = 1,
diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless b/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless
index b0a5485f..604e33a8 100755
--- a/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless
+++ b/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless
@@ -106,8 +106,6 @@ end
local function delete_ibss(radio_name)
local name = 'ibss_' .. radio_name
- uci:delete('network', name)
- uci:delete('network', name .. '_vlan')
uci:delete('wireless', name)
end
@@ -118,8 +116,6 @@ local function configure_mesh(config, radio, index, suffix, disabled)
local macfilter = uci:get('wireless', name, 'macfilter')
local maclist = uci:get('wireless', name, 'maclist')
- uci:delete('network', name)
- uci:delete('network', name .. '_vlan')
uci:delete('wireless', name)
if not config then
diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/210-interface-mesh b/package/gluon-core/luasrc/lib/gluon/upgrade/210-interface-mesh
new file mode 100755
index 00000000..7e2f8471
--- /dev/null
+++ b/package/gluon-core/luasrc/lib/gluon/upgrade/210-interface-mesh
@@ -0,0 +1,48 @@
+#!/usr/bin/lua
+
+local site = require 'gluon.site'
+local uci = require('simple-uci').cursor()
+local util = require 'gluon.util'
+
+local mesh_interfaces = util.get_role_interfaces(uci, 'mesh')
+local uplink_interfaces = util.get_role_interfaces(uci, 'uplink')
+
+local mesh_interfaces_uplink = {}
+local mesh_interfaces_other = {}
+for _, iface in ipairs(mesh_interfaces) do
+ if util.contains(uplink_interfaces, iface) then
+ table.insert(mesh_interfaces_uplink, iface)
+ else
+ table.insert(mesh_interfaces_other, iface)
+ end
+end
+
+if #mesh_interfaces_uplink > 0 then
+ uci:section('network', 'interface', 'mesh_uplink', {
+ ifname = 'br-wan',
+ proto = 'gluon_wired',
+ index = 0,
+ vxlan = site.mesh.vxlan(true),
+ })
+end
+
+if #mesh_interfaces_other > 0 then
+ local iftype, ifname
+ if #mesh_interfaces_other == 1 then
+ ifname = mesh_interfaces_other[1]
+ else
+ iftype = 'bridge'
+ ifname = mesh_interfaces_other
+ end
+
+ uci:section('network', 'interface', 'mesh_other', {
+ ifname = ifname,
+ type = iftype,
+ igmp_snooping = false,
+ proto = 'gluon_wired',
+ index = 4,
+ vxlan = site.mesh.vxlan(true),
+ })
+end
+
+uci:save('network')
diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/210-interface-wan b/package/gluon-core/luasrc/lib/gluon/upgrade/210-interface-wan
deleted file mode 100755
index cf6eff71..00000000
--- a/package/gluon-core/luasrc/lib/gluon/upgrade/210-interface-wan
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/lua
-
-local site = require 'gluon.site'
-local uci = require('simple-uci').cursor()
-
-uci:section('network', 'interface', 'mesh_wan', {
- ifname = 'br-wan',
- proto = 'gluon_wired',
- index = 0,
- vxlan = site.mesh.vxlan(true),
-})
-
-local enable = site.mesh_on_wan(false)
-local old_auto = uci:get('network', 'mesh_wan', 'auto')
-local old_disabled = uci:get('network', 'mesh_wan', 'disabled')
-if old_auto ~= nil or old_disabled ~= nil then
- enable = old_auto ~= '0' and old_disabled ~= '1'
-end
-uci:set('network', 'mesh_wan', 'disabled', not enable)
-
-if uci:get('network', 'mesh_wan', 'transitive') == nil then
- uci:set('network', 'mesh_wan', 'transitive', true)
-end
-
-uci:save('network')
diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/220-interface-lan b/package/gluon-core/luasrc/lib/gluon/upgrade/220-interface-lan
deleted file mode 100755
index 55586435..00000000
--- a/package/gluon-core/luasrc/lib/gluon/upgrade/220-interface-lan
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/lua
-
-local site = require 'gluon.site'
-local util = require 'gluon.util'
-local sysconfig = require 'gluon.sysconfig'
-
-local uci = require('simple-uci').cursor()
-
-if not sysconfig.lan_ifname then
- os.exit(0)
-end
-
-uci:section('network', 'interface', 'mesh_lan', {
- ifname = sysconfig.lan_ifname,
- igmp_snooping = false,
- proto = 'gluon_wired',
- index = 4,
- vxlan = site.mesh.vxlan(true),
-})
-
-if sysconfig.lan_ifname:match(' ') then
- uci:set('network', 'mesh_lan', 'type', 'bridge')
-else
- uci:delete('network', 'mesh_lan', 'type')
-end
-
-local enable = site.mesh_on_lan(false)
-local old_auto = uci:get('network', 'mesh_lan', 'auto')
-local old_disabled = uci:get('network', 'mesh_lan', 'disabled')
-if old_auto ~= nil or old_disabled ~= nil then
- enable = old_auto ~= '0' and old_disabled ~= '1'
-end
-
-if enable then
- local interfaces = uci:get_list('network', 'client', 'ifname')
-
- if interfaces then
- for lanif in sysconfig.lan_ifname:gmatch('%S+') do
- if util.contains(interfaces, lanif) then
- enable = false
- break
- end
- end
- end
-end
-
-uci:set('network', 'mesh_lan', 'disabled', not enable)
-
-if uci:get('network', 'mesh_lan', 'transitive') == nil then
- uci:set('network', 'mesh_lan', 'transitive', true)
-end
-
-uci:save('network')
diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/300-firewall-rules b/package/gluon-core/luasrc/lib/gluon/upgrade/300-firewall-rules
index 605f6684..ef616aef 100755
--- a/package/gluon-core/luasrc/lib/gluon/upgrade/300-firewall-rules
+++ b/package/gluon-core/luasrc/lib/gluon/upgrade/300-firewall-rules
@@ -86,9 +86,9 @@ local wired_mesh_ifaces = {}
uci:foreach('network', 'interface',
function(iface)
-- Select all interfaces with proto gluon_wired except for
- -- mesh_wan into this zone, as mesh_wan is the same
+ -- mesh_uplink into this zone, as mesh_uplink is the same
-- interface as wan, which has its own zone
- if iface['proto'] == 'gluon_wired' and iface['.name'] ~= 'mesh_wan' then
+ if iface['proto'] == 'gluon_wired' and iface['.name'] ~= 'mesh_uplink' then
table.insert(wired_mesh_ifaces, iface['.name'])
end
end
diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/997-migrate-preserved b/package/gluon-core/luasrc/lib/gluon/upgrade/997-migrate-preserved
new file mode 100755
index 00000000..c40bbc9f
--- /dev/null
+++ b/package/gluon-core/luasrc/lib/gluon/upgrade/997-migrate-preserved
@@ -0,0 +1,19 @@
+#!/usr/bin/lua
+
+local uci = require('simple-uci').cursor()
+
+for _, config in ipairs({'system', 'network'}) do
+ uci:foreach(config .. '_gluon-old', nil, function(s)
+ if s.gluon_preserve ~= '1' then return end
+
+ -- Unnamed sections can't be preserved
+ if s['.anonymous'] then return end
+
+ -- We don't allow overwriting existing sections
+ if uci:get(config, s['.name']) then return end
+
+ uci:section(config, s['.type'], s['.name'], s)
+ end)
+
+ uci:save(config)
+end
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 df0eda08..737cf826 100644
--- a/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua
+++ b/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua
@@ -27,11 +27,15 @@ function M.is_outdoor_device()
'devolo,dvl1750x',
'plasmacloud,pa300',
'plasmacloud,pa300e',
+ 'tplink,cpe210-v1',
+ 'tplink,cpe210-v2',
'tplink,cpe220-v3',
+ 'tplink,cpe510-v1',
'tplink,cpe510-v2',
'tplink,cpe510-v3',
'tplink,eap225-outdoor-v1',
'tplink,wbs210-v2',
+ 'ubnt,unifiac-mesh',
}) then
return true
diff --git a/package/gluon-core/luasrc/usr/lib/lua/gluon/sysconfig.lua b/package/gluon-core/luasrc/usr/lib/lua/gluon/sysconfig.lua
index 93eb6ed1..7caf05c6 100644
--- a/package/gluon-core/luasrc/usr/lib/lua/gluon/sysconfig.lua
+++ b/package/gluon-core/luasrc/usr/lib/lua/gluon/sysconfig.lua
@@ -11,6 +11,10 @@ local function get(_, name)
end
local function set(_, name, val)
+ if val == get(nil, name) then
+ return
+ end
+
if val then
local f = io.open(sysconfigdir .. name, 'w+')
f:write(val, '\n')
diff --git a/package/gluon-core/luasrc/usr/lib/lua/gluon/util.lua b/package/gluon-core/luasrc/usr/lib/lua/gluon/util.lua
index 48b8340e..7152bc4d 100644
--- a/package/gluon-core/luasrc/usr/lib/lua/gluon/util.lua
+++ b/package/gluon-core/luasrc/usr/lib/lua/gluon/util.lua
@@ -138,6 +138,34 @@ function M.get_mesh_devices(uconn)
return devices
end
+-- Returns a list of all interfaces with a given role
+--
+-- If exclusive is set to true, only interfaces that have no other role
+-- are returned; this is used to ensure that the client role is not active
+-- at the same time as any other role
+function M.get_role_interfaces(uci, role, exclusive)
+ local ret = {}
+
+ local function add(name)
+ -- Interface names with a / prefix refer to sysconfig interfaces
+ -- (lan_ifname/wan_ifname/single_ifname)
+ if string.sub(name, 1, 1) == '/' then
+ name = sysconfig[string.sub(name, 2) .. '_ifname'] or ''
+ end
+ for iface in string.gmatch(name, '%S+') do
+ M.add_to_set(ret, iface)
+ end
+ end
+
+ uci:foreach('gluon', 'interface', function(s)
+ if M.contains(s.role, role) and (not exclusive or #s.role == 1) then
+ add(s.name)
+ end
+ end)
+
+ return ret
+end
+
-- Safe glob: returns an empty table when the glob fails because of
-- a non-existing path
function M.glob(pattern)
diff --git a/package/gluon-mesh-babel/check_site.lua b/package/gluon-mesh-babel/check_site.lua
index 5a7bf95a..acafaa6e 100644
--- a/package/gluon-mesh-babel/check_site.lua
+++ b/package/gluon-mesh-babel/check_site.lua
@@ -5,3 +5,5 @@ need_string_match(in_domain({'next_node', 'ip6'}), '^[%x:]+$', false)
need_string_match(in_domain({'next_node', 'ip4'}), '^%d+.%d+.%d+.%d+$', false)
need_string_match(in_domain({'next_node', 'mac'}), '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$', false)
+
+need_value(in_domain({'mesh', 'vxlan'}), true, false)
diff --git a/package/gluon-mesh-babel/luasrc/lib/gluon/upgrade/430-gluon-mesh-babel-add-mmfd-interface b/package/gluon-mesh-babel/luasrc/lib/gluon/upgrade/430-gluon-mesh-babel-add-mmfd-interface
index 47807d95..073d288e 100755
--- a/package/gluon-mesh-babel/luasrc/lib/gluon/upgrade/430-gluon-mesh-babel-add-mmfd-interface
+++ b/package/gluon-mesh-babel/luasrc/lib/gluon/upgrade/430-gluon-mesh-babel-add-mmfd-interface
@@ -2,7 +2,6 @@
local uci = require('simple-uci').cursor()
-uci:delete('network', 'mmfd')
uci:section('network', 'interface', 'mmfd', {
proto = 'static',
ifname = 'mmfd0',
diff --git a/package/gluon-mesh-batman-adv/luasrc/lib/gluon/upgrade/310-gluon-mesh-batman-adv-mesh b/package/gluon-mesh-batman-adv/luasrc/lib/gluon/upgrade/310-gluon-mesh-batman-adv-mesh
index 40943207..977b44d1 100755
--- a/package/gluon-mesh-batman-adv/luasrc/lib/gluon/upgrade/310-gluon-mesh-batman-adv-mesh
+++ b/package/gluon-mesh-batman-adv/luasrc/lib/gluon/upgrade/310-gluon-mesh-batman-adv-mesh
@@ -9,14 +9,12 @@ local uci = require('simple-uci').cursor()
uci:delete('batman-adv', 'bat0')
uci:save('batman-adv')
-local gw_mode = uci:get('network', 'gluon_bat0', 'gw_mode') or 'client'
-uci:delete('network', 'gluon_bat0')
+local gw_mode = uci:get('network_gluon-old', 'gluon_bat0', 'gw_mode') or 'client'
uci:section('network', 'interface', 'gluon_bat0', {
proto = 'gluon_bat0',
gw_mode = gw_mode,
})
-uci:delete('network', 'bat0')
uci:section('network', 'interface', 'bat0', {
ifname = 'bat0',
proto = 'none',
diff --git a/package/gluon-mesh-batman-adv/luasrc/lib/gluon/upgrade/320-gluon-mesh-batman-adv-client-bridge b/package/gluon-mesh-batman-adv/luasrc/lib/gluon/upgrade/320-gluon-mesh-batman-adv-client-bridge
index fc14a6e6..1ea64049 100755
--- a/package/gluon-mesh-batman-adv/luasrc/lib/gluon/upgrade/320-gluon-mesh-batman-adv-client-bridge
+++ b/package/gluon-mesh-batman-adv/luasrc/lib/gluon/upgrade/320-gluon-mesh-batman-adv-client-bridge
@@ -21,7 +21,6 @@ uci:section('network', 'interface', 'client', {
query_response_interval = 500,
})
-uci:delete('network', 'local_node_route6')
uci:section('network', 'route6', 'local_node_route6', {
interface = 'client',
target = site.prefix6(),
diff --git a/package/gluon-mesh-batman-adv/luasrc/lib/gluon/upgrade/330-gluon-mesh-batman-adv-mac-addresses b/package/gluon-mesh-batman-adv/luasrc/lib/gluon/upgrade/330-gluon-mesh-batman-adv-mac-addresses
index d323c863..09639e34 100755
--- a/package/gluon-mesh-batman-adv/luasrc/lib/gluon/upgrade/330-gluon-mesh-batman-adv-mac-addresses
+++ b/package/gluon-mesh-batman-adv/luasrc/lib/gluon/upgrade/330-gluon-mesh-batman-adv-mac-addresses
@@ -8,8 +8,8 @@ local uci = require('simple-uci').cursor()
-- fix up potentially duplicate MAC addresses (for meshing)
if not site.mesh.vxlan(true) then
uci:set('network', 'wan', 'macaddr', util.generate_mac(0))
-else
- uci:delete('network', 'wan', 'macaddr')
end
-uci:set('network', 'mesh_lan', 'macaddr', util.generate_mac(4))
+if uci:get('network', 'mesh_other') then
+ uci:set('network', 'mesh_other', 'macaddr', util.generate_mac(4))
+end
uci:save('network')
diff --git a/package/gluon-mesh-vpn-fastd-l2tp/Makefile b/package/gluon-mesh-vpn-fastd-l2tp/Makefile
new file mode 100644
index 00000000..8eb5f6ec
--- /dev/null
+++ b/package/gluon-mesh-vpn-fastd-l2tp/Makefile
@@ -0,0 +1,13 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=gluon-mesh-vpn-fastd-l2tp
+PKG_VERSION:=1
+
+include ../gluon.mk
+
+define Package/gluon-mesh-vpn-fastd-l2tp
+ TITLE:=Support for connecting meshes via fastd (with L2TP kernel offloading)
+ DEPENDS:=+gluon-core +gluon-mesh-vpn-fastd +kmod-l2tp-eth +@GLUON_SPECIALIZE_KERNEL:KERNEL_L2TP
+endef
+
+$(eval $(call BuildPackageGluon,gluon-mesh-vpn-fastd-l2tp))
diff --git a/package/gluon-mesh-vpn-fastd-l2tp/files/lib/gluon/mesh-vpn/fastd/l2tp b/package/gluon-mesh-vpn-fastd-l2tp/files/lib/gluon/mesh-vpn/fastd/l2tp
new file mode 100644
index 00000000..e69de29b
diff --git a/package/gluon-mesh-vpn-fastd/check_site.lua b/package/gluon-mesh-vpn-fastd/check_site.lua
index 70c0d079..6f3c0832 100644
--- a/package/gluon-mesh-vpn-fastd/check_site.lua
+++ b/package/gluon-mesh-vpn-fastd/check_site.lua
@@ -1,4 +1,4 @@
-local fastd_methods = {'salsa2012+gmac', 'salsa2012+umac', 'null+salsa2012+gmac', 'null+salsa2012+umac', 'null'}
+local fastd_methods = {'salsa2012+umac', 'null+salsa2012+umac', 'null@l2tp', 'null'}
need_array_of({'mesh_vpn', 'fastd', 'methods'}, fastd_methods)
need_boolean(in_site({'mesh_vpn', 'fastd', 'configurable'}), false)
diff --git a/package/gluon-mesh-vpn-fastd/files/lib/gluon/mesh-vpn/fastd/.keep b/package/gluon-mesh-vpn-fastd/files/lib/gluon/mesh-vpn/fastd/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/package/gluon-mesh-vpn-fastd/luasrc/lib/gluon/upgrade/400-mesh-vpn-fastd b/package/gluon-mesh-vpn-fastd/luasrc/lib/gluon/upgrade/400-mesh-vpn-fastd
index 5fed1e8c..c8898755 100755
--- a/package/gluon-mesh-vpn-fastd/luasrc/lib/gluon/upgrade/400-mesh-vpn-fastd
+++ b/package/gluon-mesh-vpn-fastd/luasrc/lib/gluon/upgrade/400-mesh-vpn-fastd
@@ -5,6 +5,7 @@ local util = require 'gluon.util'
local vpn_core = require 'gluon.mesh-vpn'
local uci = require('simple-uci').cursor()
+local unistd = require 'posix.unistd'
local syslog_level = uci:get('fastd', 'mesh_vpn', 'syslog_level') or 'verbose'
@@ -17,20 +18,22 @@ end
local methods
if site.mesh_vpn.fastd.configurable(false) then
- local has_null = util.contains(site.mesh_vpn.fastd.methods(), 'null')
+ local site_methods = site.mesh_vpn.fastd.methods()
+ local has_null = util.contains(site_methods, 'null@l2tp') or util.contains(site_methods, 'null')
local old_methods = uci:get('fastd', 'mesh_vpn', 'method')
if old_methods then
- has_null = util.contains(old_methods, 'null')
+ has_null = util.contains(old_methods, 'null@l2tp') or util.contains(old_methods, 'null')
end
methods = {}
if has_null then
+ table.insert(methods, 'null@l2tp')
table.insert(methods, 'null')
end
- for _, method in ipairs(site.mesh_vpn.fastd.methods()) do
- if method ~= 'null' then
+ for _, method in ipairs(site_methods) do
+ if method ~= 'null@l2tp' and method ~= 'null' then
table.insert(methods, method)
end
end
@@ -50,9 +53,19 @@ uci:section('fastd', 'fastd', 'mesh_vpn', {
secure_handshakes = true,
method = methods,
packet_mark = 1,
+ persist_interface = true,
+ offload_l2tp = false,
status_socket = '/var/run/fastd.mesh_vpn.socket',
})
+uci:delete('fastd', 'mesh_vpn', 'peer_limit')
+-- L2TP offload support
+if unistd.access('/lib/gluon/mesh-vpn/fastd/l2tp') then
+ uci:set('fastd', 'mesh_vpn', 'mode', 'multitap')
+ uci:set('fastd', 'mesh_vpn', 'persist_interface', false)
+ uci:set('fastd', 'mesh_vpn', 'offload_l2tp', true)
+ uci:set('fastd', 'mesh_vpn', 'peer_limit', 1)
+end
-- Collect list of groups that have peers with 'preserve' flag
local preserve_groups = {}
@@ -94,6 +107,7 @@ local function add_peer(group, name, config)
enabled = true,
net = 'mesh_vpn',
group = group,
+ interface = 'mesh-vpn',
key = config.key,
remote = config.remotes,
})
@@ -123,5 +137,11 @@ end
add_groups('mesh_vpn', site.mesh_vpn.fastd.groups())
+-- Update preserved peers as well
+uci:foreach('fastd', 'peer', function(peer)
+ if peer.net == 'mesh_vpn' then
+ uci:set('fastd', peer['.name'], 'interface', 'mesh-vpn')
+ end
+end)
uci:save('fastd')
diff --git a/package/gluon-mesh-vpn-wireguard/luasrc/lib/gluon/upgrade/400-mesh-vpn-wireguard b/package/gluon-mesh-vpn-wireguard/luasrc/lib/gluon/upgrade/400-mesh-vpn-wireguard
index dfadc95b..05e1d9e9 100755
--- a/package/gluon-mesh-vpn-wireguard/luasrc/lib/gluon/upgrade/400-mesh-vpn-wireguard
+++ b/package/gluon-mesh-vpn-wireguard/luasrc/lib/gluon/upgrade/400-mesh-vpn-wireguard
@@ -3,7 +3,7 @@
local uci = require('simple-uci').cursor()
local site = require 'gluon.site'
-local private_key = uci:get("network", 'wg_mesh', "private_key")
+local private_key = uci:get("network_gluon-old", 'wg_mesh', "private_key")
if not private_key or not private_key:match("^" .. ("[%a%d+/]"):rep(42) .. "[AEIMQUYcgkosw480]=$") then
private_key = "generate"
diff --git a/package/gluon-setup-mode/luasrc/lib/gluon/upgrade/320-setup-ifname b/package/gluon-setup-mode/luasrc/lib/gluon/upgrade/320-setup-ifname
index 53d60d1c..195663dd 100755
--- a/package/gluon-setup-mode/luasrc/lib/gluon/upgrade/320-setup-ifname
+++ b/package/gluon-setup-mode/luasrc/lib/gluon/upgrade/320-setup-ifname
@@ -3,13 +3,12 @@
local platform = require 'gluon.platform'
local sysconfig = require 'gluon.sysconfig'
-
-if sysconfig.setup_ifname then
- os.exit(0)
-end
-
-if platform.is_outdoor_device() then
- sysconfig.setup_ifname = sysconfig.wan_ifname or sysconfig.lan_ifname
+if platform.is_outdoor_device() or
+ platform.match('ath79', 'generic', {
+ 'ubnt,unifi-ap-pro',
+ })
+then
+ sysconfig.setup_ifname = sysconfig.single_ifname or sysconfig.wan_ifname
else
- sysconfig.setup_ifname = sysconfig.lan_ifname or sysconfig.wan_ifname
+ sysconfig.setup_ifname = sysconfig.single_ifname or sysconfig.lan_ifname
end
diff --git a/package/gluon-status-page/files/lib/gluon/status-page/view/layout.html b/package/gluon-status-page/files/lib/gluon/status-page/view/layout.html
index 11969ddc..6b960207 100644
--- a/package/gluon-status-page/files/lib/gluon/status-page/view/layout.html
+++ b/package/gluon-status-page/files/lib/gluon/status-page/view/layout.html
@@ -1,15 +1,15 @@
<%-
- http:prepare_content("application/xhtml+xml")
+ http:prepare_content("text/html")
-%>
-
+
-
-
+
+
<%:Error%>
-
+
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 6957599f..703cf436 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
@@ -111,24 +111,24 @@
end
local function statisticsTraffic(key)
- return string.format('%s %s %s',
+ return string.format('%s %s %s',
statistics(key .. '/packets', 'packetsDiff'),
statistics(key .. '/bytes', 'bytesDiff'),
statistics(key .. '/bytes', 'bytes')
)
end
- http:prepare_content("application/xhtml+xml")
+ http:prepare_content("text/html")
-%>
-
+
-
-
+
+
<%| nodeinfo.hostname %> - <%:Status%>
-
+
diff --git a/package/gluon-web-admin/files/lib/gluon/config-mode/view/admin/upgrade_confirm.html b/package/gluon-web-admin/files/lib/gluon/config-mode/view/admin/upgrade_confirm.html
index 9733132f..b45012ef 100644
--- a/package/gluon-web-admin/files/lib/gluon/config-mode/view/admin/upgrade_confirm.html
+++ b/package/gluon-web-admin/files/lib/gluon/config-mode/view/admin/upgrade_confirm.html
@@ -47,13 +47,13 @@ You may obtain a copy of the License at
diff --git a/package/gluon-web-admin/i18n/de.po b/package/gluon-web-admin/i18n/de.po
index c6511012..33b459a0 100644
--- a/package/gluon-web-admin/i18n/de.po
+++ b/package/gluon-web-admin/i18n/de.po
@@ -21,11 +21,11 @@ msgstr "Erweiterte Einstellungen"
msgid ""
"Alternatively, you can set a password to access your node. Please choose a "
-"secure password you don't use anywhere else.
If you set an empty "
+"secure password you don't use anywhere else.
If you set an empty "
"password, login via password will be disabled. This is the default."
msgstr ""
"Alternativ kannst du auch ein Passwort setzen. Wähle bitte ein sicheres "
-"Passwort, das du nirgendwo anders verwendest.
Beim Setzen eines "
+"Passwort, das du nirgendwo anders verwendest.
Beim Setzen eines "
"leeren Passworts wird der Login per Passwort gesperrt (dies ist die Standard-"
"Einstellung)."
diff --git a/package/gluon-web-admin/i18n/fr.po b/package/gluon-web-admin/i18n/fr.po
index 4e16238d..dcae406e 100644
--- a/package/gluon-web-admin/i18n/fr.po
+++ b/package/gluon-web-admin/i18n/fr.po
@@ -21,12 +21,12 @@ msgstr "Paramètres avancés"
msgid ""
"Alternatively, you can set a password to access your node. Please choose a "
-"secure password you don't use anywhere else.
If you set an empty "
+"secure password you don't use anywhere else.
If you set an empty "
"password, login via password will be disabled. This is the default."
msgstr ""
"Alternativement, vous pouvez mettre un mot de passe pour accéder à votre "
"nœud, Penseiz à choisir un mot de passe sûr, que vous n'utilisez nulle part "
-"ailleurs.
Si vous n'entrez pas de mot de passe, la connexion "
+"ailleurs.
Si vous n'entrez pas de mot de passe, la connexion "
"par mot de passe sera désactivée. La connexion par mot de passe est "
"désactivée par défaut."
diff --git a/package/gluon-web-admin/i18n/gluon-web-admin.pot b/package/gluon-web-admin/i18n/gluon-web-admin.pot
index 084182e5..48c5f2bb 100644
--- a/package/gluon-web-admin/i18n/gluon-web-admin.pot
+++ b/package/gluon-web-admin/i18n/gluon-web-admin.pot
@@ -12,7 +12,7 @@ msgstr ""
msgid ""
"Alternatively, you can set a password to access your node. Please choose a "
-"secure password you don't use anywhere else.
If you set an empty "
+"secure password you don't use anywhere else.
If you set an empty "
"password, login via password will be disabled. This is the default."
msgstr ""
diff --git a/package/gluon-web-admin/luasrc/lib/gluon/config-mode/model/admin/remote.lua b/package/gluon-web-admin/luasrc/lib/gluon/config-mode/model/admin/remote.lua
index 5d614acf..226969c0 100644
--- a/package/gluon-web-admin/luasrc/lib/gluon/config-mode/model/admin/remote.lua
+++ b/package/gluon-web-admin/luasrc/lib/gluon/config-mode/model/admin/remote.lua
@@ -51,7 +51,7 @@ end
local f_password = Form(translate("Password"), translate(
"Alternatively, you can set a password to access your node. Please choose a "
- .. "secure password you don't use anywhere else.
If you set an empty "
+ .. "secure password you don't use anywhere else.
If you set an empty "
.. "password, login via password will be disabled. This is the default."
), 'password'
)
diff --git a/package/gluon-web-mesh-vpn-fastd/files/lib/gluon/config-mode/view/mesh-vpn-fastd.html b/package/gluon-web-mesh-vpn-fastd/files/lib/gluon/config-mode/view/mesh-vpn-fastd.html
index 5bb5f069..e0ef55dd 100644
--- a/package/gluon-web-mesh-vpn-fastd/files/lib/gluon/config-mode/view/mesh-vpn-fastd.html
+++ b/package/gluon-web-mesh-vpn-fastd/files/lib/gluon/config-mode/view/mesh-vpn-fastd.html
@@ -1,34 +1,34 @@
- />
+ >
-
+
<%| translate(
'In security mode, the mesh VPN uses an encrypted tunnel to connect to the VPN servers. ' ..
'The encryption ensures that it is impossible for your internet access provider to see what ' ..
'data is exchanged over your node.'
) %>
-
+
- />
+ >
-
+
<%| translate(
'In performance mode, no encryption is used. This usually allows for higher throughput, but the data exchanged over your node is not ' ..
'protected against eavesdropping.'
) %>
-
+
diff --git a/package/gluon-web-mesh-vpn-fastd/luasrc/lib/gluon/config-mode/model/admin/mesh_vpn_fastd.lua b/package/gluon-web-mesh-vpn-fastd/luasrc/lib/gluon/config-mode/model/admin/mesh_vpn_fastd.lua
index ad890c31..9243ec92 100644
--- a/package/gluon-web-mesh-vpn-fastd/luasrc/lib/gluon/config-mode/model/admin/mesh_vpn_fastd.lua
+++ b/package/gluon-web-mesh-vpn-fastd/luasrc/lib/gluon/config-mode/model/admin/mesh_vpn_fastd.lua
@@ -10,7 +10,7 @@ mode.package = "gluon-web-mesh-vpn-fastd"
mode.template = "mesh-vpn-fastd"
local methods = uci:get('fastd', 'mesh_vpn', 'method')
-if util.contains(methods, 'null') then
+if util.contains(methods, 'null@l2tp') or util.contains(methods, 'null') then
-- performance mode will only be used as default, if it is present in site.mesh_vpn.fastd.methods
mode.default = 'performance'
else
@@ -24,11 +24,12 @@ function mode:write(data)
-- if performance mode was selected, and the method 'null' was not present in the original table, it will be added
local site_methods = {}
if data == 'performance' then
+ table.insert(site_methods, 'null@l2tp')
table.insert(site_methods, 'null')
end
for _, method in ipairs(site.mesh_vpn.fastd.methods()) do
- if method ~= 'null' then
+ if method ~= 'null@l2tp' and method ~= 'null' then
table.insert(site_methods, method)
end
end
diff --git a/package/gluon-web-model/files/lib/gluon/web/view/model/dynlist.html b/package/gluon-web-model/files/lib/gluon/web/view/model/dynlist.html
index b0cd9d0a..bbc65734 100644
--- a/package/gluon-web-model/files/lib/gluon/web/view/model/dynlist.html
+++ b/package/gluon-web-model/files/lib/gluon/web/view/model/dynlist.html
@@ -15,6 +15,6 @@
attr("name", id) ..
attr("size", self.size) ..
attr("placeholder", self.placeholder)
- %> />
+ %>>
<% end %>
diff --git a/package/gluon-web-model/files/lib/gluon/web/view/model/form.html b/package/gluon-web-model/files/lib/gluon/web/view/model/form.html
index d222dde2..6b35fe89 100644
--- a/package/gluon-web-model/files/lib/gluon/web/view/model/form.html
+++ b/package/gluon-web-model/files/lib/gluon/web/view/model/form.html
@@ -1,5 +1,5 @@
diff --git a/package/gluon-web-model/files/lib/gluon/web/view/model/fvalue.html b/package/gluon-web-model/files/lib/gluon/web/view/model/fvalue.html
index 5662df99..a244bb02 100644
--- a/package/gluon-web-model/files/lib/gluon/web/view/model/fvalue.html
+++ b/package/gluon-web-model/files/lib/gluon/web/view/model/fvalue.html
@@ -1,5 +1,5 @@
/>
+%>>
diff --git a/package/gluon-web-model/files/lib/gluon/web/view/model/lvalue.html b/package/gluon-web-model/files/lib/gluon/web/view/model/lvalue.html
index e63d33ee..b0110904 100644
--- a/package/gluon-web-model/files/lib/gluon/web/view/model/lvalue.html
+++ b/package/gluon-web-model/files/lib/gluon/web/view/model/lvalue.html
@@ -1,5 +1,5 @@
<%
- local br = self.orientation == "horizontal" and ' ' or ' '
+ local br = self.orientation == "horizontal" and ' ' or ' '
local entries = self:entries()
%>
@@ -35,7 +35,7 @@
attr("name", id) ..
attr("value", entry.key) ..
attr("checked", (self:cfgvalue() == entry.key) and "checked")
- %> />
+ %>>
<%|entry.value%>
diff --git a/package/gluon-web-model/files/lib/gluon/web/view/model/value.html b/package/gluon-web-model/files/lib/gluon/web/view/model/value.html
index fc8b8de6..250c8ce0 100644
--- a/package/gluon-web-model/files/lib/gluon/web/view/model/value.html
+++ b/package/gluon-web-model/files/lib/gluon/web/view/model/value.html
@@ -8,4 +8,4 @@
attr("maxlength", self.maxlength) ..
attr("data-type", self.datatype) ..
attr("data-optional", self.datatype and self.optional)
-%> />
+%>>
diff --git a/package/gluon-web-model/files/lib/gluon/web/view/model/valuewrapper.html b/package/gluon-web-model/files/lib/gluon/web/view/model/valuewrapper.html
index 1a1a63d1..b4a331e5 100644
--- a/package/gluon-web-model/files/lib/gluon/web/view/model/valuewrapper.html
+++ b/package/gluon-web-model/files/lib/gluon/web/view/model/valuewrapper.html
@@ -7,7 +7,7 @@
<%- end -%>
<% if self.subtemplate then include(self.subtemplate) end %>
<% if self.description and #self.description > 0 then -%>
-
+
<%=self.description%>
diff --git a/package/gluon-web-network/i18n/de.po b/package/gluon-web-network/i18n/de.po
index 4a6bc8b5..77b3a6a3 100644
--- a/package/gluon-web-network/i18n/de.po
+++ b/package/gluon-web-network/i18n/de.po
@@ -28,6 +28,9 @@ msgstr "PoE-Passthrough aktivieren"
msgid "Enable PoE Power Port %s"
msgstr "PoE-Ausgabe auf Port %s aktivieren"
+msgid "Enable meshing on the Ethernet interface"
+msgstr "Mesh auf dem Ethernet-Port aktivieren"
+
msgid "Enable meshing on the LAN interface"
msgstr "Mesh auf dem LAN-Port aktivieren"
diff --git a/package/gluon-web-network/i18n/fr.po b/package/gluon-web-network/i18n/fr.po
index 292d6e25..97067343 100644
--- a/package/gluon-web-network/i18n/fr.po
+++ b/package/gluon-web-network/i18n/fr.po
@@ -28,6 +28,9 @@ msgstr ""
msgid "Enable PoE Power Port %s"
msgstr ""
+msgid "Enable meshing on the Ethernet interface"
+msgstr ""
+
msgid "Enable meshing on the LAN interface"
msgstr "Activer le réseau MESH sur le port LAN"
diff --git a/package/gluon-web-network/i18n/gluon-web-network.pot b/package/gluon-web-network/i18n/gluon-web-network.pot
index 913b78b3..a75929df 100644
--- a/package/gluon-web-network/i18n/gluon-web-network.pot
+++ b/package/gluon-web-network/i18n/gluon-web-network.pot
@@ -19,6 +19,9 @@ msgstr ""
msgid "Enable PoE Power Port %s"
msgstr ""
+msgid "Enable meshing on the Ethernet interface"
+msgstr ""
+
msgid "Enable meshing on the LAN interface"
msgstr ""
diff --git a/package/gluon-web-network/luasrc/lib/gluon/config-mode/model/admin/network.lua b/package/gluon-web-network/luasrc/lib/gluon/config-mode/model/admin/network.lua
index dab31ec0..df92c965 100644
--- a/package/gluon-web-network/luasrc/lib/gluon/config-mode/model/admin/network.lua
+++ b/package/gluon-web-network/luasrc/lib/gluon/config-mode/model/admin/network.lua
@@ -76,36 +76,37 @@ end
s = f:section(Section)
-local mesh_wan = s:option(Flag, "mesh_wan", translate("Enable meshing on the WAN interface"))
-mesh_wan.default = not uci:get_bool("network", "mesh_wan", "disabled")
+local wired_mesh_help = {
+ single = translate('Enable meshing on the Ethernet interface'),
+ wan = translate('Enable meshing on the WAN interface'),
+ lan = translate('Enable meshing on the LAN interface'),
+}
-function mesh_wan:write(data)
- uci:set("network", "mesh_wan", "disabled", not data)
-end
+local function wired_mesh(iface)
+ if not sysconfig[iface .. '_ifname'] then return end
+ local iface_roles = uci:get_list('gluon', 'iface_' .. iface, 'role')
-if sysconfig.lan_ifname then
- s = f:section(Section)
+ local option = s:option(Flag, 'mesh_' .. iface, wired_mesh_help[iface])
+ option.default = util.contains(iface_roles, 'mesh') ~= false
- local mesh_lan = s:option(Flag, "mesh_lan", translate("Enable meshing on the LAN interface"))
- mesh_lan.default = not uci:get_bool("network", "mesh_lan", "disabled")
-
- function mesh_lan:write(data)
- uci:set("network", "mesh_lan", "disabled", not data)
-
- local interfaces = uci:get_list("network", "client", "ifname")
-
- for lanif in sysconfig.lan_ifname:gmatch('%S+') do
- if data then
- util.remove_from_set(interfaces, lanif)
- else
- util.add_to_set(interfaces, lanif)
- end
+ function option:write(data)
+ local roles = uci:get_list('gluon', 'iface_' .. iface, 'role')
+ if data then
+ util.add_to_set(roles, 'mesh')
+ else
+ util.remove_from_set(roles, 'mesh')
end
+ uci:set_list('gluon', 'iface_' .. iface, 'role', roles)
- uci:set_list("network", "client", "ifname", interfaces)
+ -- Reconfigure on next reboot
+ uci:set('gluon', 'core', 'reconfigure', true)
end
end
+wired_mesh('single')
+wired_mesh('wan')
+wired_mesh('lan')
+
local section
uci:foreach("system", "gpio_switch", function(si)
if si[".name"]:match("poe") then
@@ -160,7 +161,7 @@ function f:write()
uci:delete("network", "wan6", "ip6gw")
end
-
+ uci:commit('gluon')
uci:commit("network")
uci:commit('system')
end
diff --git a/package/gluon-web-osm/luasrc/usr/lib/lua/gluon/web/model/osm.lua b/package/gluon-web-osm/luasrc/usr/lib/lua/gluon/web/model/osm.lua
index ec18a003..294caddf 100644
--- a/package/gluon-web-osm/luasrc/usr/lib/lua/gluon/web/model/osm.lua
+++ b/package/gluon-web-osm/luasrc/usr/lib/lua/gluon/web/model/osm.lua
@@ -4,7 +4,8 @@ local util = require "gluon.web.util"
local class = util.class
-local DEFAULT_URL = 'https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.2.0'
+local DEFAULT_URL =
+ 'https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@35ffe7626ce16c372143f3c903950750075e7068/en/v5.3.0'
local M = {}
diff --git a/package/gluon-web-wifi-config/i18n/de.po b/package/gluon-web-wifi-config/i18n/de.po
index d2ddeb8b..f0883ad6 100644
--- a/package/gluon-web-wifi-config/i18n/de.po
+++ b/package/gluon-web-wifi-config/i18n/de.po
@@ -56,15 +56,15 @@ msgstr "WLAN"
msgid ""
"You can enable or disable your node's client and mesh network SSIDs here. "
"Please don't disable the mesh network without a good reason, so other nodes "
-"can mesh with yours.
It is also possible to configure the WLAN "
+"can mesh with yours.
It is also possible to configure the WLAN "
"adapters transmission power here. Please note that the transmission power "
"values include the antenna gain where available, but there are many devices "
"for which the gain is unavailable or inaccurate."
msgstr ""
"In diesem Abschnitt hast du die Möglichkeit, die SSIDs des Client- und des "
"Mesh-Netzes zu aktivieren bzw. deaktivieren. Bitte lass die SSID des Mesh-"
-"Netzes aktiviert, damit sich andere Knoten mit deinem verbinden können.
Außerdem kann hier die Sendeleistung des WLAN-Adapters konfiguriert "
+"Netzes aktiviert, damit sich andere Knoten mit deinem verbinden können.
Außerdem kann hier die Sendeleistung des WLAN-Adapters konfiguriert "
"werden. Wenn möglich, ist in den Werten der Sendeleistung der Antennengewinn "
"enthalten; diese Werte sind allerdings für viele Geräte nicht verfügbar oder "
"fehlerhaft."
diff --git a/package/gluon-web-wifi-config/i18n/fr.po b/package/gluon-web-wifi-config/i18n/fr.po
index faf6d47d..eb09694f 100644
--- a/package/gluon-web-wifi-config/i18n/fr.po
+++ b/package/gluon-web-wifi-config/i18n/fr.po
@@ -51,14 +51,14 @@ msgstr "Wi-Fi"
msgid ""
"You can enable or disable your node's client and mesh network SSIDs here. "
"Please don't disable the mesh network without a good reason, so other nodes "
-"can mesh with yours.
It is also possible to configure the WLAN "
+"can mesh with yours.
It is also possible to configure the WLAN "
"adapters transmission power here. Please note that the transmission power "
"values include the antenna gain where available, but there are many devices "
"for which the gain is unavailable or inaccurate."
msgstr ""
"Ici vous pouvez activer ou désactiver la SSID du client ou MESH. Pensez a "
"laisser la SSID du MESH activée pour que les autres nœuds puissent se "
-"connecter.
Ici vous pouvez aussi configurer la puissance "
+"connecter.
Ici vous pouvez aussi configurer la puissance "
"d'émmission se votre Wi-Fi. Prenez note que les valeurs fournies pour la "
"puissance de transmission prennent en compte les gains fournis par "
"l'antenne, et que ces valeurs ne sont pas toujours disponibles ou exactes."
diff --git a/package/gluon-web-wifi-config/i18n/gluon-web-wifi-config.pot b/package/gluon-web-wifi-config/i18n/gluon-web-wifi-config.pot
index 19536e30..2af9b5f3 100644
--- a/package/gluon-web-wifi-config/i18n/gluon-web-wifi-config.pot
+++ b/package/gluon-web-wifi-config/i18n/gluon-web-wifi-config.pot
@@ -42,7 +42,7 @@ msgstr ""
msgid ""
"You can enable or disable your node's client and mesh network SSIDs here. "
"Please don't disable the mesh network without a good reason, so other nodes "
-"can mesh with yours.
It is also possible to configure the WLAN "
+"can mesh with yours.
It is also possible to configure the WLAN "
"adapters transmission power here. Please note that the transmission power "
"values include the antenna gain where available, but there are many devices "
"for which the gain is unavailable or inaccurate."
diff --git a/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua b/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua
index 13ac6434..49009eaf 100644
--- a/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua
+++ b/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua
@@ -29,7 +29,7 @@ local f = Form(translate("WLAN"))
f:section(Section, nil, translate(
"You can enable or disable your node's client and mesh network "
.. "SSIDs here. Please don't disable the mesh network without "
- .. "a good reason, so other nodes can mesh with yours.
"
+ .. "a good reason, so other nodes can mesh with yours.
"
.. "It is also possible to configure the WLAN adapters transmission power "
.. "here. Please note that the transmission power values include the antenna gain "
.. "where available, but there are many devices for which the gain is unavailable or inaccurate."
diff --git a/package/gluon-web/luasrc/usr/lib/lua/gluon/web/http.lua b/package/gluon-web/luasrc/usr/lib/lua/gluon/web/http.lua
index c77d4ace..eae38bff 100644
--- a/package/gluon-web/luasrc/usr/lib/lua/gluon/web/http.lua
+++ b/package/gluon-web/luasrc/usr/lib/lua/gluon/web/http.lua
@@ -78,13 +78,6 @@ end
function Http:prepare_content(mime)
if self.headers["content-type"] then return end
- if mime == "application/xhtml+xml" then
- local accept = self:getenv("HTTP_ACCEPT")
- if not accept or not accept:find("application/xhtml+xml", nil, true) then
- mime = "text/html; charset=UTF-8"
- end
- self:header("Vary", "Accept")
- end
self:header("Content-Type", mime)
end
diff --git a/package/gluon.mk b/package/gluon.mk
index 40f9274f..df8e2637 100644
--- a/package/gluon.mk
+++ b/package/gluon.mk
@@ -67,6 +67,7 @@ define GluonSrcDiet
ifdef CONFIG_GLUON_MINIFY
# Use cp + rm instead of mv to preserve destination permissions
set -e; $(FIND) $(2) -type f | while read src; do \
+ echo "Minifying $$$$src..."; \
luasrcdiet --noopt-binequiv -o "$$$$src.tmp" "$$$$src"; \
cp "$$$$src.tmp" "$$$$src"; \
rm "$$$$src.tmp"; \
diff --git a/patches/openwrt/0005-ath79-Add-support-for-OpenMesh-A60.patch b/patches/openwrt/0005-ath79-Add-support-for-OpenMesh-A60.patch
new file mode 100644
index 00000000..1e137632
--- /dev/null
+++ b/patches/openwrt/0005-ath79-Add-support-for-OpenMesh-A60.patch
@@ -0,0 +1,337 @@
+From: Sven Eckelmann
+Date: Mon, 23 Nov 2020 13:41:34 +0100
+Subject: ath79: Add support for OpenMesh A60
+
+Device specifications:
+======================
+
+* Qualcomm/Atheros QCA9558 ver 1 rev 0
+* 720/600/240 MHz (CPU/DDR/AHB)
+* 128 MB of RAM
+* 16 MB of SPI NOR flash
+ - 2x 7 MB available; but one of the 7 MB regions is the recovery image
+* 3T3R 2.4 GHz Wi-Fi (11n)
+* 3T3R 5 GHz Wi-Fi (11ac)
+* multi-color LED (controlled via red/green/blue GPIOs)
+* 1x GPIO-button (reset)
+* external h/w watchdog (enabled by default))
+* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
+* 2x ethernet
+ - eth0
+ + Label: Ethernet 1
+ + AR8035 ethernet PHY (RGMII)
+ + 10/100/1000 Mbps Ethernet
+ + 802.3af POE
+ + used as WAN interface
+ - eth1
+ + Label: Ethernet 2
+ + AR8031 ethernet PHY (SGMII)
+ + 10/100/1000 Mbps Ethernet
+ + used as LAN interface
+* 1x USB
+* internal antennas
+
+Flashing instructions:
+======================
+
+Various methods can be used to install the actual image on the flash.
+Two easy ones are:
+
+ap51-flash
+----------
+
+The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
+used to transfer the image to the u-boot when the device boots up.
+
+initramfs from TFTP
+-------------------
+
+The serial console must be used to access the u-boot shell during bootup.
+It can then be used to first boot up the initramfs image from a TFTP server
+(here with the IP 192.168.1.21):
+
+ setenv serverip 192.168.1.21
+ setenv ipaddr 192.168.1.1
+ tftpboot 0c00000 .bin && bootm $fileaddr
+
+The actual sysupgrade image can then be transferred (on the LAN port) to the
+device via
+
+ scp .bin root@192.168.1.1:/tmp/
+
+On the device, the sysupgrade must then be started using
+
+ sysupgrade -n /tmp/.bin
+
+Signed-off-by: Sven Eckelmann
+(cherry picked from commit eaf2e32c12655d7fb58e158086a784393dc6f69a)
+
+diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79
+index abcb99663dfd8e5d1ad0ee757e17972d63c856c7..0791d58b04cd108fcd2190bcf3c39f715f0b511f 100644
+--- a/package/boot/uboot-envtools/files/ath79
++++ b/package/boot/uboot-envtools/files/ath79
+@@ -49,6 +49,7 @@ netgear,wnr2200-16m|\
+ netgear,wnr612-v2|\
+ ocedo,koala|\
+ ocedo,raccoon|\
++openmesh,a60|\
+ openmesh,mr600-v1|\
+ openmesh,mr600-v2|\
+ openmesh,mr900-v1|\
+diff --git a/target/linux/ath79/dts/qca9558_openmesh_a60.dts b/target/linux/ath79/dts/qca9558_openmesh_a60.dts
+new file mode 100644
+index 0000000000000000000000000000000000000000..473f055b492f6dffb0c460fd13e7ad9b604373c6
+--- /dev/null
++++ b/target/linux/ath79/dts/qca9558_openmesh_a60.dts
+@@ -0,0 +1,8 @@
++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
++
++#include "qca9558_openmesh_a60.dtsi"
++
++/ {
++ compatible = "openmesh,a60", "qca,qca9558";
++ model = "OpenMesh A60";
++};
+diff --git a/target/linux/ath79/dts/qca9558_openmesh_a60.dtsi b/target/linux/ath79/dts/qca9558_openmesh_a60.dtsi
+new file mode 100644
+index 0000000000000000000000000000000000000000..9938e5f4c013575c686edce5699f3541942133d3
+--- /dev/null
++++ b/target/linux/ath79/dts/qca9558_openmesh_a60.dtsi
+@@ -0,0 +1,180 @@
++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
++
++#include "qca955x.dtsi"
++
++#include
++#include
++
++/ {
++ chosen {
++ /delete-property/ bootargs;
++ };
++
++ aliases {
++ serial0 = &uart;
++ led-boot = &led_status_green;
++ led-failsafe = &led_status_green;
++ led-running = &led_status_green;
++ led-upgrade = &led_status_green;
++ label-mac-device = ð0;
++ };
++
++ keys {
++ compatible = "gpio-keys";
++
++ reset {
++ label = "reset";
++ linux,code = ;
++ gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
++ };
++ };
++
++ leds {
++ compatible = "gpio-leds";
++
++ status_blue {
++ label = "blue:status";
++ gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
++ };
++
++ status_red {
++ label = "red:status";
++ gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
++ };
++
++ led_status_green: status_green {
++ label = "green:status";
++ gpios = <&gpio 23 GPIO_ACTIVE_HIGH>;
++ };
++ };
++
++ watchdog {
++ compatible = "linux,wdt-gpio";
++ gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
++ hw_algo = "toggle";
++ /* hw_margin_ms is actually 300s but driver limits it to 60s */
++ hw_margin_ms = <60000>;
++ always-running;
++ };
++};
++
++&usb_phy1 {
++ status = "okay";
++};
++
++&usb1 {
++ status = "okay";
++};
++
++&spi {
++ status = "okay";
++
++ flash@0 {
++ compatible = "jedec,spi-nor";
++ reg = <0>;
++ spi-max-frequency = <40000000>;
++
++ /* partitions are passed via bootloader */
++ partitions {
++ compatible = "fixed-partitions";
++ #address-cells = <1>;
++ #size-cells = <1>;
++
++ partition@0 {
++ label = "u-boot";
++ reg = <0x000000 0x040000>;
++ read-only;
++ };
++
++ partition@40000 {
++ label = "u-boot-env";
++ reg = <0x040000 0x010000>;
++ };
++
++ partition@50000 {
++ label = "custom";
++ reg = <0x050000 0x060000>;
++ read-only;
++ };
++
++ partition@b0000 {
++ label = "inactive";
++ reg = <0x0b0000 0x7a0000>;
++ };
++
++ partition@850000 {
++ label = "inactive2";
++ reg = <0x850000 0x7a0000>;
++ };
++
++ art: partition@ff0000 {
++ label = "ART";
++ reg = <0xff0000 0x010000>;
++ read-only;
++ };
++ };
++ };
++};
++
++&mdio0 {
++ status = "okay";
++
++ phy-mask = <0x6>;
++
++ phy1: ethernet-phy@1 {
++ reg = <1>;
++ eee-broken-100tx;
++ eee-broken-1000t;
++ };
++
++ phy2: ethernet-phy@2 {
++ reg = <2>;
++ eee-broken-100tx;
++ eee-broken-1000t;
++ at803x-override-sgmii-link-check;
++ };
++};
++
++ð0 {
++ status = "okay";
++
++ pll-data = <0x82000101 0x80000101 0x80001313>;
++
++ mtd-mac-address = <&art 0x0>;
++
++ phy-mode = "rgmii-id";
++ phy-handle = <&phy1>;
++
++ gmac-config {
++ device = <&gmac>;
++ rgmii-enabled = <1>;
++ rxd-delay = <3>;
++ rxdv-delay = <3>;
++ txd-delay = <0>;
++ txen-delay = <0>;
++ };
++};
++
++ð1 {
++ status = "okay";
++
++ pll-data = <0x03000101 0x80000101 0x80001313>;
++
++ mtd-mac-address = <&art 0x6>;
++
++ qca955x-sgmii-fixup;
++
++ phy-handle = <&phy2>;
++};
++
++&wmac {
++ status = "okay";
++
++ mtd-cal-data = <&art 0x1000>;
++ mtd-mac-address = <&art 0x0>;
++ mtd-mac-address-increment = <2>;
++};
++
++&pcie0 {
++ status = "okay";
++};
+diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
+index d4f53e7dae16b84955d318b9d79b6912ee156bdb..4b83ac7d32fc372cd3b493e8ec427c04e0f2e0d1 100755
+--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
++++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
+@@ -172,6 +172,7 @@ ath79_setup_interfaces()
+ comfast,cf-e120a-v3|\
+ comfast,cf-e314n-v2|\
+ compex,wpj531-16m|\
++ openmesh,a60|\
+ openmesh,om2p-v4|\
+ openmesh,om2p-hs-v4|\
+ plasmacloud,pa300|\
+diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+index 69735f336070a48ddad76c72c2876bcd775c56a1..b4c8a78a7fe4ba5bd3ca1f9c6e2b5e51e7fd1882 100644
+--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
++++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+@@ -99,6 +99,7 @@ case "$FIRMWARE" in
+ caldata_extract "art" 0x5000 0x844
+ ath10k_patch_mac $(mtd_get_mac_binary art 0xc)
+ ;;
++ openmesh,a60|\
+ openmesh,mr1750-v1|\
+ openmesh,mr1750-v2|\
+ openmesh,om5p-ac-v2)
+diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
+index 1240ef51e88ed2e5d24088746596da085c01ab5c..f7862bb032fbce56be77e9db8ae2e37bf5da30ea 100644
+--- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
++++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
+@@ -65,6 +65,7 @@ platform_do_upgrade() {
+ jjplus,ja76pf2)
+ redboot_fis_do_upgrade "$1" linux
+ ;;
++ openmesh,a60|\
+ openmesh,mr600-v1|\
+ openmesh,mr600-v2|\
+ openmesh,mr900-v1|\
+diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
+index 304e58980062465ba7955e5fe45dbd6b0097937b..c669eb2cdb3f868c320412801723ceb112b4089f 100644
+--- a/target/linux/ath79/image/generic.mk
++++ b/target/linux/ath79/image/generic.mk
+@@ -1640,6 +1640,16 @@ define Device/openmesh_common_256k
+ openmesh-image ce_type=$$$$(OPENMESH_CE_TYPE) | append-metadata
+ endef
+
++define Device/openmesh_a60
++ $(Device/openmesh_common_64k)
++ SOC := qca9558
++ DEVICE_MODEL := A60
++ DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct kmod-usb2
++ OPENMESH_CE_TYPE := A60
++ SUPPORTED_DEVICES += a60
++endef
++TARGET_DEVICES += openmesh_a60
++
+ define Device/openmesh_mr600-v1
+ $(Device/openmesh_common_64k)
+ SOC := ar9344
diff --git a/patches/openwrt/0006-ath79-Add-support-for-OpenMesh-A40.patch b/patches/openwrt/0006-ath79-Add-support-for-OpenMesh-A40.patch
new file mode 100644
index 00000000..3b22780f
--- /dev/null
+++ b/patches/openwrt/0006-ath79-Add-support-for-OpenMesh-A40.patch
@@ -0,0 +1,151 @@
+From: Sven Eckelmann
+Date: Mon, 23 Nov 2020 13:41:34 +0100
+Subject: ath79: Add support for OpenMesh A40
+
+Device specifications:
+======================
+
+* Qualcomm/Atheros QCA9558 ver 1 rev 0
+* 720/600/240 MHz (CPU/DDR/AHB)
+* 128 MB of RAM
+* 16 MB of SPI NOR flash
+ - 2x 7 MB available; but one of the 7 MB regions is the recovery image
+* 2T2R 2.4 GHz Wi-Fi (11n)
+* 2T2R 5 GHz Wi-Fi (11ac)
+* multi-color LED (controlled via red/green/blue GPIOs)
+* 1x GPIO-button (reset)
+* external h/w watchdog (enabled by default))
+* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
+* 2x ethernet
+ - eth0
+ + Label: Ethernet 1
+ + AR8035 ethernet PHY (RGMII)
+ + 10/100/1000 Mbps Ethernet
+ + 802.3af POE
+ + used as WAN interface
+ - eth1
+ + Label: Ethernet 2
+ + AR8035 ethernet PHY (SGMII)
+ + 10/100/1000 Mbps Ethernet
+ + used as LAN interface
+* 1x USB
+* internal antennas
+
+Flashing instructions:
+======================
+
+Various methods can be used to install the actual image on the flash.
+Two easy ones are:
+
+ap51-flash
+----------
+
+The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
+used to transfer the image to the u-boot when the device boots up.
+
+initramfs from TFTP
+-------------------
+
+The serial console must be used to access the u-boot shell during bootup.
+It can then be used to first boot up the initramfs image from a TFTP server
+(here with the IP 192.168.1.21):
+
+ setenv serverip 192.168.1.21
+ setenv ipaddr 192.168.1.1
+ tftpboot 0c00000 .bin && bootm $fileaddr
+
+The actual sysupgrade image can then be transferred (on the LAN port) to the
+device via
+
+ scp .bin root@192.168.1.1:/tmp/
+
+On the device, the sysupgrade must then be started using
+
+ sysupgrade -n /tmp/.bin
+
+Signed-off-by: Sven Eckelmann
+(cherry picked from commit 9a172797e593c061f6759a37eaeba2956ad8d72f)
+
+diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79
+index 0791d58b04cd108fcd2190bcf3c39f715f0b511f..a37057953bc1e9b7fdf2be02136142d0fc145054 100644
+--- a/package/boot/uboot-envtools/files/ath79
++++ b/package/boot/uboot-envtools/files/ath79
+@@ -49,6 +49,7 @@ netgear,wnr2200-16m|\
+ netgear,wnr612-v2|\
+ ocedo,koala|\
+ ocedo,raccoon|\
++openmesh,a40|\
+ openmesh,a60|\
+ openmesh,mr600-v1|\
+ openmesh,mr600-v2|\
+diff --git a/target/linux/ath79/dts/qca9558_openmesh_a40.dts b/target/linux/ath79/dts/qca9558_openmesh_a40.dts
+new file mode 100644
+index 0000000000000000000000000000000000000000..d2b817031a9db6846de0632a64962a0197fa2c6f
+--- /dev/null
++++ b/target/linux/ath79/dts/qca9558_openmesh_a40.dts
+@@ -0,0 +1,8 @@
++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
++
++#include "qca9558_openmesh_a60.dtsi"
++
++/ {
++ compatible = "openmesh,a40", "qca,qca9558";
++ model = "OpenMesh A40";
++};
+diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
+index 4b83ac7d32fc372cd3b493e8ec427c04e0f2e0d1..c2932c1737d97f3eb732620041664f5060d16946 100755
+--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
++++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
+@@ -172,6 +172,7 @@ ath79_setup_interfaces()
+ comfast,cf-e120a-v3|\
+ comfast,cf-e314n-v2|\
+ compex,wpj531-16m|\
++ openmesh,a40|\
+ openmesh,a60|\
+ openmesh,om2p-v4|\
+ openmesh,om2p-hs-v4|\
+diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+index b4c8a78a7fe4ba5bd3ca1f9c6e2b5e51e7fd1882..b70a87054b10fbe708d9aa8603ecdb591fc92591 100644
+--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
++++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+@@ -99,6 +99,7 @@ case "$FIRMWARE" in
+ caldata_extract "art" 0x5000 0x844
+ ath10k_patch_mac $(mtd_get_mac_binary art 0xc)
+ ;;
++ openmesh,a40|\
+ openmesh,a60|\
+ openmesh,mr1750-v1|\
+ openmesh,mr1750-v2|\
+diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
+index f7862bb032fbce56be77e9db8ae2e37bf5da30ea..e979c11bb91cb20fd4168b8921499f03572d3512 100644
+--- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
++++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
+@@ -65,6 +65,7 @@ platform_do_upgrade() {
+ jjplus,ja76pf2)
+ redboot_fis_do_upgrade "$1" linux
+ ;;
++ openmesh,a40|\
+ openmesh,a60|\
+ openmesh,mr600-v1|\
+ openmesh,mr600-v2|\
+diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
+index c669eb2cdb3f868c320412801723ceb112b4089f..c63900dc701bbc21dce12086f7045d7d450fc5f3 100644
+--- a/target/linux/ath79/image/generic.mk
++++ b/target/linux/ath79/image/generic.mk
+@@ -1640,6 +1640,16 @@ define Device/openmesh_common_256k
+ openmesh-image ce_type=$$$$(OPENMESH_CE_TYPE) | append-metadata
+ endef
+
++define Device/openmesh_a40
++ $(Device/openmesh_common_64k)
++ SOC := qca9558
++ DEVICE_MODEL := A40
++ DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct kmod-usb2
++ OPENMESH_CE_TYPE := A60
++ SUPPORTED_DEVICES += a40
++endef
++TARGET_DEVICES += openmesh_a40
++
+ define Device/openmesh_a60
+ $(Device/openmesh_common_64k)
+ SOC := qca9558
diff --git a/patches/openwrt/0007-ath79-Allow-to-set-spi-nor-mtd-name-via-devicetree.patch b/patches/openwrt/0007-ath79-Allow-to-set-spi-nor-mtd-name-via-devicetree.patch
new file mode 100644
index 00000000..6507aa7f
--- /dev/null
+++ b/patches/openwrt/0007-ath79-Allow-to-set-spi-nor-mtd-name-via-devicetree.patch
@@ -0,0 +1,135 @@
+From: Sven Eckelmann
+Date: Thu, 31 Dec 2020 00:25:10 +0100
+Subject: ath79: Allow to set spi-nor mtd name via devicetree
+
+On ar71xx, it was possible to overwrite the name of the spi-nor mtd device
+identifier using the flash_platform_data which each mach-*.c could adjust
+for its devices. A similar feature was introduced for mtd-physmap in
+devicetree's. The property linux,mtd-name can be used to set the name and
+provide a stable identifier for mtdpart from the bootloader.
+
+But this feature is not yet available upstream for spi-nor devices which
+also might receive their partition layout from the bootloader. But the
+OpenWrt pistachio support for this property can simply be imported into
+ath79 to gain this support.
+
+Signed-off-by: Sven Eckelmann
+(cherry picked from commit 7f074fe1a79f27d30560c35778d963bc520e9a3e)
+
+diff --git a/target/linux/ath79/patches-5.10/401-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/ath79/patches-5.10/401-mtd-nor-support-mtd-name-from-device-tree.patch
+new file mode 100644
+index 0000000000000000000000000000000000000000..af032df51e6dbc3824a45a8efaa1ce8db2261b2a
+--- /dev/null
++++ b/target/linux/ath79/patches-5.10/401-mtd-nor-support-mtd-name-from-device-tree.patch
+@@ -0,0 +1,51 @@
++From f32bc2aa01edcba2f2ed5db151cf183eac9ef919 Mon Sep 17 00:00:00 2001
++From: Abhimanyu Vishwakarma
++Date: Sat, 25 Feb 2017 16:42:50 +0000
++Subject: mtd: nor: support mtd name from device tree
++
++Signed-off-by: Abhimanyu Vishwakarma
++
++--- a/drivers/mtd/spi-nor/core.c
+++++ b/drivers/mtd/spi-nor/core.c
++@@ -3088,6 +3088,7 @@ int spi_nor_scan(struct spi_nor *nor, const char *name,
++ struct device *dev = nor->dev;
++ struct mtd_info *mtd = &nor->mtd;
++ struct device_node *np = spi_nor_get_flash_node(nor);
+++ const char __maybe_unused *of_mtd_name = NULL;
++ int ret;
++ int i;
++
++@@ -3142,7 +3143,12 @@ int spi_nor_scan(struct spi_nor *nor, const char *name,
++ if (ret)
++ return ret;
++
++- if (!mtd->name)
+++#ifdef CONFIG_MTD_OF_PARTS
+++ of_property_read_string(np, "linux,mtd-name", &of_mtd_name);
+++#endif
+++ if (of_mtd_name)
+++ mtd->name = of_mtd_name;
+++ else if (!mtd->name)
++ mtd->name = dev_name(dev);
++ mtd->priv = nor;
++ mtd->type = MTD_NORFLASH;
++--- a/drivers/mtd/mtdcore.c
+++++ b/drivers/mtd/mtdcore.c
++@@ -762,6 +762,17 @@ int del_mtd_device(struct mtd_info *mtd)
++ */
++ static void mtd_set_dev_defaults(struct mtd_info *mtd)
++ {
+++#ifdef CONFIG_MTD_OF_PARTS
+++ const char __maybe_unused *of_mtd_name = NULL;
+++ struct device_node *np;
+++
+++ np = mtd_get_of_node(mtd);
+++ if (np && !mtd->name) {
+++ of_property_read_string(np, "linux,mtd-name", &of_mtd_name);
+++ if (of_mtd_name)
+++ mtd->name = of_mtd_name;
+++ } else
+++#endif
++ if (mtd->dev.parent) {
++ if (!mtd->owner && mtd->dev.parent->driver)
++ mtd->owner = mtd->dev.parent->driver->owner;
+diff --git a/target/linux/ath79/patches-5.4/401-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/ath79/patches-5.4/401-mtd-nor-support-mtd-name-from-device-tree.patch
+new file mode 100644
+index 0000000000000000000000000000000000000000..a02b632e8c48f4a2df7d66b732aa60dd6788b6b1
+--- /dev/null
++++ b/target/linux/ath79/patches-5.4/401-mtd-nor-support-mtd-name-from-device-tree.patch
+@@ -0,0 +1,54 @@
++From f32bc2aa01edcba2f2ed5db151cf183eac9ef919 Mon Sep 17 00:00:00 2001
++From: Abhimanyu Vishwakarma
++Date: Sat, 25 Feb 2017 16:42:50 +0000
++Subject: mtd: nor: support mtd name from device tree
++
++Signed-off-by: Abhimanyu Vishwakarma
++---
++ drivers/mtd/spi-nor/spi-nor.c | 8 +++++++-
++ 1 file changed, 7 insertions(+), 1 deletion(-)
++
++--- a/drivers/mtd/spi-nor/spi-nor.c
+++++ b/drivers/mtd/spi-nor/spi-nor.c
++@@ -4937,6 +4937,7 @@ int spi_nor_scan(struct spi_nor *nor, co
++ struct mtd_info *mtd = &nor->mtd;
++ struct device_node *np = spi_nor_get_flash_node(nor);
++ struct spi_nor_flash_parameter *params = &nor->params;
+++ const char __maybe_unused *of_mtd_name = NULL;
++ int ret;
++ int i;
++
++@@ -4999,7 +5000,12 @@ int spi_nor_scan(struct spi_nor *nor, co
++ /* Init flash parameters based on flash_info struct and SFDP */
++ spi_nor_init_params(nor);
++
++- if (!mtd->name)
+++#ifdef CONFIG_MTD_OF_PARTS
+++ of_property_read_string(np, "linux,mtd-name", &of_mtd_name);
+++#endif
+++ if (of_mtd_name)
+++ mtd->name = of_mtd_name;
+++ else if (!mtd->name)
++ mtd->name = dev_name(dev);
++ mtd->priv = nor;
++ mtd->type = MTD_NORFLASH;
++--- a/drivers/mtd/mtdcore.c
+++++ b/drivers/mtd/mtdcore.c
++@@ -778,6 +778,17 @@ out_error:
++ */
++ static void mtd_set_dev_defaults(struct mtd_info *mtd)
++ {
+++#ifdef CONFIG_MTD_OF_PARTS
+++ const char __maybe_unused *of_mtd_name = NULL;
+++ struct device_node *np;
+++
+++ np = mtd_get_of_node(mtd);
+++ if (np && !mtd->name) {
+++ of_property_read_string(np, "linux,mtd-name", &of_mtd_name);
+++ if (of_mtd_name)
+++ mtd->name = of_mtd_name;
+++ } else
+++#endif
++ if (mtd->dev.parent) {
++ if (!mtd->owner && mtd->dev.parent->driver)
++ mtd->owner = mtd->dev.parent->driver->owner;
diff --git a/patches/openwrt/0008-ath79-Add-support-for-OpenMesh-OM2P-v1.patch b/patches/openwrt/0008-ath79-Add-support-for-OpenMesh-OM2P-v1.patch
new file mode 100644
index 00000000..1a7dba45
--- /dev/null
+++ b/patches/openwrt/0008-ath79-Add-support-for-OpenMesh-OM2P-v1.patch
@@ -0,0 +1,316 @@
+From: Sven Eckelmann
+Date: Mon, 23 Nov 2020 13:41:34 +0100
+Subject: ath79: Add support for OpenMesh OM2P v1
+
+Device specifications:
+======================
+
+* Qualcomm/Atheros AR7240 rev 2
+* 350/350/175 MHz (CPU/DDR/AHB)
+* 32 MB of RAM
+* 16 MB of SPI NOR flash
+ - 2x 7 MB available; but one of the 7 MB regions is the recovery image
+* 2x 10/100 Mbps Ethernet
+* 1T1R 2.4 GHz Wi-Fi
+* 6x GPIO-LEDs (3x wifi, 2x ethernet, 1x power)
+* 1x GPIO-button (reset)
+* external h/w watchdog (enabled by default)
+* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
+* 2x fast ethernet
+ - eth0
+ + 18-24V passive POE (mode B)
+ + used as WAN interface
+ - eth1
+ + builtin switch port 4
+ + used as LAN interface
+* 12-24V 1A DC
+* external antenna
+
+The device itself requires the mtdparts from the uboot arguments to
+properly boot the flashed image and to support dual-boot (primary +
+recovery image). Unfortunately, the name of the mtd device in mtdparts is
+still using the legacy name "ar7240-nor0" which must be supplied using the
+Linux-specfic DT parameter linux,mtd-name to overwrite the generic name
+"spi0.0".
+
+Flashing instructions:
+======================
+
+Various methods can be used to install the actual image on the flash.
+Two easy ones are:
+
+ap51-flash
+----------
+
+The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
+used to transfer the image to the u-boot when the device boots up.
+
+initramfs from TFTP
+-------------------
+
+The serial console must be used to access the u-boot shell during bootup.
+It can then be used to first boot up the initramfs image from a TFTP server
+(here with the IP 192.168.1.21):
+
+ setenv serverip 192.168.1.21
+ setenv ipaddr 192.168.1.1
+ tftpboot 0c00000 .bin && bootm $fileaddr
+
+The actual sysupgrade image can then be transferred (on the LAN port) to the
+device via
+
+ scp .bin root@192.168.1.1:/tmp/
+
+On the device, the sysupgrade must then be started using
+
+ sysupgrade -n /tmp/.bin
+
+Signed-off-by: Sven Eckelmann
+(cherry picked from commit 8143709c90c3aa0a84e14cf4a9dfbcb365b0d966)
+
+diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79
+index a37057953bc1e9b7fdf2be02136142d0fc145054..f4ccb2faea4e5e6202413a76cd137065dc535fe7 100644
+--- a/package/boot/uboot-envtools/files/ath79
++++ b/package/boot/uboot-envtools/files/ath79
+@@ -95,6 +95,7 @@ netgear,wndr4300tn|\
+ netgear,wndr4300sw)
+ ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
+ ;;
++openmesh,om2p-v1|\
+ openmesh,om2p-v2|\
+ openmesh,om2p-v4|\
+ openmesh,om2p-hs-v1|\
+diff --git a/target/linux/ath79/dts/ar7240_openmesh_om2p-v1.dts b/target/linux/ath79/dts/ar7240_openmesh_om2p-v1.dts
+new file mode 100644
+index 0000000000000000000000000000000000000000..24d406f7ecd2e14729587190de1aecf71029a1eb
+--- /dev/null
++++ b/target/linux/ath79/dts/ar7240_openmesh_om2p-v1.dts
+@@ -0,0 +1,154 @@
++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
++
++#include "ar7240.dtsi"
++
++#include
++#include
++
++/ {
++ compatible = "openmesh,om2p-v1", "qca,ar7240";
++ model = "OpenMesh OM2P v1";
++
++ chosen {
++ /delete-property/ bootargs;
++ };
++
++ aliases {
++ led-boot = &led_power_blue;
++ led-failsafe = &led_power_blue;
++ led-running = &led_power_blue;
++ led-upgrade = &led_power_blue;
++ label-mac-device = ð0;
++ };
++
++ keys {
++ compatible = "gpio-keys";
++
++ reset {
++ label = "reset";
++ linux,code = ;
++ gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
++ };
++ };
++
++ leds {
++ compatible = "gpio-leds";
++
++ pinctrl-names = "default";
++ pinctrl-0 = <&switch_led_disable_pins>;
++
++ led_power_blue: power_blue {
++ label = "blue:power";
++ gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
++ default-state = "on";
++ };
++
++ wifi_green {
++ label = "green:wifi";
++ gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
++ linux,default-trigger = "phy0tpt";
++ };
++
++ wifi_red {
++ label = "red:wifi";
++ gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
++ };
++
++ wifi_yellow {
++ label = "yellow:wifi";
++ gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
++ };
++
++ lan_blue {
++ label = "blue:lan";
++ gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
++ };
++
++ wan_blue {
++ label = "blue:wan";
++ gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
++ };
++ };
++
++ watchdog {
++ compatible = "linux,wdt-gpio";
++ gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
++ hw_algo = "toggle";
++ /* hw_margin_ms is actually 300s but driver limits it to 60s */
++ hw_margin_ms = <60000>;
++ always-running;
++ };
++};
++
++&spi {
++ status = "okay";
++
++ flash@0 {
++ compatible = "jedec,spi-nor";
++ reg = <0>;
++ spi-max-frequency = <40000000>;
++ linux,mtd-name = "ar7240-nor0";
++
++ /* partitions are passed via bootloader */
++ partitions {
++ compatible = "fixed-partitions";
++ #address-cells = <1>;
++ #size-cells = <1>;
++
++ partition@0 {
++ label = "u-boot";
++ reg = <0x000000 0x040000>;
++ read-only;
++ };
++
++ partition@40000 {
++ label = "u-boot-env";
++ reg = <0x040000 0x040000>;
++ };
++
++ partition@80000 {
++ label = "custom";
++ reg = <0x080000 0x140000>;
++ read-only;
++ };
++
++ partition@1c0000 {
++ label = "inactive";
++ reg = <0x1c0000 0x700000>;
++ };
++
++ partition@8c0000 {
++ label = "inactive2";
++ reg = <0x8c0000 0x700000>;
++ };
++
++ art: partition@fc0000 {
++ label = "ART";
++ reg = <0xfc0000 0x040000>;
++ read-only;
++ };
++ };
++ };
++};
++
++ð0 {
++ mtd-mac-address = <&art 0x0>;
++};
++
++ð1 {
++ status = "okay";
++
++ mtd-mac-address = <&art 0x6>;
++};
++
++&pcie {
++ status = "okay";
++
++ wifi@0,0 {
++ compatible = "pci168c,002a";
++ reg = <0x0000 0 0 0 0>;
++ qca,no-eeprom;
++ #gpio-cells = <2>;
++ gpio-controller;
++ };
++};
+diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
+index 3031b4703bfa885c5036856f0ba6a6dc332da4d8..f5384e7fc3859bab1d6c0422de7e173fad3abae2 100755
+--- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds
++++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
+@@ -253,6 +253,10 @@ openmesh,om2p-hs-v4)
+ ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth0"
+ ucidef_set_led_switch "lan" "LAN" "blue:lan" "switch0" "0x02"
+ ;;
++openmesh,om2p-v1)
++ ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth0"
++ ucidef_set_led_switch "lan" "LAN" "blue:lan" "switch0" "0x10"
++ ;;
+ pcs,cr3000)
+ ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1"
+ ucidef_set_led_switch "lan1" "LAN1" "blue:lan1" "switch0" "0x04"
+diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
+index c2932c1737d97f3eb732620041664f5060d16946..5626f79ee199865df4e9a4f04ce2ff9580bce012 100755
+--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
++++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
+@@ -174,6 +174,7 @@ ath79_setup_interfaces()
+ compex,wpj531-16m|\
+ openmesh,a40|\
+ openmesh,a60|\
++ openmesh,om2p-v1|\
+ openmesh,om2p-v4|\
+ openmesh,om2p-hs-v4|\
+ plasmacloud,pa300|\
+diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+index 08d9e017a734e29c9b3be4c865e32f109847b4f5..cf07f138260170bcac789e617e09978776b3d2c5 100644
+--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
++++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+@@ -128,6 +128,9 @@ case "$FIRMWARE" in
+ openmesh,mr600-v2)
+ caldata_extract "ART" 0x5000 0x440
+ ;;
++ openmesh,om2p-v1)
++ caldata_extract "ART" 0x1000 0x440
++ ;;
+ wd,mynet-n750)
+ caldata_extract "art" 0x5000 0x440
+ ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan5mac")
+diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
+index e979c11bb91cb20fd4168b8921499f03572d3512..e9203f3a5b624e1e9b46c474e95e27583bcb6765 100644
+--- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
++++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
+@@ -73,6 +73,7 @@ platform_do_upgrade() {
+ openmesh,mr900-v2|\
+ openmesh,mr1750-v1|\
+ openmesh,mr1750-v2|\
++ openmesh,om2p-v1|\
+ openmesh,om2p-v2|\
+ openmesh,om2p-v4|\
+ openmesh,om2p-hs-v1|\
+diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
+index c63900dc701bbc21dce12086f7045d7d450fc5f3..8113b515368b253d0812fbbb86278e7fde63a038 100644
+--- a/target/linux/ath79/image/generic.mk
++++ b/target/linux/ath79/image/generic.mk
+@@ -1722,6 +1722,16 @@ define Device/openmesh_mr1750-v2
+ endef
+ TARGET_DEVICES += openmesh_mr1750-v2
+
++define Device/openmesh_om2p-v1
++ $(Device/openmesh_common_256k)
++ SOC := ar7240
++ DEVICE_MODEL := OM2P
++ DEVICE_VARIANT := v1
++ OPENMESH_CE_TYPE := OM2P
++ SUPPORTED_DEVICES += om2p
++endef
++TARGET_DEVICES += openmesh_om2p-v1
++
+ define Device/openmesh_om2p-v2
+ $(Device/openmesh_common_256k)
+ SOC := ar9330
diff --git a/patches/openwrt/0009-ath79-Add-support-for-OpenMesh-OM5P-AC-v1.patch b/patches/openwrt/0009-ath79-Add-support-for-OpenMesh-OM5P-AC-v1.patch
new file mode 100644
index 00000000..e5fbe2d8
--- /dev/null
+++ b/patches/openwrt/0009-ath79-Add-support-for-OpenMesh-OM5P-AC-v1.patch
@@ -0,0 +1,348 @@
+From: Sven Eckelmann
+Date: Mon, 23 Nov 2020 13:41:34 +0100
+Subject: ath79: Add support for OpenMesh OM5P-AC v1
+
+Device specifications:
+======================
+
+* Qualcomm/Atheros QCA9558 ver 1 rev 0
+* 720/600/240 MHz (CPU/DDR/AHB)
+* 128 MB of RAM
+* 16 MB of SPI NOR flash
+ - 2x 7 MB available; but one of the 7 MB regions is the recovery image
+* 2T2R 2.4 GHz Wi-Fi (11n)
+* 2T2R 5 GHz Wi-Fi (11ac)
+* 6x GPIO-LEDs (3x wifi, 2x ethernet, 1x power)
+* external h/w watchdog (enabled by default))
+* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
+* TI tmp423 (package kmod-hwmon-tmp421) for temperature monitoring
+* 2x ethernet
+ - eth0
+ + AR8035 ethernet PHY (RGMII)
+ + 10/100/1000 Mbps Ethernet
+ + 802.3af POE
+ + used as LAN interface
+ - eth1
+ + AR8035 ethernet PHY (SGMII)
+ + 10/100/1000 Mbps Ethernet
+ + 18-24V passive POE (mode B)
+ + used as WAN interface
+* 12-24V 1A DC
+* internal antennas
+
+Flashing instructions:
+======================
+
+Various methods can be used to install the actual image on the flash.
+Two easy ones are:
+
+ap51-flash
+----------
+
+The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
+used to transfer the image to the u-boot when the device boots up.
+
+initramfs from TFTP
+-------------------
+
+The serial console must be used to access the u-boot shell during bootup.
+It can then be used to first boot up the initramfs image from a TFTP server
+(here with the IP 192.168.1.21):
+
+ setenv serverip 192.168.1.21
+ setenv ipaddr 192.168.1.1
+ tftpboot 0c00000 .bin && bootm $fileaddr
+
+The actual sysupgrade image can then be transferred (on the LAN port) to the
+device via
+
+ scp .bin root@192.168.1.1:/tmp/
+
+On the device, the sysupgrade must then be started using
+
+ sysupgrade -n /tmp/.bin
+
+Signed-off-by: Sven Eckelmann
+(cherry picked from commit 97f561725962ddb8823b2e01563a0f37f7930477)
+
+diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79
+index f4ccb2faea4e5e6202413a76cd137065dc535fe7..08c066c3494e8ea6fa5db639e11caa6406f3c6f9 100644
+--- a/package/boot/uboot-envtools/files/ath79
++++ b/package/boot/uboot-envtools/files/ath79
+@@ -58,6 +58,7 @@ openmesh,mr900-v2|\
+ openmesh,mr1750-v1|\
+ openmesh,mr1750-v2|\
+ openmesh,om5p|\
++openmesh,om5p-ac-v1|\
+ openmesh,om5p-ac-v2|\
+ samsung,wam250|\
+ ubnt,nanostation-m|\
+diff --git a/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v1.dts b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v1.dts
+new file mode 100644
+index 0000000000000000000000000000000000000000..ae69992abf583168a0ab9a017a9aee33758dd4d8
+--- /dev/null
++++ b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v1.dts
+@@ -0,0 +1,199 @@
++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
++
++#include "qca955x.dtsi"
++
++#include
++#include
++
++/ {
++ compatible = "openmesh,om5p-ac-v1", "qca,qca9558";
++ model = "OpenMesh OM5P-AC v1";
++
++ chosen {
++ /delete-property/ bootargs;
++ };
++
++ aliases {
++ serial0 = &uart;
++ led-boot = &led_power_blue;
++ led-failsafe = &led_power_blue;
++ led-running = &led_power_blue;
++ led-upgrade = &led_power_blue;
++ label-mac-device = ð0;
++ };
++
++ leds {
++ compatible = "gpio-leds";
++
++ led_power_blue: power_blue {
++ label = "blue:power";
++ gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
++ default-state = "on";
++ };
++
++ wan_blue {
++ label = "blue:wan";
++ gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
++ };
++
++ lan_blue {
++ label = "blue:lan";
++ gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
++ };
++
++ wifi_green {
++ label = "green:wifi";
++ gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
++ linux,default-trigger = "phy0tpt";
++ };
++
++ wifi_yellow {
++ label = "yellow:wifi";
++ gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
++ };
++
++ wifi_red {
++ label = "red:wifi";
++ gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
++ };
++ };
++
++ i2c {
++ compatible = "i2c-gpio";
++ gpios = <&gpio 11 GPIO_ACTIVE_HIGH /* sda */
++ &gpio 12 GPIO_ACTIVE_HIGH /* scl */
++ >;
++ #address-cells = <1>;
++ #size-cells = <0>;
++
++ i2c-gpio,scl-open-drain;
++ i2c-gpio,sda-open-drain;
++
++ tmp423a@4c {
++ compatible = "ti,tmp423";
++ reg = <0x4c>;
++ };
++ };
++
++ watchdog {
++ compatible = "linux,wdt-gpio";
++ gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
++ hw_algo = "toggle";
++ /* hw_margin_ms is actually 300s but driver limits it to 60s */
++ hw_margin_ms = <60000>;
++ always-running;
++ };
++};
++
++&spi {
++ status = "okay";
++
++ flash@0 {
++ compatible = "jedec,spi-nor";
++ reg = <0>;
++ spi-max-frequency = <40000000>;
++
++ /* partitions are passed via bootloader */
++ partitions {
++ compatible = "fixed-partitions";
++ #address-cells = <1>;
++ #size-cells = <1>;
++
++ partition@0 {
++ label = "u-boot";
++ reg = <0x000000 0x040000>;
++ read-only;
++ };
++
++ partition@40000 {
++ label = "u-boot-env";
++ reg = <0x040000 0x010000>;
++ };
++
++ partition@50000 {
++ label = "custom";
++ reg = <0x050000 0x060000>;
++ read-only;
++ };
++
++ partition@b0000 {
++ label = "inactive";
++ reg = <0x0b0000 0x7a0000>;
++ };
++
++ partition@850000 {
++ label = "inactive2";
++ reg = <0x850000 0x7a0000>;
++ };
++
++ art: partition@ff0000 {
++ label = "ART";
++ reg = <0xff0000 0x010000>;
++ read-only;
++ };
++ };
++ };
++};
++
++&mdio0 {
++ status = "okay";
++
++ phy-mask = <0x6>;
++
++ phy1: ethernet-phy@1 {
++ reg = <1>;
++ eee-broken-100tx;
++ eee-broken-1000t;
++ };
++
++ phy2: ethernet-phy@2 {
++ reg = <2>;
++ eee-broken-100tx;
++ eee-broken-1000t;
++ at803x-override-sgmii-link-check;
++ };
++};
++
++ð0 {
++ status = "okay";
++
++ pll-data = <0x82000101 0x80000101 0x80001313>;
++
++ mtd-mac-address = <&art 0x0>;
++
++ phy-mode = "rgmii-id";
++ phy-handle = <&phy1>;
++
++ gmac-config {
++ device = <&gmac>;
++ rgmii-enabled = <1>;
++ rxd-delay = <3>;
++ rxdv-delay = <3>;
++ txd-delay = <0>;
++ txen-delay = <0>;
++ };
++};
++
++ð1 {
++ status = "okay";
++
++ pll-data = <0x03000101 0x80000101 0x80001313>;
++
++ mtd-mac-address = <&art 0x6>;
++
++ qca955x-sgmii-fixup;
++
++ phy-handle = <&phy2>;
++};
++
++&wmac {
++ status = "okay";
++
++ mtd-cal-data = <&art 0x1000>;
++ mtd-mac-address = <&art 0x0>;
++ mac-address-increment = <2>;
++};
++
++&pcie1 {
++ status = "okay";
++};
+diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
+index f5384e7fc3859bab1d6c0422de7e173fad3abae2..68ea4281a56bff44147c7792990cc1e26bc10a7c 100755
+--- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds
++++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
+@@ -257,6 +257,10 @@ openmesh,om2p-v1)
+ ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth0"
+ ucidef_set_led_switch "lan" "LAN" "blue:lan" "switch0" "0x10"
+ ;;
++openmesh,om5p-ac-v1)
++ ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0"
++ ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1"
++ ;;
+ pcs,cr3000)
+ ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1"
+ ucidef_set_led_switch "lan1" "LAN1" "blue:lan1" "switch0" "0x04"
+diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+index b70a87054b10fbe708d9aa8603ecdb591fc92591..00dbeec6a51457c23ba97aa627bf14acd8349f74 100644
+--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
++++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+@@ -158,6 +158,10 @@ case "$FIRMWARE" in
+ ;;
+ "ath10k/cal-pci-0000:01:00.0.bin")
+ case $board in
++ openmesh,om5p-ac-v1)
++ caldata_extract "ART" 0x5000 0x844
++ ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16)
++ ;;
+ sitecom,wlr-8100)
+ caldata_extract "art" 0x5000 0x844
+ ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1)
+diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
+index e9203f3a5b624e1e9b46c474e95e27583bcb6765..2cac42c9feaed3c0360091a5b7959e741d4a0473 100644
+--- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
++++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
+@@ -82,6 +82,7 @@ platform_do_upgrade() {
+ openmesh,om2p-hs-v4|\
+ openmesh,om2p-lc|\
+ openmesh,om5p|\
++ openmesh,om5p-ac-v1|\
+ openmesh,om5p-ac-v2)
+ PART_NAME="inactive"
+ platform_do_upgrade_openmesh "$1"
+diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
+index 8113b515368b253d0812fbbb86278e7fde63a038..75dbc1c03b5c42b81463bf7c4ddd4aa5803afd69 100644
+--- a/target/linux/ath79/image/generic.mk
++++ b/target/linux/ath79/image/generic.mk
+@@ -1810,6 +1810,17 @@ define Device/openmesh_om5p
+ endef
+ TARGET_DEVICES += openmesh_om5p
+
++define Device/openmesh_om5p-ac-v1
++ $(Device/openmesh_common_64k)
++ SOC := qca9558
++ DEVICE_MODEL := OM5P-AC
++ DEVICE_VARIANT := v1
++ DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct
++ OPENMESH_CE_TYPE := OM5PAC
++ SUPPORTED_DEVICES += om5p-ac
++endef
++TARGET_DEVICES += openmesh_om5p-ac-v1
++
+ define Device/openmesh_om5p-ac-v2
+ $(Device/openmesh_common_64k)
+ SOC := qca9558
diff --git a/patches/openwrt/0010-ath79-Add-support-for-OpenMesh-OM5P-AN.patch b/patches/openwrt/0010-ath79-Add-support-for-OpenMesh-OM5P-AN.patch
new file mode 100644
index 00000000..bfa278de
--- /dev/null
+++ b/patches/openwrt/0010-ath79-Add-support-for-OpenMesh-OM5P-AN.patch
@@ -0,0 +1,365 @@
+From: Sven Eckelmann
+Date: Mon, 23 Nov 2020 13:41:34 +0100
+Subject: ath79: Add support for OpenMesh OM5P-AN
+
+Device specifications:
+======================
+
+* Qualcomm/Atheros AR9344 rev 2
+* 560/450/225 MHz (CPU/DDR/AHB)
+* 64 MB of RAM
+* 16 MB of SPI NOR flash
+ - 2x 7 MB available; but one of the 7 MB regions is the recovery image
+* 1T1R 2.4 GHz Wi-Fi
+* 2T2R 5 GHz Wi-Fi
+* 6x GPIO-LEDs (3x wifi, 2x ethernet, 1x power)
+* 1x GPIO-button (reset)
+* external h/w watchdog (enabled by default)
+* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
+* TI tmp423 (package kmod-hwmon-tmp421) for temperature monitoring
+* 2x ethernet
+ - eth0
+ + AR8035 ethernet PHY
+ + 10/100/1000 Mbps Ethernet
+ + 802.3af POE
+ + used as LAN interface
+ - eth1
+ + 10/100 Mbps Ethernet
+ + builtin switch port 1
+ + 18-24V passive POE (mode B)
+ + used as WAN interface
+* 12-24V 1A DC
+* internal antennas
+
+Flashing instructions:
+======================
+
+Various methods can be used to install the actual image on the flash.
+Two easy ones are:
+
+ap51-flash
+----------
+
+The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
+used to transfer the image to the u-boot when the device boots up.
+
+initramfs from TFTP
+-------------------
+
+The serial console must be used to access the u-boot shell during bootup.
+It can then be used to first boot up the initramfs image from a TFTP server
+(here with the IP 192.168.1.21):
+
+ setenv serverip 192.168.1.21
+ setenv ipaddr 192.168.1.1
+ tftpboot 0c00000 .bin && bootm $fileaddr
+
+The actual sysupgrade image can then be transferred (on the LAN port) to the
+device via
+
+ scp .bin root@192.168.1.1:/tmp/
+
+On the device, the sysupgrade must then be started using
+
+ sysupgrade -n /tmp/.bin
+
+Signed-off-by: Sven Eckelmann
+(cherry picked from commit 72ef5945508193228544bcd7fcfe81b32e8dc042)
+
+diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79
+index 08c066c3494e8ea6fa5db639e11caa6406f3c6f9..78e5fc0a2be25e1ed676ac647214f237f29b4667 100644
+--- a/package/boot/uboot-envtools/files/ath79
++++ b/package/boot/uboot-envtools/files/ath79
+@@ -58,6 +58,7 @@ openmesh,mr900-v2|\
+ openmesh,mr1750-v1|\
+ openmesh,mr1750-v2|\
+ openmesh,om5p|\
++openmesh,om5p-an|\
+ openmesh,om5p-ac-v1|\
+ openmesh,om5p-ac-v2|\
+ samsung,wam250|\
+diff --git a/target/linux/ath79/dts/ar9344_openmesh_om5p-an.dts b/target/linux/ath79/dts/ar9344_openmesh_om5p-an.dts
+new file mode 100644
+index 0000000000000000000000000000000000000000..6950ba3a2936cf8c9b12a22c966dc3b9215f2227
+--- /dev/null
++++ b/target/linux/ath79/dts/ar9344_openmesh_om5p-an.dts
+@@ -0,0 +1,216 @@
++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
++
++#include "ar9344.dtsi"
++
++#include
++#include
++
++/ {
++ compatible = "openmesh,om5p-an", "qca,ar9344";
++ model = "OpenMesh OM5P-AN";
++
++ chosen {
++ /delete-property/ bootargs;
++ };
++
++ aliases {
++ led-boot = &led_power_blue;
++ led-failsafe = &led_power_blue;
++ led-running = &led_power_blue;
++ led-upgrade = &led_power_blue;
++ label-mac-device = ð0;
++ };
++
++ keys {
++ compatible = "gpio-keys";
++
++ reset {
++ label = "reset";
++ linux,code = ;
++ gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
++ };
++ };
++
++ leds {
++ compatible = "gpio-leds";
++
++ pinctrl-names = "default";
++ pinctrl-0 = <&led_lan_wan_blue_pin>;
++
++ led_power_blue: power_blue {
++ label = "blue:power";
++ gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
++ default-state = "on";
++ };
++
++ wan_blue {
++ label = "blue:wan";
++ gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
++ };
++
++ lan_blue {
++ label = "blue:lan";
++ gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
++ };
++
++ wifi_green {
++ label = "green:wifi";
++ gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
++ linux,default-trigger = "phy0tpt";
++ };
++
++ wifi_yellow {
++ label = "yellow:wifi";
++ gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
++ };
++
++ wifi_red {
++ label = "red:wifi";
++ gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
++ };
++ };
++
++ i2c {
++ compatible = "i2c-gpio";
++ gpios = <&gpio 21 GPIO_ACTIVE_HIGH /* sda */
++ &gpio 20 GPIO_ACTIVE_HIGH /* scl */
++ >;
++ #address-cells = <1>;
++ #size-cells = <0>;
++
++ i2c-gpio,scl-open-drain;
++ i2c-gpio,sda-open-drain;
++
++ tmp423a@4c {
++ compatible = "ti,tmp423";
++ reg = <0x4c>;
++ };
++ };
++
++ watchdog {
++ compatible = "linux,wdt-gpio";
++ gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
++ hw_algo = "toggle";
++ /* hw_margin_ms is actually 300s but driver limits it to 60s */
++ hw_margin_ms = <60000>;
++ always-running;
++ };
++};
++
++&ref {
++ clock-frequency = <40000000>;
++};
++
++&pinmux {
++ led_lan_wan_blue_pin: pinmux_lan_wan_blue_pin {
++ pinctrl-single,bits = <0xc 0x0 0xffff0000>;
++ };
++};
++
++&spi {
++ status = "okay";
++
++ flash@0 {
++ compatible = "jedec,spi-nor";
++ reg = <0>;
++ spi-max-frequency = <40000000>;
++
++ /* partitions are passed via bootloader */
++ partitions {
++ compatible = "fixed-partitions";
++ #address-cells = <1>;
++ #size-cells = <1>;
++
++ partition@0 {
++ label = "u-boot";
++ reg = <0x000000 0x040000>;
++ read-only;
++ };
++
++ partition@40000 {
++ label = "u-boot-env";
++ reg = <0x040000 0x010000>;
++ };
++
++ partition@50000 {
++ label = "custom";
++ reg = <0x050000 0x060000>;
++ read-only;
++ };
++
++ partition@b0000 {
++ label = "inactive";
++ reg = <0x0b0000 0x7a0000>;
++ };
++
++ partition@850000 {
++ label = "inactive2";
++ reg = <0x850000 0x7a0000>;
++ };
++
++ art: partition@ff0000 {
++ label = "ART";
++ reg = <0xff0000 0x010000>;
++ read-only;
++ };
++ };
++ };
++};
++
++&mdio0 {
++ status = "okay";
++
++ phy-mask = <0x80>;
++
++ phy7: ethernet-phy@7 {
++ reg = <7>;
++ eee-broken-100tx;
++ eee-broken-1000t;
++ };
++};
++
++ð0 {
++ status = "okay";
++
++ pll-data = <0x02000000 0x00000101 0x00001313>;
++
++ mtd-mac-address = <&art 0x0>;
++
++ phy-mode = "rgmii-id";
++ phy-handle = <&phy7>;
++
++ gmac-config {
++ device = <&gmac>;
++ rgmii-gmac0 = <1>;
++ rxd-delay = <2>;
++ rxdv-delay = <2>;
++ switch-phy-swap = <1>;
++ };
++};
++
++ð1 {
++ status = "okay";
++
++ mtd-mac-address = <&art 0x0>;
++ mac-address-increment = <1>;
++};
++
++&wmac {
++ status = "okay";
++
++ mtd-cal-data = <&art 0x1000>;
++ mtd-mac-address = <&art 0x0>;
++ mac-address-increment = <2>;
++};
++
++&pcie {
++ status = "okay";
++
++ wifi@0,0 {
++ compatible = "pci168c,0030";
++ reg = <0x0000 0 0 0 0>;
++ qca,no-eeprom;
++ mtd-mac-address = <&art 0x0>;
++ mac-address-increment = <16>;
++ };
++};
+diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
+index 68ea4281a56bff44147c7792990cc1e26bc10a7c..403ca9edd940d76bf9695cc18fe0c8cdd7e22967 100755
+--- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds
++++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
+@@ -261,6 +261,10 @@ openmesh,om5p-ac-v1)
+ ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0"
+ ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1"
+ ;;
++openmesh,om5p-an)
++ ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0"
++ ucidef_set_led_switch "wan" "WAN" "blue:wan" "switch0" "0x02"
++ ;;
+ pcs,cr3000)
+ ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1"
+ ucidef_set_led_switch "lan1" "LAN1" "blue:lan1" "switch0" "0x04"
+diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+index cf07f138260170bcac789e617e09978776b3d2c5..fbce7d672b2306094544aacf527257e7e6a6ba8c 100644
+--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
++++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+@@ -125,7 +125,8 @@ case "$FIRMWARE" in
+ caldata_extract "art" 0x1000 0x1000
+ ;;
+ openmesh,mr600-v1|\
+- openmesh,mr600-v2)
++ openmesh,mr600-v2|\
++ openmesh,om5p-an)
+ caldata_extract "ART" 0x5000 0x440
+ ;;
+ openmesh,om2p-v1)
+diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
+index 2cac42c9feaed3c0360091a5b7959e741d4a0473..67e53c5fdebf29e71b920753be829fa4e41ca207 100644
+--- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
++++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
+@@ -83,7 +83,8 @@ platform_do_upgrade() {
+ openmesh,om2p-lc|\
+ openmesh,om5p|\
+ openmesh,om5p-ac-v1|\
+- openmesh,om5p-ac-v2)
++ openmesh,om5p-ac-v2|\
++ openmesh,om5p-an)
+ PART_NAME="inactive"
+ platform_do_upgrade_openmesh "$1"
+ ;;
+diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
+index 75dbc1c03b5c42b81463bf7c4ddd4aa5803afd69..000fec405e161dc4906e88dd967f73c2df95f296 100644
+--- a/target/linux/ath79/image/generic.mk
++++ b/target/linux/ath79/image/generic.mk
+@@ -1832,6 +1832,15 @@ define Device/openmesh_om5p-ac-v2
+ endef
+ TARGET_DEVICES += openmesh_om5p-ac-v2
+
++define Device/openmesh_om5p-an
++ $(Device/openmesh_common_64k)
++ SOC := ar9344
++ DEVICE_MODEL := OM5P-AN
++ OPENMESH_CE_TYPE := OM5P
++ SUPPORTED_DEVICES += om5p-an
++endef
++TARGET_DEVICES += openmesh_om5p-an
++
+ define Device/pcs_cap324
+ SOC := ar9344
+ DEVICE_VENDOR := PowerCloud Systems
diff --git a/patches/packages/packages/0002-fastd-simplify-Config.in.patch b/patches/packages/packages/0002-fastd-simplify-Config.in.patch
new file mode 100644
index 00000000..973342cf
--- /dev/null
+++ b/patches/packages/packages/0002-fastd-simplify-Config.in.patch
@@ -0,0 +1,124 @@
+From: Matthias Schiffer
+Date: Sun, 7 Mar 2021 11:48:32 +0100
+Subject: fastd: simplify Config.in
+
+Signed-off-by: Matthias Schiffer
+(cherry picked from commit 45976ff31a9894dec35fc4a077c9652f6cb59a54)
+
+diff --git a/net/fastd/Config.in b/net/fastd/Config.in
+index 8302f7ee4dac874b1303ebeeb836551ef202c261..89ff6850aa5ab4ad0e762d8fb9473d5e5c820089 100644
+--- a/net/fastd/Config.in
++++ b/net/fastd/Config.in
+@@ -1,102 +1,79 @@
++if PACKAGE_fastd
++
+ menu "Configuration"
+- depends on PACKAGE_fastd
+
+ config FASTD_ENABLE_METHOD_CIPHER_TEST
+ bool "Enable cipher-test method provider"
+- depends on PACKAGE_fastd
+- default n
+
+ config FASTD_ENABLE_METHOD_COMPOSED_GMAC
+ bool "Enable composed-gmac method provider"
+- depends on PACKAGE_fastd
++ select FASTD_ENABLE_MAC_GHASH
+ default y
+
+ config FASTD_ENABLE_METHOD_COMPOSED_UMAC
+ bool "Enable composed-umac method provider"
+- depends on PACKAGE_fastd
++ select FASTD_ENABLE_MAC_UHASH
+ default y
+
+ config FASTD_ENABLE_METHOD_GENERIC_GMAC
+ bool "Enable generic-gmac method provider"
+- depends on PACKAGE_fastd
++ select FASTD_ENABLE_MAC_GHASH
+ default y
+
+ config FASTD_ENABLE_METHOD_GENERIC_POLY1305
+ bool "Enable generic-poly1305 method provider"
+- depends on PACKAGE_fastd
+- default n
+
+ config FASTD_ENABLE_METHOD_GENERIC_UMAC
+ bool "Enable generic-umac method provider"
+- depends on PACKAGE_fastd
++ select FASTD_ENABLE_MAC_UHASH
+ default y
+
+ config FASTD_ENABLE_METHOD_NULL
+ bool "Enable null method"
+- depends on PACKAGE_fastd
+ default y
+
+
+ config FASTD_ENABLE_CIPHER_NULL
+ bool "Enable the null cipher"
+- depends on PACKAGE_fastd
+ default y
+
+ config FASTD_ENABLE_CIPHER_SALSA20
+ bool "Enable the Salsa20 cipher"
+- depends on PACKAGE_fastd
+- default n
+
+ config FASTD_ENABLE_CIPHER_SALSA2012
+ bool "Enable the Salsa20/12 cipher"
+- depends on PACKAGE_fastd
+ default y
+
+
+ config FASTD_ENABLE_MAC_GHASH
+- bool "Enable the GHASH message authentication code"
+- depends on PACKAGE_fastd
+- default y
++ bool
+
+ config FASTD_ENABLE_MAC_UHASH
+- bool "Enable the UHASH message authentication code"
+- depends on PACKAGE_fastd
+- default y
++ bool
+
+
+ config FASTD_WITH_CAPABILITIES
+ bool "Enable POSIX capability support"
+- depends on PACKAGE_fastd
+- default n
+
+ config FASTD_WITH_CMDLINE_USER
+ bool "Include support for setting user/group related options on the command line"
+- depends on PACKAGE_fastd
+- default n
+
+ config FASTD_WITH_CMDLINE_LOGGING
+ bool "Include support for setting logging related options on the command line"
+- depends on PACKAGE_fastd
+- default n
+
+ config FASTD_WITH_CMDLINE_OPERATION
+ bool "Include support for setting options related to the VPN operation (like mode, interface, encryption method) on the command line"
+- depends on PACKAGE_fastd
+- default n
+
+ config FASTD_WITH_CMDLINE_COMMANDS
+ bool "Include support for setting handler scripts (e.g. --on-up) on the command line"
+- depends on PACKAGE_fastd
+- default n
+
+ config FASTD_WITH_DYNAMIC_PEERS
+ bool "Include support for dynamic peers (using on-verify handlers)"
+- depends on PACKAGE_fastd
+- default n
+
+ config FASTD_WITH_STATUS_SOCKET
+ bool "Include support for status sockets"
+- depends on PACKAGE_fastd
+ default y
+
+ endmenu
++
++endif
diff --git a/patches/packages/packages/0003-fastd-disable-GMAC-based-methods-by-default.patch b/patches/packages/packages/0003-fastd-disable-GMAC-based-methods-by-default.patch
new file mode 100644
index 00000000..a0075a0b
--- /dev/null
+++ b/patches/packages/packages/0003-fastd-disable-GMAC-based-methods-by-default.patch
@@ -0,0 +1,32 @@
+From: Matthias Schiffer
+Date: Sun, 7 Mar 2021 11:50:04 +0100
+Subject: fastd: disable GMAC-based methods by default
+
+The UMAC-based methods provide higher performance than GMAC and aren't
+suspectible to timing attacks when implemented in software (which is
+always the case on OpenWrt, as OpenSSL support is disabled). Disable
+GMAC by default to save a few KiB.
+
+Signed-off-by: Matthias Schiffer
+(cherry picked from commit 916a65781829d93856bfb82cf78ba333b8fbc973)
+
+diff --git a/net/fastd/Config.in b/net/fastd/Config.in
+index 89ff6850aa5ab4ad0e762d8fb9473d5e5c820089..b6d46246e53516cdb7fc6e4857ea62481b4e8276 100644
+--- a/net/fastd/Config.in
++++ b/net/fastd/Config.in
+@@ -8,7 +8,6 @@ config FASTD_ENABLE_METHOD_CIPHER_TEST
+ config FASTD_ENABLE_METHOD_COMPOSED_GMAC
+ bool "Enable composed-gmac method provider"
+ select FASTD_ENABLE_MAC_GHASH
+- default y
+
+ config FASTD_ENABLE_METHOD_COMPOSED_UMAC
+ bool "Enable composed-umac method provider"
+@@ -18,7 +17,6 @@ config FASTD_ENABLE_METHOD_COMPOSED_UMAC
+ config FASTD_ENABLE_METHOD_GENERIC_GMAC
+ bool "Enable generic-gmac method provider"
+ select FASTD_ENABLE_MAC_GHASH
+- default y
+
+ config FASTD_ENABLE_METHOD_GENERIC_POLY1305
+ bool "Enable generic-poly1305 method provider"
diff --git a/patches/packages/packages/0004-fastd-update-to-v22.patch b/patches/packages/packages/0004-fastd-update-to-v22.patch
new file mode 100644
index 00000000..4c1f8016
--- /dev/null
+++ b/patches/packages/packages/0004-fastd-update-to-v22.patch
@@ -0,0 +1,59 @@
+From: Matthias Schiffer
+Date: Sun, 27 Jun 2021 13:07:49 +0200
+Subject: fastd: update to v22
+
+Signed-off-by: Matthias Schiffer
+(cherry picked from commit c8ca43865dcc7be0e3193f9b7d12f40d3441c258)
+
+diff --git a/net/fastd/Config.in b/net/fastd/Config.in
+index b6d46246e53516cdb7fc6e4857ea62481b4e8276..157d1e39931cc0163785212cb5eea7d8af4f46f2 100644
+--- a/net/fastd/Config.in
++++ b/net/fastd/Config.in
+@@ -30,6 +30,10 @@ config FASTD_ENABLE_METHOD_NULL
+ bool "Enable null method"
+ default y
+
++config FASTD_ENABLE_METHOD_NULL_L2TP
++ bool "Enable null@l2tp method"
++ default y
++
+
+ config FASTD_ENABLE_CIPHER_NULL
+ bool "Enable the null cipher"
+diff --git a/net/fastd/Makefile b/net/fastd/Makefile
+index c7ab056a9ae005a75a75911658607e64d6228aac..d1ed4cf9afbe2faf11a0fa3b7b4d281848a8df2d 100644
+--- a/net/fastd/Makefile
++++ b/net/fastd/Makefile
+@@ -8,12 +8,12 @@
+ include $(TOPDIR)/rules.mk
+
+ PKG_NAME:=fastd
+-PKG_VERSION:=21
++PKG_VERSION:=22
+
+ PKG_MAINTAINER:=Matthias Schiffer
+ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+ PKG_SOURCE_URL:=https://github.com/NeoRaider/fastd/releases/download/v$(PKG_VERSION)
+-PKG_HASH:=942f33bcd794bcb8e19da4c30c875bdfd4d0f1c24ec4dcdf51237791bbfb0d4c
++PKG_HASH:=19750b88705d66811b7c21b672537909c19ae6b21350688cbd1a3a54d08a8951
+
+ PKG_LICENSE:=BSD-2-Clause
+ PKG_LICENSE_FILES:=COPYRIGHT
+@@ -26,6 +26,7 @@ PKG_CONFIG_DEPENDS:=\
+ CONFIG_FASTD_ENABLE_METHOD_GENERIC_POLY1305 \
+ CONFIG_FASTD_ENABLE_METHOD_GENERIC_UMAC \
+ CONFIG_FASTD_ENABLE_METHOD_NULL \
++ CONFIG_FASTD_ENABLE_METHOD_NULL_L2TP \
+ CONFIG_FASTD_ENABLE_CIPHER_NULL \
+ CONFIG_FASTD_ENABLE_CIPHER_SALSA20 \
+ CONFIG_FASTD_ENABLE_CIPHER_SALSA2012 \
+@@ -81,7 +82,9 @@ MESON_ARGS += \
+ -Dmethod_generic-poly1305=$(call feature,ENABLE_METHOD_GENERIC_POLY1305) \
+ -Dmethod_generic-umac=$(call feature,ENABLE_METHOD_GENERIC_UMAC) \
+ -Dmethod_null=$(call feature,ENABLE_METHOD_NULL) \
++ -Dmethod_null_l2tp=$(call feature,ENABLE_METHOD_NULL_L2TP) \
+ -Dstatus_socket=$(call feature,WITH_STATUS_SOCKET) \
++ -Doffload_l2tp=disabled \
+ -Dsystemd=disabled \
+ -Duse_nacl=true \
+ -Db_lto=true \
diff --git a/patches/packages/packages/0005-fastd-add-L2TP-variant.patch b/patches/packages/packages/0005-fastd-add-L2TP-variant.patch
new file mode 100644
index 00000000..61948e3c
--- /dev/null
+++ b/patches/packages/packages/0005-fastd-add-L2TP-variant.patch
@@ -0,0 +1,88 @@
+From: Matthias Schiffer
+Date: Sun, 27 Jun 2021 13:26:26 +0200
+Subject: fastd: add L2TP variant
+
+Signed-off-by: Matthias Schiffer
+(cherry picked from commit 7b9c04f95b5202d5eb75e4bf1c6831a667ac3d0f)
+
+diff --git a/net/fastd/Config.in b/net/fastd/Config.in
+index 157d1e39931cc0163785212cb5eea7d8af4f46f2..3da5e1f183c5400cc38650efad39edf31c6f18d0 100644
+--- a/net/fastd/Config.in
++++ b/net/fastd/Config.in
+@@ -1,4 +1,4 @@
+-if PACKAGE_fastd
++if PACKAGE_fastd || PACKAGE_fastd-l2tp
+
+ menu "Configuration"
+
+diff --git a/net/fastd/Makefile b/net/fastd/Makefile
+index d1ed4cf9afbe2faf11a0fa3b7b4d281848a8df2d..58255cb0ba1a3b00fbca7cfdd44abd3a923603f3 100644
+--- a/net/fastd/Makefile
++++ b/net/fastd/Makefile
+@@ -15,8 +15,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+ PKG_SOURCE_URL:=https://github.com/NeoRaider/fastd/releases/download/v$(PKG_VERSION)
+ PKG_HASH:=19750b88705d66811b7c21b672537909c19ae6b21350688cbd1a3a54d08a8951
+
+-PKG_LICENSE:=BSD-2-Clause
+-PKG_LICENSE_FILES:=COPYRIGHT
++PKG_LICENSE:=BSD-2-Clause LGPL-2.1-or-later
++PKG_LICENSE_FILES:=COPYRIGHT src/dep/libmnl/COPYING
+
+ PKG_CONFIG_DEPENDS:=\
+ CONFIG_FASTD_ENABLE_METHOD_CIPHER_TEST \
+@@ -54,6 +54,14 @@ define Package/fastd
+ TITLE:=Fast and Secure Tunneling Daemon
+ URL:=https://github.com/NeoRaider/fastd/
+ SUBMENU:=VPN
++ VARIANT:=default
++endef
++define Package/fastd-l2tp
++$(Package/fastd)
++ DEPENDS+=+kmod-l2tp +kmod-l2tp-eth
++ TITLE+=(L2TP kernel offloading)
++ VARIANT:=l2tp
++ PROVIDES:=fastd
+ endef
+
+ define Package/fastd/config
+@@ -85,18 +93,31 @@ MESON_ARGS += \
+ -Dmethod_null_l2tp=$(call feature,ENABLE_METHOD_NULL_L2TP) \
+ -Dstatus_socket=$(call feature,WITH_STATUS_SOCKET) \
+ -Doffload_l2tp=disabled \
++ -Dlibmnl_builtin=true \
+ -Dsystemd=disabled \
+ -Duse_nacl=true \
+ -Db_lto=true \
+ -Dprefix=/usr
+
++ifeq ($(BUILD_VARIANT),l2tp)
++ MESON_ARGS += \
++ -Dmethod_null_l2tp=enabled \
++ -Doffload_l2tp=enabled
++endif
++
+ define Package/fastd/description
+- Fast and secure tunneling daemon, which is optimized on small code size and few dependencies
++Fast and secure tunneling daemon, which is optimized on small code size and few dependencies
++endef
++define Package/fastd-l2tp/description
++$(Package/fastd/description)
++
++This variant enables L2TP kernel offloadig support.
+ endef
+
+ define Package/fastd/conffiles
+ /etc/config/fastd
+ endef
++Package/fastd-l2tp/conffiles = $(Package/fastd/conffiles)
+
+ define Package/fastd/install
+ $(INSTALL_DIR) $(1)/usr/bin
+@@ -110,5 +131,7 @@ define Package/fastd/install
+ $(INSTALL_DIR) $(1)/lib/upgrade/keep.d
+ $(INSTALL_DATA) files/fastd.upgrade $(1)/lib/upgrade/keep.d/fastd
+ endef
++Package/fastd-l2tp/install = $(Package/fastd/install)
+
+ $(eval $(call BuildPackage,fastd))
++$(eval $(call BuildPackage,fastd-l2tp))
diff --git a/patches/packages/packages/0006-fastd-fix-start-of-non-L2TP-variant.patch b/patches/packages/packages/0006-fastd-fix-start-of-non-L2TP-variant.patch
new file mode 100644
index 00000000..a34ce851
--- /dev/null
+++ b/patches/packages/packages/0006-fastd-fix-start-of-non-L2TP-variant.patch
@@ -0,0 +1,63 @@
+From: Matthias Schiffer
+Date: Sun, 27 Jun 2021 14:48:48 +0200
+Subject: fastd: fix start of non-L2TP variant
+
+Signed-off-by: Matthias Schiffer
+(cherry picked from commit 62742985d7cf15029b4d6027a7ccfa0e480278ca)
+
+diff --git a/net/fastd/Makefile b/net/fastd/Makefile
+index 58255cb0ba1a3b00fbca7cfdd44abd3a923603f3..6fd316374d876834995f696fc63e7fbb98fb437c 100644
+--- a/net/fastd/Makefile
++++ b/net/fastd/Makefile
+@@ -9,6 +9,7 @@ include $(TOPDIR)/rules.mk
+
+ PKG_NAME:=fastd
+ PKG_VERSION:=22
++PKG_RELEASE=2
+
+ PKG_MAINTAINER:=Matthias Schiffer
+ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+diff --git a/net/fastd/patches/0001-config-allow-disabling-L2TP-offload-when-fastd-doesn.patch b/net/fastd/patches/0001-config-allow-disabling-L2TP-offload-when-fastd-doesn.patch
+new file mode 100644
+index 0000000000000000000000000000000000000000..f2eabc95d61abf070907239b9d5d5935bd82966c
+--- /dev/null
++++ b/net/fastd/patches/0001-config-allow-disabling-L2TP-offload-when-fastd-doesn.patch
+@@ -0,0 +1,38 @@
++From d95ae843845760aecbbc62a734c2b93b401b1834 Mon Sep 17 00:00:00 2001
++Message-Id:
++From: Matthias Schiffer
++Date: Sun, 27 Jun 2021 14:45:46 +0200
++Subject: [PATCH] config: allow disabling L2TP offload when fastd doesn't
++ support it
++
++Only attempting to enable the offloading should raise an error when it
++is not supported.
++---
++ src/config.y | 8 +++++---
++ 1 file changed, 5 insertions(+), 3 deletions(-)
++
++diff --git a/src/config.y b/src/config.y
++index a107d7b9fda7..7a3ec6a32649 100644
++--- a/src/config.y
+++++ b/src/config.y
++@@ -282,12 +282,14 @@ offload: TOK_L2TP boolean {
++ #ifdef WITH_OFFLOAD_L2TP
++ conf.offload_l2tp = $2;
++ #else
+++ if ($2) {
++ # ifdef __linux__
++- fastd_config_error(&@$, state, "L2TP offload is not supported by this build of fastd");
+++ fastd_config_error(&@$, state, "L2TP offload is not supported by this build of fastd");
++ # else
++- fastd_config_error(&@$, state, "L2TP offload is not supported on this platform");
+++ fastd_config_error(&@$, state, "L2TP offload is not supported on this platform");
++ # endif
++- YYERROR;
+++ YYERROR;
+++ }
++ #endif
++ }
++ ;
++--
++2.32.0
++
diff --git a/patches/packages/packages/0007-fastd-make-L2TP-support-a-config-option-instead-of-a-variant.patch b/patches/packages/packages/0007-fastd-make-L2TP-support-a-config-option-instead-of-a-variant.patch
new file mode 100644
index 00000000..7759d711
--- /dev/null
+++ b/patches/packages/packages/0007-fastd-make-L2TP-support-a-config-option-instead-of-a-variant.patch
@@ -0,0 +1,112 @@
+From: Matthias Schiffer
+Date: Sun, 27 Jun 2021 16:46:38 +0200
+Subject: fastd: make L2TP support a config option instead of a variant
+
+We enable the option by default, but do not depend on the kernel modules
+required for L2TP offloading to avoid wasting space when the feature is
+not needed. To use offloading, kmod-l2tp-eth must be installed.
+
+Signed-off-by: Matthias Schiffer
+(cherry picked from commit 03ff71d5ba955ad2d3f23de30e526ab6452297d4)
+
+diff --git a/net/fastd/Config.in b/net/fastd/Config.in
+index 3da5e1f183c5400cc38650efad39edf31c6f18d0..67ae7c6b1390632735c5d26bade2cb2c570a9a43 100644
+--- a/net/fastd/Config.in
++++ b/net/fastd/Config.in
+@@ -1,4 +1,4 @@
+-if PACKAGE_fastd || PACKAGE_fastd-l2tp
++if PACKAGE_fastd
+
+ menu "Configuration"
+
+@@ -76,6 +76,10 @@ config FASTD_WITH_STATUS_SOCKET
+ bool "Include support for status sockets"
+ default y
+
++config FASTD_WITH_OFFLOAD_L2TP
++ bool "Enable L2TP offloading"
++ default y
++
+ endmenu
+
+ endif
+diff --git a/net/fastd/Makefile b/net/fastd/Makefile
+index 6fd316374d876834995f696fc63e7fbb98fb437c..9175227a5fe179bdb9d38d5e173f84908fb216ef 100644
+--- a/net/fastd/Makefile
++++ b/net/fastd/Makefile
+@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
+
+ PKG_NAME:=fastd
+ PKG_VERSION:=22
+-PKG_RELEASE=2
++PKG_RELEASE=3
+
+ PKG_MAINTAINER:=Matthias Schiffer
+ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+@@ -39,7 +39,8 @@ PKG_CONFIG_DEPENDS:=\
+ CONFIG_FASTD_WITH_CMDLINE_OPERATION \
+ CONFIG_FASTD_WITH_CMDLINE_COMMANDS \
+ CONFIG_FASTD_WITH_DYNAMIC_PEERS \
+- CONFIG_FASTD_WITH_STATUS_SOCKET
++ CONFIG_FASTD_WITH_STATUS_SOCKET \
++ CONFIG_FASTD_WITH_OFFLOAD_L2TP
+
+
+ PKG_BUILD_DEPENDS:=meson/host nacl
+@@ -55,14 +56,6 @@ define Package/fastd
+ TITLE:=Fast and Secure Tunneling Daemon
+ URL:=https://github.com/NeoRaider/fastd/
+ SUBMENU:=VPN
+- VARIANT:=default
+-endef
+-define Package/fastd-l2tp
+-$(Package/fastd)
+- DEPENDS+=+kmod-l2tp +kmod-l2tp-eth
+- TITLE+=(L2TP kernel offloading)
+- VARIANT:=l2tp
+- PROVIDES:=fastd
+ endef
+
+ define Package/fastd/config
+@@ -93,32 +86,20 @@ MESON_ARGS += \
+ -Dmethod_null=$(call feature,ENABLE_METHOD_NULL) \
+ -Dmethod_null_l2tp=$(call feature,ENABLE_METHOD_NULL_L2TP) \
+ -Dstatus_socket=$(call feature,WITH_STATUS_SOCKET) \
+- -Doffload_l2tp=disabled \
++ -Doffload_l2tp=$(call feature,WITH_OFFLOAD_L2TP) \
+ -Dlibmnl_builtin=true \
+ -Dsystemd=disabled \
+ -Duse_nacl=true \
+ -Db_lto=true \
+ -Dprefix=/usr
+
+-ifeq ($(BUILD_VARIANT),l2tp)
+- MESON_ARGS += \
+- -Dmethod_null_l2tp=enabled \
+- -Doffload_l2tp=enabled
+-endif
+-
+ define Package/fastd/description
+ Fast and secure tunneling daemon, which is optimized on small code size and few dependencies
+ endef
+-define Package/fastd-l2tp/description
+-$(Package/fastd/description)
+-
+-This variant enables L2TP kernel offloadig support.
+-endef
+
+ define Package/fastd/conffiles
+ /etc/config/fastd
+ endef
+-Package/fastd-l2tp/conffiles = $(Package/fastd/conffiles)
+
+ define Package/fastd/install
+ $(INSTALL_DIR) $(1)/usr/bin
+@@ -132,7 +113,5 @@ define Package/fastd/install
+ $(INSTALL_DIR) $(1)/lib/upgrade/keep.d
+ $(INSTALL_DATA) files/fastd.upgrade $(1)/lib/upgrade/keep.d/fastd
+ endef
+-Package/fastd-l2tp/install = $(Package/fastd/install)
+
+ $(eval $(call BuildPackage,fastd))
+-$(eval $(call BuildPackage,fastd-l2tp))
diff --git a/scripts/target_config_lib.lua b/scripts/target_config_lib.lua
index c2237f72..ccda8e42 100644
--- a/scripts/target_config_lib.lua
+++ b/scripts/target_config_lib.lua
@@ -155,8 +155,6 @@ if #lib.devices > 0 then
handle_target_pkgs(lib.target_packages)
for _, dev in ipairs(lib.devices) do
- local profile = dev.options.profile or dev.name
-
local device_pkgs = {}
local function handle_pkgs(pkgs)
for _, pkg in ipairs(pkgs) do
@@ -172,10 +170,10 @@ if #lib.devices > 0 then
handle_pkgs(dev.options.packages or {})
handle_pkgs(site_packages(dev.image))
- local profile_config = string.format('%s_DEVICE_%s', openwrt_config_target, profile)
+ local profile_config = string.format('%s_DEVICE_%s', openwrt_config_target, dev.name)
lib.config(
'TARGET_DEVICE_' .. profile_config, true,
- string.format("unable to enable device '%s'", profile)
+ string.format("unable to enable device '%s'", dev.name)
)
lib.config(
'TARGET_DEVICE_PACKAGES_' .. profile_config,
diff --git a/scripts/target_lib.lua b/scripts/target_lib.lua
index 1c2395e6..b8dd933e 100644
--- a/scripts/target_lib.lua
+++ b/scripts/target_lib.lua
@@ -31,7 +31,6 @@ M.images = {}
local default_options = {
- profile = false,
factory = '-squashfs-factory',
factory_ext = '.bin',
sysupgrade = '-squashfs-sysupgrade',
diff --git a/targets/ath79-generic b/targets/ath79-generic
index cd005100..0bd73699 100644
--- a/targets/ath79-generic
+++ b/targets/ath79-generic
@@ -22,6 +22,12 @@ local ATH10K_PACKAGES_QCA9888 = {
'-ath10k-firmware-qca9888-ct',
}
+-- AVM
+
+device('avm-fritz-wlan-repeater-450e', 'avm_fritz450e', {
+ factory = false,
+})
+
-- devolo
device('devolo-wifi-pro-1200e', 'devolo_dvl1200e', {
@@ -55,6 +61,25 @@ device('devolo-wifi-pro-1750x', 'devolo_dvl1750x', {
})
+-- D-Link
+
+device('d-link-dap-1330-a1', 'dlink_dap-1330-a1')
+device('d-link-dap-1365-a1', 'dlink_dap-1365-a1')
+
+device('d-link-dap-2660-a1', 'dlink_dap-2660-a1', {
+ factory_ext = '.img',
+ packages = ATH10K_PACKAGES_QCA9880,
+})
+
+device('d-link-dir-505', 'dlink_dir-505', {
+ factory = false,
+ manifest_aliases = {
+ 'd-link-dir-505-rev-a1', -- Upgrade from OpenWrt 19.07
+ 'd-link-dir-505-rev-a2', -- Upgrade from OpenWrt 19.07
+ },
+})
+
+
-- Enterasys
device('enterasys-ws-ap3705', 'enterasys_ws-ap3705i', {
@@ -88,6 +113,130 @@ device('ocedo-raccoon', 'ocedo_raccoon', {
-- setup via integrated (USB-)tty is possible as well
device('onion-omega', 'onion_omega')
+
+-- OpenMesh
+
+device('openmesh-a40', 'openmesh_a40', {
+ packages = ATH10K_PACKAGES_QCA9880,
+ factory = false,
+})
+
+device('openmesh-a60', 'openmesh_a60', {
+ packages = ATH10K_PACKAGES_QCA9880,
+ factory = false,
+})
+
+device('openmesh-mr600-v1', 'openmesh_mr600-v1', {
+ factory = false,
+ -- old name from OpenWrt 19.07.x
+ manifest_aliases = {'openmesh-mr600'},
+})
+
+device('openmesh-mr600-v2', 'openmesh_mr600-v2', {
+ factory = false,
+ -- old name from OpenWrt 19.07.x
+ manifest_aliases = {'openmesh-mr600v2'},
+})
+
+device('openmesh-mr900-v1', 'openmesh_mr900-v1', {
+ factory = false,
+ -- old name from OpenWrt 19.07.x
+ manifest_aliases = {'openmesh-mr900'},
+})
+
+device('openmesh-mr900-v2', 'openmesh_mr900-v2', {
+ factory = false,
+ -- old name from OpenWrt 19.07.x
+ manifest_aliases = {'openmesh-mr900v2'},
+})
+
+device('openmesh-mr1750-v1', 'openmesh_mr1750-v1', {
+ packages = ATH10K_PACKAGES_QCA9880,
+ factory = false,
+ -- old name from OpenWrt 19.07.x
+ manifest_aliases = {'openmesh-mr1750'},
+})
+
+device('openmesh-mr1750-v2', 'openmesh_mr1750-v2', {
+ packages = ATH10K_PACKAGES_QCA9880,
+ factory = false,
+ -- old name from OpenWrt 19.07.x
+ manifest_aliases = {'openmesh-mr1750v2'},
+})
+
+device('openmesh-om2p-v1', 'openmesh_om2p-v1', {
+ factory = false,
+ -- old name from OpenWrt 19.07.x
+ manifest_aliases = {'openmesh-om2p'},
+})
+
+device('openmesh-om2p-v2', 'openmesh_om2p-v2', {
+ factory = false,
+ -- old name from OpenWrt 19.07.x; deacticated at the moment because
+ -- the physical ethernet port for this device changed between 19.07
+ -- and 21.02. And automated update could therefore "break" the
+ -- device until someone physically changed the ethernet cable.
+ -- See https://github.com/freifunk-gluon/gluon/pull/2325#issuecomment-940749284
+ --manifest_aliases = {'openmesh-om2pv2'},
+})
+
+device('openmesh-om2p-v4', 'openmesh_om2p-v4', {
+ factory = false,
+ -- old name from OpenWrt 19.07.x
+ manifest_aliases = {'openmesh-om2pv4'},
+})
+
+device('openmesh-om2p-hs-v1', 'openmesh_om2p-hs-v1', {
+ factory = false,
+ -- old name from OpenWrt 19.07.x
+ manifest_aliases = {'openmesh-om2p-hs'},
+})
+
+device('openmesh-om2p-hs-v2', 'openmesh_om2p-hs-v2', {
+ factory = false,
+ -- old name from OpenWrt 19.07.x
+ manifest_aliases = {'openmesh-om2p-hsv2'},
+})
+
+device('openmesh-om2p-hs-v3', 'openmesh_om2p-hs-v3', {
+ factory = false,
+ -- old name from OpenWrt 19.07.x
+ manifest_aliases = {'openmesh-om2p-hsv3'},
+})
+
+device('openmesh-om2p-hs-v4', 'openmesh_om2p-hs-v4', {
+ factory = false,
+ -- old name from OpenWrt 19.07.x
+ manifest_aliases = {'openmesh-om2p-hsv4'},
+})
+
+device('openmesh-om2p-lc', 'openmesh_om2p-lc', {
+ factory = false,
+})
+
+device('openmesh-om5p', 'openmesh_om5p', {
+ factory = false,
+})
+
+device('openmesh-om5p-ac-v1', 'openmesh_om5p-ac-v1', {
+ packages = ATH10K_PACKAGES_QCA9880,
+ factory = false,
+ -- old name from OpenWrt 19.07.x
+ manifest_aliases = {'openmesh-om5p-ac'},
+})
+
+device('openmesh-om5p-ac-v2', 'openmesh_om5p-ac-v2', {
+ packages = ATH10K_PACKAGES_QCA9880,
+ factory = false,
+ -- old name from OpenWrt 19.07.x
+ manifest_aliases = {'openmesh-om5p-acv2'},
+})
+
+device('openmesh-om5p-an', 'openmesh_om5p-an', {
+ factory = false,
+})
+
+
-- Plasma Cloud
device('plasma-cloud-pa300', 'plasmacloud_pa300')
@@ -117,13 +266,34 @@ device('tp-link-archer-c6-v2', 'tplink_archer-c6-v2', {
packages = ATH10K_PACKAGES_QCA9888,
})
+device('tp-link-archer-c7-v2', 'tplink_archer-c7-v2', {
+ packages = ATH10K_PACKAGES_QCA9880,
+})
+
device('tp-link-archer-d50-v1', 'tplink_archer-d50-v1', {
packages = ATH10K_PACKAGES_QCA9880,
factory = false,
broken = true, -- 64M ath9k + ath10k & power LED not working
})
+device('tp-link-cpe210-v1', 'tplink_cpe210-v1', {
+ manifest_aliases = {
+ 'tp-link-cpe210-v1.0', -- Upgrade from OpenWrt 19.07
+ 'tp-link-cpe210-v1.1', -- Upgrade from OpenWrt 19.07
+ },
+})
+device('tp-link-cpe210-v2', 'tplink_cpe210-v2', {
+ manifest_aliases = {
+ 'tp-link-cpe210-v2.0', -- Upgrade from OpenWrt 19.07
+ },
+})
device('tp-link-cpe220-v3', 'tplink_cpe220-v3')
+device('tp-link-cpe510-v1', 'tplink_cpe510-v1', {
+ manifest_aliases = {
+ 'tp-link-cpe510-v1.0', -- upgrade from OpenWrt 19.07
+ 'tp-link-cpe510-v1.1', -- upgrade from OpenWrt 19.07
+ },
+})
device('tp-link-cpe510-v2', 'tplink_cpe510-v2')
device('tp-link-cpe510-v3', 'tplink_cpe510-v3')
@@ -134,4 +304,33 @@ device('tp-link-eap225-outdoor-v1', 'tplink_eap225-outdoor-v1', {
device('tp-link-tl-wdr3600-v1', 'tplink_tl-wdr3600-v1')
device('tp-link-tl-wdr4300-v1', 'tplink_tl-wdr4300-v1')
+device('tp-link-tl-wr1043nd-v3', 'tplink_tl-wr1043nd-v3', {
+ manifest_aliases = {
+ 'tp-link-tl-wr1043n-nd-v3', -- upgrade from OpenWrt 19.07
+ },
+})
+device('tp-link-tl-wr1043nd-v4', 'tplink_tl-wr1043nd-v4', {
+ manifest_aliases = {
+ 'tp-link-tl-wr1043n-nd-v4', -- upgrade from OpenWrt 19.07
+ },
+})
+
device('tp-link-wbs210-v2', 'tplink_wbs210-v2')
+
+-- Ubiquiti
+
+device('ubiquiti-unifi-ac-mesh', 'ubnt_unifiac-mesh', {
+ factory = false,
+ packages = ATH10K_PACKAGES_QCA9880,
+})
+
+device('ubiquiti-unifi-ap', 'ubnt_unifi', {
+ aliases = {
+ 'ubiquiti-unifi-ap-lr',
+ },
+ manifest_aliases = {
+ 'ubiquiti-unifi',
+ },
+})
+
+device('ubiquiti-unifi-ap-pro', 'ubnt_unifi-ap-pro')