Merge branch 'freifunk-gluon:master' into add-fritzbox-7430

This commit is contained in:
Felix 2022-03-29 20:26:40 +02:00 committed by GitHub
commit 10b5b3ae19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
93 changed files with 3102 additions and 389 deletions

22
.github/filters.yml vendored
View File

@ -4,6 +4,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk" "targets/targets.mk"
], ],
@ -12,6 +13,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk" "targets/targets.mk"
], ],
@ -20,6 +22,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk", "targets/targets.mk",
"targets/bcm27xx.inc" "targets/bcm27xx.inc"
@ -29,6 +32,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk", "targets/targets.mk",
"targets/bcm27xx.inc" "targets/bcm27xx.inc"
@ -38,6 +42,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk" "targets/targets.mk"
], ],
@ -46,6 +51,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk" "targets/targets.mk"
], ],
@ -54,6 +60,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk" "targets/targets.mk"
], ],
@ -62,6 +69,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk" "targets/targets.mk"
], ],
@ -70,6 +78,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk" "targets/targets.mk"
], ],
@ -78,6 +87,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk" "targets/targets.mk"
], ],
@ -86,6 +96,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk" "targets/targets.mk"
], ],
@ -94,6 +105,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk" "targets/targets.mk"
], ],
@ -102,6 +114,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk" "targets/targets.mk"
], ],
@ -110,6 +123,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk" "targets/targets.mk"
], ],
@ -118,6 +132,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk" "targets/targets.mk"
], ],
@ -126,6 +141,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk" "targets/targets.mk"
], ],
@ -134,6 +150,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk", "targets/targets.mk",
"targets/x86.inc" "targets/x86.inc"
@ -143,6 +160,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk" "targets/targets.mk"
], ],
@ -151,6 +169,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk", "targets/targets.mk",
"targets/x86.inc" "targets/x86.inc"
@ -160,6 +179,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk", "targets/targets.mk",
"targets/x86.inc", "targets/x86.inc",
@ -171,6 +191,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk", "targets/targets.mk",
"targets/bcm27xx.inc" "targets/bcm27xx.inc"
@ -180,6 +201,7 @@
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk" "targets/targets.mk"
] ]

View File

@ -13,6 +13,7 @@ common = [
"modules", "modules",
"Makefile", "Makefile",
"patches/**", "patches/**",
"scripts/**",
"targets/generic", "targets/generic",
"targets/targets.mk", "targets/targets.mk",
] ]

View File

@ -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 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. 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 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. 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. If a device has only a single Ethernet port (or group of ports), it will be
In case such a device has multiple LAN ports, all these can be used as WAN. used as an uplink port even when it is not labelled as "WAN" by default. This
Devices, which feature a "hybrid" port (labelled as WAN/LAN), this port is used as WAN. behavior can be controlled using the ``interfaces.single.default_roles``
site.conf option. It is also possible to alter the interface assignment after
This behavior can be reversed using the ``single_as_lan`` site.conf option. installation by modifying ``/etc/config/gluon`` and running
``gluon-reconfigure``.
Routing tables Routing tables
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~

View File

@ -74,8 +74,7 @@ Useful functions:
- *header* (*key*, *value*): Adds an HTTP header to the reply to be sent to - *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. 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 - *prepare_content* (*mime*): Sets the *Content-Type* header to the given MIME
type, potentially setting additional headers or modifying the MIME type to type
accommodate browser quirks
- *write* (*data*, ...): Sends the given data to the client. If headers have not - *write* (*data*, ...): Sends the given data to the client. If headers have not
been sent, it will be done before the data is written. been sent, it will be done before the data is written.

View File

@ -130,9 +130,7 @@ site.conf only variables
- authorized_keys - authorized_keys
- default_domain - default_domain
- poe_passthrough - poe_passthrough
- mesh_on_wan - interfaces.*.default_roles
- mesh_on_lan
- single_as_lan
- setup_mode.skip - setup_mode.skip
- autoupdater.branch - autoupdater.branch
- mesh_vpn.enabled - mesh_vpn.enabled

View File

@ -1,8 +1,8 @@
Private WLAN Private WLAN
============ ============
It is possible to set up a private WLAN that bridges the WAN port and is separated from the mesh network. 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 ``mesh_on_wan`` simultaneously. 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, 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`` WPA3 or WPA2/WPA3 mixed-mode can be used instead of WPA2. For this to work, the ``wireless-encryption-wpa3``

View File

@ -1,57 +1,121 @@
Mesh-VPN Mesh VPN
======== ========
Gluon integrates several OSI-Layer 2 tunneling protocols to Gluon integrates several layer 2 tunneling protocols to
enable interconnects between local meshes and provide allow connections between local meshes through the internet.
internetwork access. Available protocols currently are:
- fastd Protocol handlers
- L2TPv3 (via tunneldigger) ^^^^^^^^^^^^^^^^^
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 implements cipher suites that are specifically designed
to work well on embedded devices. It offers encryption to work well on embedded devices. It offers encryption
and authentication. Its primary drawback are the necessary and authentication.
context-switches when forwarding packets. 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, mesh-vpn-tunneldigger
but offers no security properties by itself. ~~~~~~~~~~~~~~~~~~~~~
The brokering of the tunnel happens through tunneldigger,
its primary drawback being the lack of IPv6 support. 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 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 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`` Site configuration
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)
**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
<https://fastd.readthedocs.io/en/stable/manual/config.html#option-offload>`_.
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. The resulting firmware will allow users to choose between secure (encrypted) and fast (unencrypted) transport.
.. image:: fastd_mode.gif .. image:: fastd_mode.gif
**Unix socket:** To confirm whether the correct cipher is being used, the log output
To confirm whether the correct cipher is being used, fastd's unix of fastd can be checked using ``logread``.
socket can be interrogated, after installing for example `socat`.
::
opkg update
opkg install socat
socat - UNIX-CONNECT:/var/run/fastd.mesh_vpn.socket

View File

@ -50,8 +50,8 @@ Configuration
Both Mesh-on-WAN and Mesh-on-LAN can be configured on the "Network" page 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). 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 It is also possible to enable Mesh-on-WAN and Mesh-on-LAN by default by adding
adding ``mesh_on_wan = true`` and ``mesh_on_lan = true`` to ``site.conf``. the ``mesh`` role to the ``interfaces.*.default_roles`` options in site.conf.
Commandline Commandline
=========== ===========

View File

@ -39,7 +39,7 @@ Several Freifunk communities in Germany use Gluon as the foundation of their Fre
dev/hardware dev/hardware
dev/packages dev/packages
dev/upgrade dev/upgrade
dev/wan dev/uplink
dev/mac_addresses dev/mac_addresses
dev/site_library dev/site_library
dev/build dev/build
@ -78,61 +78,7 @@ Several Freifunk communities in Germany use Gluon as the foundation of their Fre
:caption: Releases :caption: Releases
:maxdepth: 1 :maxdepth: 1
releases/v2021.1.1 releases/index
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
License License
------- -------

118
docs/releases/index.rst Normal file
View File

@ -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

View File

@ -45,7 +45,7 @@ msgstr ""
"selbstverständlich vertraulich behandelt und nicht weitergegeben." "selbstverständlich vertraulich behandelt und nicht weitergegeben."
"</p>" "</p>"
"<div class=\"the-key\">" "<div class=\"the-key\">"
"# <%= pcdata(hostname) %><br />" "# <%= pcdata(hostname) %><br>"
"<%= pubkey %>" "<%= pubkey %>"
"</div>" "</div>"
"<p>Dein Knoten startet gerade neu und wird anschließend versuchen, sich mit " "<p>Dein Knoten startet gerade neu und wird anschließend versuchen, sich mit "

View File

@ -41,7 +41,7 @@ msgstr ""
"\">keys@alpha-centauri.freifunk.net</a>. Of course, your e-mail address will " "\">keys@alpha-centauri.freifunk.net</a>. Of course, your e-mail address will "
"be treated confidentially and will not be passed on.</p>" "be treated confidentially and will not be passed on.</p>"
"<div class=\"the-key\">" "<div class=\"the-key\">"
" # <%= pcdata(hostname) %><br />" " # <%= pcdata(hostname) %><br>"
"<%= pubkey %>" "<%= pubkey %>"
"</div>" "</div>"
"<p>Your node <em><%= pcdata(hostname) %></em> is currently rebooting and will " "<p>Your node <em><%= pcdata(hostname) %></em> is currently rebooting and will "

View File

@ -36,7 +36,7 @@ msgstr ""
"body=<%= urlencode('# ' .. hostname .. '\n' .. pubkey) %>\">keys@alpha-centauri.freifunk.net</a>." "body=<%= urlencode('# ' .. hostname .. '\n' .. pubkey) %>\">keys@alpha-centauri.freifunk.net</a>."
"</p>" "</p>"
"<div class=\"the-key\">" "<div class=\"the-key\">"
" # <%= pcdata(hostname) %><br />" " # <%= pcdata(hostname) %><br>"
"<%= pubkey %>" "<%= pubkey %>"
"</div>" "</div>"

View File

@ -399,17 +399,49 @@ mesh_vpn
}, },
} }
mesh_on_wan \: optional interfaces \: optional
Enables the mesh on the WAN port (``true`` or ``false``). 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 For devices that have two distinct Ethernet ports or port groups (often
Enables the mesh on the LAN port (``true`` or ``false``). 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 poe_passthrough \: optional
Enable PoE passthrough by default on hardware with such a feature. 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 *openlayers_url* allows to override the base URL of the
*build/ol.js* and *css/ol.css* files (the default is *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) 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 with a custom one using the *tile_layer* section. Only XYZ layers are supported
at this point. at this point.

View File

@ -4,6 +4,10 @@ Supported Devices & Architectures
ath79-generic ath79-generic
-------------- --------------
* AVM
- Fritz!WLAN Repeater 450E [#avmflash]_
* devolo * devolo
- WiFi pro 1200e [#lan_as_wan]_ - WiFi pro 1200e [#lan_as_wan]_
@ -13,6 +17,14 @@ ath79-generic
- WiFi pro 1750i - WiFi pro 1750i
- WiFi pro 1750x - 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 * Enterasys
- WS-AP3705i - WS-AP3705i
@ -33,6 +45,20 @@ ath79-generic
- Omega [#modular_ethernet]_ - 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 * Plasma Cloud
- PA300 - PA300
@ -46,14 +72,25 @@ ath79-generic
- Archer A7 (v5) - Archer A7 (v5)
- Archer C6 (v2) - Archer C6 (v2)
- Archer C7 (v2)
- CPE210 (v1.0, v1.1, v2.0)
- CPE220 (v3.0) - CPE220 (v3.0)
- CPE510 (v1.0, v1.1)
- CPE510 (v2.0) - CPE510 (v2.0)
- CPE510 (v3.0) - CPE510 (v3.0)
- EAP225-Outdoor (v1) - EAP225-Outdoor (v1)
- TL-WDR3600 (v1) - TL-WDR3600 (v1)
- TL-WDR4300 (v1) - TL-WDR4300 (v1)
- TL-WR1043N/ND (v3, v4)
- WBS210 (v2.0) - WBS210 (v2.0)
* Ubiquiti
- UniFi AC Mesh
- UniFi AP
- UniFi AP LR
- UniFi AP PRO
ath79-nand ath79-nand
---------- ----------
@ -330,7 +367,7 @@ Footnotes
developer documentation: :ref:`device-class-definition`. developer documentation: :ref:`device-class-definition`.
.. [#avmflash] .. [#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] .. [#eva_ramboot]
For instructions on how to flash AVM NAND devices, see the respective For instructions on how to flash AVM NAND devices, see the respective

View File

@ -2,15 +2,15 @@ GLUON_FEEDS='packages routing gluon'
OPENWRT_REPO=https://github.com/openwrt/openwrt.git OPENWRT_REPO=https://github.com/openwrt/openwrt.git
OPENWRT_BRANCH=openwrt-21.02 OPENWRT_BRANCH=openwrt-21.02
OPENWRT_COMMIT=97b95ef8b9186518cda6f2d3cec8a01860fae2e7 OPENWRT_COMMIT=cd17ca7d6f305ff93ee5436b883bc5ad3767e3a7
PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git
PACKAGES_PACKAGES_BRANCH=openwrt-21.02 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_REPO=https://github.com/openwrt/routing.git
PACKAGES_ROUTING_BRANCH=openwrt-21.02 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_REPO=https://github.com/freifunk-gluon/packages.git
PACKAGES_GLUON_COMMIT=308166e3c6b2d571606dd1dbfadd2bb8e31d8f90 PACKAGES_GLUON_COMMIT=308166e3c6b2d571606dd1dbfadd2bb8e31d8f90

View File

@ -16,7 +16,12 @@ when(_'web-wizard' and _'autoupdater', {
'gluon-config-mode-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', 'gluon-config-mode-mesh-vpn',
}) })

View File

@ -6,26 +6,9 @@ local util = require 'gluon.util'
local uci = require('simple-uci').cursor() local uci = require('simple-uci').cursor()
local interfaces = uci:get('network', 'client', 'ifname') or {} local interfaces = util.get_role_interfaces(uci, 'client', true)
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
util.add_to_set(interfaces, 'local-port') util.add_to_set(interfaces, 'local-port')
uci:delete('network', 'client')
uci:section('network', 'interface', 'client', { uci:section('network', 'interface', 'client', {
type = 'bridge', type = 'bridge',
ifname = interfaces, ifname = interfaces,

View File

@ -10,7 +10,6 @@ local uci = require('simple-uci').cursor()
local next_node = site.next_node({}) local next_node = site.next_node({})
uci:delete('network', 'local_node_dev')
uci:section('network', 'device', 'local_node_dev', { uci:section('network', 'device', 'local_node_dev', {
type = 'veth', type = 'veth',
name = 'local-node', name = 'local-node',
@ -31,7 +30,6 @@ if next_node.ip6 then
ip6 = next_node.ip6 .. '/128' ip6 = next_node.ip6 .. '/128'
end end
uci:delete('network', 'local_node')
uci:section('network', 'interface', 'local_node', { uci:section('network', 'interface', 'local_node', {
ifname = 'local-node', ifname = 'local-node',
proto = 'static', proto = 'static',

View File

@ -1,10 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html lang="">
<head> <head>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0" /> <meta http-equiv="Expires" content="0">
<meta http-equiv="refresh" content="0; URL=/cgi-bin/config" /> <meta http-equiv="refresh" content="0; URL=/cgi-bin/config">
</head> </head>
<body> <body>
</body> </body>

View File

@ -22,7 +22,7 @@ function f:write()
uci:set("gluon-setup-mode", uci:get_first("gluon-setup-mode", "setup_mode"), "configured", true) uci:set("gluon-setup-mode", uci:get_first("gluon-setup-mode", "setup_mode"), "configured", true)
uci:save("gluon-setup-mode") uci:save("gluon-setup-mode")
os.execute('gluon-reconfigure') os.execute('exec gluon-reconfigure >/dev/null')
f.template = "wizard/reboot" f.template = "wizard/reboot"
f.package = "gluon-config-mode-core" f.package = "gluon-config-mode-core"

View File

@ -82,7 +82,7 @@ You may obtain a copy of the License at
end end
%> %>
</ul> </ul>
<br style="clear:both" /> <br style="clear:both">
<% <%
subtree(append(prefix, name), node.nodes[name], ...) 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], ...) subtree({path}, root.nodes[category], ...)
end end
http:prepare_content("application/xhtml+xml") http:prepare_content("text/html")
-%> -%>
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> <html lang="">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8">
<link rel="stylesheet" type="text/css" media="screen" href="/static/gluon.css" /> <link rel="stylesheet" type="text/css" media="screen" href="/static/gluon.css">
<title><%| hostname .. ((rnode and rnode.title) and ' - ' .. title(rnode) or '') %></title> <title><%| hostname .. ((rnode and rnode.title) and ' - ' .. title(rnode) or '') %></title>
</head> </head>
<body> <body>
@ -134,7 +134,7 @@ You may obtain a copy of the License at
<div id="maincontent"> <div id="maincontent">
<noscript> <noscript>
<div class="errorbox"> <div class="errorbox">
<strong><%:JavaScript required!%></strong><br /> <strong><%:JavaScript required!%></strong><br>
<%:You must enable JavaScript in your browser or the web interface will not work properly.%> <%:You must enable JavaScript in your browser or the web interface will not work properly.%>
</div> </div>
</noscript> </noscript>

View File

@ -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_domain({'mesh', 'vxlan'}), false)
need_boolean(in_site({'mesh_on_wan'}), false) local interfaces_roles = {'client', 'uplink', 'mesh'}
need_boolean(in_site({'mesh_on_lan'}), false) for _, config in ipairs({'wan', 'lan', 'single'}) do
need_boolean(in_site({'single_as_lan'}), false) 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.')

View File

@ -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

View File

@ -4,3 +4,6 @@ uci -q batch <<-EOF
delete gluon.core.reconfigure delete gluon.core.reconfigure
commit commit
EOF EOF
# New config is saved, we can delete the old one
rm -f /etc/config/*_gluon-old

View File

@ -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')

View File

@ -1,15 +1,7 @@
#!/usr/bin/lua #!/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 platform = require 'gluon.platform'
local site = require 'gluon.site' local sysconfig = require 'gluon.sysconfig'
local json = require 'jsonc' local json = require 'jsonc'
local uci = require('simple-uci').cursor() local uci = require('simple-uci').cursor()
@ -51,7 +43,11 @@ local lan_ifname = iface_exists(lan_interfaces)
local wan_ifname = iface_exists(wan_interfaces) local wan_ifname = iface_exists(wan_interfaces)
if platform.match('ath79', 'generic', { if platform.match('ath79', 'generic', {
'tplink,cpe210-v1',
'tplink,cpe210-v2',
'tplink,cpe510-v1',
'tplink,wbs210-v2', 'tplink,wbs210-v2',
'ubnt,unifi-ap-pro',
}) then }) then
lan_ifname, wan_ifname = wan_ifname, lan_ifname lan_ifname, wan_ifname = wan_ifname, lan_ifname
elseif platform.match('lantiq') then elseif platform.match('lantiq') then
@ -69,19 +65,15 @@ end
if wan_ifname and lan_ifname then if wan_ifname and lan_ifname then
sysconfig.wan_ifname = wan_ifname sysconfig.wan_ifname = wan_ifname
sysconfig.lan_ifname = lan_ifname sysconfig.lan_ifname = lan_ifname
sysconfig.single_ifname = nil
else else
local single_ifname = lan_ifname or wan_ifname sysconfig.wan_ifname = nil
if site.single_as_lan(false) then sysconfig.lan_ifname = nil
sysconfig.lan_ifname = single_ifname sysconfig.single_ifname = lan_ifname or wan_ifname
else
sysconfig.wan_ifname = single_ifname
end
end end
uci:delete('network', 'lan')
uci:delete('network', 'wan')
uci:delete_all('network', 'device') uci:delete_all('network', 'device')
uci:delete_all('network', 'interface')
uci:save('network') uci:save('network')

View File

@ -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')

View File

@ -1,11 +1,24 @@
#!/usr/bin/lua #!/usr/bin/lua
local uci = require('simple-uci').cursor() 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', { 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', type = 'bridge',
igmp_snooping = true, igmp_snooping = true,
multicast_querier = false, multicast_querier = false,
@ -13,12 +26,10 @@ uci:section('network', 'interface', 'wan', {
auto = true, auto = true,
}) })
if not uci:get('network', 'wan', 'proto') then
uci:set('network', 'wan', 'proto', 'dhcp')
end
uci:section('network', 'interface', 'wan6', { uci:section('network', 'interface', 'wan6', {
proto = wan6.proto or 'dhcpv6',
ip6addr = wan6.ip6addr,
ip6gw = wan6.ip6gw,
ifname = 'br-wan', ifname = 'br-wan',
peerdns = false, peerdns = false,
ip6table = 1, ip6table = 1,
@ -26,11 +37,6 @@ uci:section('network', 'interface', 'wan6', {
reqprefix = 'no', reqprefix = 'no',
}) })
if not uci:get('network', 'wan6', 'proto') then
uci:set('network', 'wan6', 'proto', 'dhcpv6')
end
uci:section('network', 'rule6', 'wan6_lookup', { uci:section('network', 'rule6', 'wan6_lookup', {
mark = '0x01/0x01', mark = '0x01/0x01',
lookup = 1, lookup = 1,

View File

@ -106,8 +106,6 @@ end
local function delete_ibss(radio_name) local function delete_ibss(radio_name)
local name = 'ibss_' .. radio_name local name = 'ibss_' .. radio_name
uci:delete('network', name)
uci:delete('network', name .. '_vlan')
uci:delete('wireless', name) uci:delete('wireless', name)
end end
@ -118,8 +116,6 @@ local function configure_mesh(config, radio, index, suffix, disabled)
local macfilter = uci:get('wireless', name, 'macfilter') local macfilter = uci:get('wireless', name, 'macfilter')
local maclist = uci:get('wireless', name, 'maclist') local maclist = uci:get('wireless', name, 'maclist')
uci:delete('network', name)
uci:delete('network', name .. '_vlan')
uci:delete('wireless', name) uci:delete('wireless', name)
if not config then if not config then

View File

@ -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')

View File

@ -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')

View File

@ -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')

View File

@ -86,9 +86,9 @@ local wired_mesh_ifaces = {}
uci:foreach('network', 'interface', uci:foreach('network', 'interface',
function(iface) function(iface)
-- Select all interfaces with proto gluon_wired except for -- 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 -- 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']) table.insert(wired_mesh_ifaces, iface['.name'])
end end
end end

View File

@ -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

View File

@ -27,11 +27,15 @@ function M.is_outdoor_device()
'devolo,dvl1750x', 'devolo,dvl1750x',
'plasmacloud,pa300', 'plasmacloud,pa300',
'plasmacloud,pa300e', 'plasmacloud,pa300e',
'tplink,cpe210-v1',
'tplink,cpe210-v2',
'tplink,cpe220-v3', 'tplink,cpe220-v3',
'tplink,cpe510-v1',
'tplink,cpe510-v2', 'tplink,cpe510-v2',
'tplink,cpe510-v3', 'tplink,cpe510-v3',
'tplink,eap225-outdoor-v1', 'tplink,eap225-outdoor-v1',
'tplink,wbs210-v2', 'tplink,wbs210-v2',
'ubnt,unifiac-mesh',
}) then }) then
return true return true

View File

@ -11,6 +11,10 @@ local function get(_, name)
end end
local function set(_, name, val) local function set(_, name, val)
if val == get(nil, name) then
return
end
if val then if val then
local f = io.open(sysconfigdir .. name, 'w+') local f = io.open(sysconfigdir .. name, 'w+')
f:write(val, '\n') f:write(val, '\n')

View File

@ -138,6 +138,34 @@ function M.get_mesh_devices(uconn)
return devices return devices
end 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 -- Safe glob: returns an empty table when the glob fails because of
-- a non-existing path -- a non-existing path
function M.glob(pattern) function M.glob(pattern)

View File

@ -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', '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_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)

View File

@ -2,7 +2,6 @@
local uci = require('simple-uci').cursor() local uci = require('simple-uci').cursor()
uci:delete('network', 'mmfd')
uci:section('network', 'interface', 'mmfd', { uci:section('network', 'interface', 'mmfd', {
proto = 'static', proto = 'static',
ifname = 'mmfd0', ifname = 'mmfd0',

View File

@ -9,14 +9,12 @@ local uci = require('simple-uci').cursor()
uci:delete('batman-adv', 'bat0') uci:delete('batman-adv', 'bat0')
uci:save('batman-adv') uci:save('batman-adv')
local gw_mode = uci:get('network', 'gluon_bat0', 'gw_mode') or 'client' local gw_mode = uci:get('network_gluon-old', 'gluon_bat0', 'gw_mode') or 'client'
uci:delete('network', 'gluon_bat0')
uci:section('network', 'interface', 'gluon_bat0', { uci:section('network', 'interface', 'gluon_bat0', {
proto = 'gluon_bat0', proto = 'gluon_bat0',
gw_mode = gw_mode, gw_mode = gw_mode,
}) })
uci:delete('network', 'bat0')
uci:section('network', 'interface', 'bat0', { uci:section('network', 'interface', 'bat0', {
ifname = 'bat0', ifname = 'bat0',
proto = 'none', proto = 'none',

View File

@ -21,7 +21,6 @@ uci:section('network', 'interface', 'client', {
query_response_interval = 500, query_response_interval = 500,
}) })
uci:delete('network', 'local_node_route6')
uci:section('network', 'route6', 'local_node_route6', { uci:section('network', 'route6', 'local_node_route6', {
interface = 'client', interface = 'client',
target = site.prefix6(), target = site.prefix6(),

View File

@ -8,8 +8,8 @@ local uci = require('simple-uci').cursor()
-- fix up potentially duplicate MAC addresses (for meshing) -- fix up potentially duplicate MAC addresses (for meshing)
if not site.mesh.vxlan(true) then if not site.mesh.vxlan(true) then
uci:set('network', 'wan', 'macaddr', util.generate_mac(0)) uci:set('network', 'wan', 'macaddr', util.generate_mac(0))
else
uci:delete('network', 'wan', 'macaddr')
end 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') uci:save('network')

View File

@ -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))

View File

@ -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_array_of({'mesh_vpn', 'fastd', 'methods'}, fastd_methods)
need_boolean(in_site({'mesh_vpn', 'fastd', 'configurable'}), false) need_boolean(in_site({'mesh_vpn', 'fastd', 'configurable'}), false)

View File

@ -5,6 +5,7 @@ local util = require 'gluon.util'
local vpn_core = require 'gluon.mesh-vpn' local vpn_core = require 'gluon.mesh-vpn'
local uci = require('simple-uci').cursor() local uci = require('simple-uci').cursor()
local unistd = require 'posix.unistd'
local syslog_level = uci:get('fastd', 'mesh_vpn', 'syslog_level') or 'verbose' local syslog_level = uci:get('fastd', 'mesh_vpn', 'syslog_level') or 'verbose'
@ -17,20 +18,22 @@ end
local methods local methods
if site.mesh_vpn.fastd.configurable(false) then 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') local old_methods = uci:get('fastd', 'mesh_vpn', 'method')
if old_methods then 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 end
methods = {} methods = {}
if has_null then if has_null then
table.insert(methods, 'null@l2tp')
table.insert(methods, 'null') table.insert(methods, 'null')
end end
for _, method in ipairs(site.mesh_vpn.fastd.methods()) do for _, method in ipairs(site_methods) do
if method ~= 'null' then if method ~= 'null@l2tp' and method ~= 'null' then
table.insert(methods, method) table.insert(methods, method)
end end
end end
@ -50,9 +53,19 @@ uci:section('fastd', 'fastd', 'mesh_vpn', {
secure_handshakes = true, secure_handshakes = true,
method = methods, method = methods,
packet_mark = 1, packet_mark = 1,
persist_interface = true,
offload_l2tp = false,
status_socket = '/var/run/fastd.mesh_vpn.socket', 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 -- Collect list of groups that have peers with 'preserve' flag
local preserve_groups = {} local preserve_groups = {}
@ -94,6 +107,7 @@ local function add_peer(group, name, config)
enabled = true, enabled = true,
net = 'mesh_vpn', net = 'mesh_vpn',
group = group, group = group,
interface = 'mesh-vpn',
key = config.key, key = config.key,
remote = config.remotes, remote = config.remotes,
}) })
@ -123,5 +137,11 @@ end
add_groups('mesh_vpn', site.mesh_vpn.fastd.groups()) 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') uci:save('fastd')

View File

@ -3,7 +3,7 @@
local uci = require('simple-uci').cursor() local uci = require('simple-uci').cursor()
local site = require 'gluon.site' 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 if not private_key or not private_key:match("^" .. ("[%a%d+/]"):rep(42) .. "[AEIMQUYcgkosw480]=$") then
private_key = "generate" private_key = "generate"

View File

@ -3,13 +3,12 @@
local platform = require 'gluon.platform' local platform = require 'gluon.platform'
local sysconfig = require 'gluon.sysconfig' local sysconfig = require 'gluon.sysconfig'
if platform.is_outdoor_device() or
if sysconfig.setup_ifname then platform.match('ath79', 'generic', {
os.exit(0) 'ubnt,unifi-ap-pro',
end })
then
if platform.is_outdoor_device() then sysconfig.setup_ifname = sysconfig.single_ifname or sysconfig.wan_ifname
sysconfig.setup_ifname = sysconfig.wan_ifname or sysconfig.lan_ifname
else else
sysconfig.setup_ifname = sysconfig.lan_ifname or sysconfig.wan_ifname sysconfig.setup_ifname = sysconfig.single_ifname or sysconfig.lan_ifname
end end

View File

@ -1,15 +1,15 @@
<%- <%-
http:prepare_content("application/xhtml+xml") http:prepare_content("text/html")
-%> -%>
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> <html lang="">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no" /> <meta name="viewport" content="width=device-width, user-scalable=no">
<title><%:Error%></title> <title><%:Error%></title>
<link rel="stylesheet" href="/static/status-page.css" type="text/css" /> <link rel="stylesheet" href="/static/status-page.css" type="text/css">
</head> </head>
<body> <body>
<header> <header>

View File

@ -111,24 +111,24 @@
end end
local function statisticsTraffic(key) local function statisticsTraffic(key)
return string.format('%s<br />%s<br />%s', return string.format('%s<br>%s<br>%s',
statistics(key .. '/packets', 'packetsDiff'), statistics(key .. '/packets', 'packetsDiff'),
statistics(key .. '/bytes', 'bytesDiff'), statistics(key .. '/bytes', 'bytesDiff'),
statistics(key .. '/bytes', 'bytes') statistics(key .. '/bytes', 'bytes')
) )
end end
http:prepare_content("application/xhtml+xml") http:prepare_content("text/html")
-%> -%>
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> <html lang="">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no" /> <meta name="viewport" content="width=device-width, user-scalable=no">
<title><%| nodeinfo.hostname %> - <%:Status%></title> <title><%| nodeinfo.hostname %> - <%:Status%></title>
<link rel="stylesheet" href="/static/status-page.css" type="text/css" /> <link rel="stylesheet" href="/static/status-page.css" type="text/css">
</head> </head>
<body data-node-address="<%| http:getenv('SERVER_ADDR') %>"<%= <body data-node-address="<%| http:getenv('SERVER_ADDR') %>"<%=
attr('data-translations', translations) .. attr('data-translations', translations) ..
@ -154,21 +154,21 @@
<%- end %> <%- end %>
<dt><%:Model%></dt><dd><%| nodeinfo.hardware.model %></dd> <dt><%:Model%></dt><dd><%| nodeinfo.hardware.model %></dd>
<dt><%:Primary MAC address%></dt><dd><%| nodeinfo.network.mac %></dd> <dt><%:Primary MAC address%></dt><dd><%| nodeinfo.network.mac %></dd>
<dt><%:IP address%></dt><dd><%= pcdata(table.concat(sorted(nodeinfo.network.addresses), '\n')):gsub('\n', '<br />') %></dd> <dt><%:IP address%></dt><dd><%= pcdata(table.concat(sorted(nodeinfo.network.addresses), '\n')):gsub('\n', '<br>') %></dd>
<dt><%:Firmware%></dt><dd><%| nodeinfo.software.firmware.release %></dd> <dt><%:Firmware%></dt><dd><%| nodeinfo.software.firmware.release %></dd>
<% if nodeinfo.network.mesh_vpn then -%> <% if nodeinfo.network.mesh_vpn then -%>
<dt><%:Mesh VPN%></dt> <dt><%:Mesh VPN%></dt>
<dd> <dd>
<%| enabled(nodeinfo.network.mesh_vpn.enabled) %> <%| enabled(nodeinfo.network.mesh_vpn.enabled) %>
<% if nodeinfo.network.mesh_vpn.provider then -%> <% if nodeinfo.network.mesh_vpn.provider then -%>
<br /><%| nodeinfo.network.mesh_vpn.provider %> <br><%| nodeinfo.network.mesh_vpn.provider %>
<%- end %> <%- end %>
</dd> </dd>
<% if nodeinfo.network.mesh_vpn.bandwidth_limit.enabled then -%> <% if nodeinfo.network.mesh_vpn.bandwidth_limit.enabled then -%>
<dt><%:Bandwidth limit%></dt> <dt><%:Bandwidth limit%></dt>
<dd> <dd>
<% if nodeinfo.network.mesh_vpn.bandwidth_limit.ingress then -%> <% if nodeinfo.network.mesh_vpn.bandwidth_limit.ingress then -%>
<%| formatBits(nodeinfo.network.mesh_vpn.bandwidth_limit.ingress*1000) %>/s <%:downstream%><br /> <%| formatBits(nodeinfo.network.mesh_vpn.bandwidth_limit.ingress*1000) %>/s <%:downstream%><br>
<%- end %> <%- end %>
<% if nodeinfo.network.mesh_vpn.bandwidth_limit.egress then -%> <% if nodeinfo.network.mesh_vpn.bandwidth_limit.egress then -%>
<%| formatBits(nodeinfo.network.mesh_vpn.bandwidth_limit.egress*1000) %>/s <%:upstream%> <%| formatBits(nodeinfo.network.mesh_vpn.bandwidth_limit.egress*1000) %>/s <%:upstream%>
@ -213,7 +213,7 @@
<tr><th><%:Load average%></th><td><%= statistics('loadavg', 'decimal') %></td></tr> <tr><th><%:Load average%></th><td><%= statistics('loadavg', 'decimal') %></td></tr>
<tr><th><%:RAM%></th><td><%= statistics('memory', 'memory') %></td></tr> <tr><th><%:RAM%></th><td><%= statistics('memory', 'memory') %></td></tr>
<tr><th><%:Filesystem%></th><td><%= statistics('rootfs_usage', 'percent') %></td></tr> <tr><th><%:Filesystem%></th><td><%= statistics('rootfs_usage', 'percent') %></td></tr>
<tr><th><%:Gateway%></th><td><%= statistics('gateway') %><br /><%= statistics('gateway_nexthop', 'neighbour') %></td></tr> <tr><th><%:Gateway%></th><td><%= statistics('gateway') %><br><%= statistics('gateway_nexthop', 'neighbour') %></td></tr>
</table> </table>
<h3><%:Clients%></h3> <h3><%:Clients%></h3>

View File

@ -1,10 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html lang="">
<head> <head>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0" /> <meta http-equiv="Expires" content="0">
<meta http-equiv="refresh" content="0; URL=/cgi-bin/status" /> <meta http-equiv="refresh" content="0; URL=/cgi-bin/status">
</head> </head>
<body> <body>
</body> </body>

View File

@ -26,7 +26,7 @@ $Id$
<%:Firmware image%> <%:Firmware image%>
</label> </label>
<div class="gluon-value-field"> <div class="gluon-value-field">
<input type="file" name="image" /> <input type="file" name="image">
</div> </div>
</div> </div>
@ -36,14 +36,14 @@ $Id$
</label> </label>
<div class="gluon-value-field"> <div class="gluon-value-field">
<input id="keepcfg" type="checkbox" name="keepcfg" value="1" checked="checked" /> <input id="keepcfg" type="checkbox" name="keepcfg" value="1" checked="checked">
<label for="keepcfg"></label> <label for="keepcfg"></label>
</div> </div>
</div> </div>
</div> </div>
<div class="gluon-page-actions"> <div class="gluon-page-actions">
<input type="hidden" name="step" value="2" /> <input type="hidden" name="step" value="2">
<input class="gluon-button gluon-button-submit" type="submit" value="<%:Upload image%>" /> <input class="gluon-button gluon-button-submit" type="submit" value="<%:Upload image%>">
</div> </div>
</form> </form>

View File

@ -47,13 +47,13 @@ You may obtain a copy of the License at
</p> </p>
<div class="gluon-page-actions"> <div class="gluon-page-actions">
<form method="post" enctype="multipart/form-data" action="<%|url(request)%>" style="display:inline"> <form method="post" enctype="multipart/form-data" action="<%|url(request)%>" style="display:inline">
<input type="hidden" name="step" value="3" /> <input type="hidden" name="step" value="3">
<input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" /> <input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>">
<input class="gluon-button gluon-button-submit" type="submit" value="<%:Continue%>" /> <input class="gluon-button gluon-button-submit" type="submit" value="<%:Continue%>">
</form> </form>
<form method="post" enctype="multipart/form-data" action="<%|url(request)%>" style="display:inline"> <form method="post" enctype="multipart/form-data" action="<%|url(request)%>" style="display:inline">
<input type="hidden" name="step" value="1" /> <input type="hidden" name="step" value="1">
<input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" /> <input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>">
<input class="gluon-button gluon-button-reset" type="submit" value="<%:Cancel%>" /> <input class="gluon-button gluon-button-reset" type="submit" value="<%:Cancel%>">
</form> </form>
</div> </div>

View File

@ -21,11 +21,11 @@ msgstr "Erweiterte Einstellungen"
msgid "" msgid ""
"Alternatively, you can set a password to access your node. Please choose a " "Alternatively, you can set a password to access your node. Please choose a "
"secure password you don't use anywhere else.<br /><br />If you set an empty " "secure password you don't use anywhere else.<br><br>If you set an empty "
"password, login via password will be disabled. This is the default." "password, login via password will be disabled. This is the default."
msgstr "" msgstr ""
"Alternativ kannst du auch ein Passwort setzen. Wähle bitte ein sicheres " "Alternativ kannst du auch ein Passwort setzen. Wähle bitte ein sicheres "
"Passwort, das du nirgendwo anders verwendest.<br /><br />Beim Setzen eines " "Passwort, das du nirgendwo anders verwendest.<br><br>Beim Setzen eines "
"leeren Passworts wird der Login per Passwort gesperrt (dies ist die Standard-" "leeren Passworts wird der Login per Passwort gesperrt (dies ist die Standard-"
"Einstellung)." "Einstellung)."

View File

@ -21,12 +21,12 @@ msgstr "Paramètres avancés"
msgid "" msgid ""
"Alternatively, you can set a password to access your node. Please choose a " "Alternatively, you can set a password to access your node. Please choose a "
"secure password you don't use anywhere else.<br /><br />If you set an empty " "secure password you don't use anywhere else.<br><br>If you set an empty "
"password, login via password will be disabled. This is the default." "password, login via password will be disabled. This is the default."
msgstr "" msgstr ""
"Alternativement, vous pouvez mettre un mot de passe pour accéder à votre " "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 " "nœud, Penseiz à choisir un mot de passe sûr, que vous n'utilisez nulle part "
"ailleurs. <br /><br /> Si vous n'entrez pas de mot de passe, la connexion " "ailleurs. <br><br> 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 " "par mot de passe sera désactivée. La connexion par mot de passe est "
"désactivée par défaut." "désactivée par défaut."

View File

@ -12,7 +12,7 @@ msgstr ""
msgid "" msgid ""
"Alternatively, you can set a password to access your node. Please choose a " "Alternatively, you can set a password to access your node. Please choose a "
"secure password you don't use anywhere else.<br /><br />If you set an empty " "secure password you don't use anywhere else.<br><br>If you set an empty "
"password, login via password will be disabled. This is the default." "password, login via password will be disabled. This is the default."
msgstr "" msgstr ""

View File

@ -51,7 +51,7 @@ end
local f_password = Form(translate("Password"), translate( local f_password = Form(translate("Password"), translate(
"Alternatively, you can set a password to access your node. Please choose a " "Alternatively, you can set a password to access your node. Please choose a "
.. "secure password you don't use anywhere else.<br /><br />If you set an empty " .. "secure password you don't use anywhere else.<br><br>If you set an empty "
.. "password, login via password will be disabled. This is the default." .. "password, login via password will be disabled. This is the default."
), 'password' ), 'password'
) )

View File

@ -1,34 +1,34 @@
<div class="gluon-value"> <div class="gluon-value">
<div class="gluon-value-title"> <div class="gluon-value-title">
<input data-update="change" type="radio" value="security"<%= attr("id", id..'.1') .. attr("name", id) .. attr("checked", ((self:cfgvalue() or self.default) == "security") and "checked") %> /> <input data-update="change" type="radio" value="security"<%= attr("id", id..'.1') .. attr("name", id) .. attr("checked", ((self:cfgvalue() or self.default) == "security") and "checked") %>>
<label<%= attr("for", id..'.1')%>></label> <label<%= attr("for", id..'.1')%>></label>
</div> </div>
<div class="gluon-value-field-long"> <div class="gluon-value-field-long">
<label<%= attr("for", id..'.1') %> class="gluon-value-title"><%:Security mode%></label> <label<%= attr("for", id..'.1') %> class="gluon-value-title"><%:Security mode%></label>
<br /> <br>
<%| translate( <%| translate(
'In security mode, the mesh VPN uses an encrypted tunnel to connect to the VPN servers. ' .. '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 ' .. 'The encryption ensures that it is impossible for your internet access provider to see what ' ..
'data is exchanged over your node.' 'data is exchanged over your node.'
) %> ) %>
<br /> <br>
</div> </div>
<div class="gluon-value-field-long-after"></div> <div class="gluon-value-field-long-after"></div>
</div> </div>
<div class="gluon-value gluon-value-last"> <div class="gluon-value gluon-value-last">
<div class="gluon-value-title"> <div class="gluon-value-title">
<input data-update="change" type="radio" value="performance"<%= attr("id", id..'.2') .. attr("name", id) .. attr("checked", ((self:cfgvalue() or self.default) == "performance") and "checked") %> /> <input data-update="change" type="radio" value="performance"<%= attr("id", id..'.2') .. attr("name", id) .. attr("checked", ((self:cfgvalue() or self.default) == "performance") and "checked") %>>
<label<%= attr("for", id..'.2')%>></label> <label<%= attr("for", id..'.2')%>></label>
</div> </div>
<div class="gluon-value-field-long"> <div class="gluon-value-field-long">
<label<%= attr("for", id..'.2') %> class="gluon-value-title"><%:Performance mode%></label> <label<%= attr("for", id..'.2') %> class="gluon-value-title"><%:Performance mode%></label>
<br /> <br>
<%| translate( <%| translate(
'In performance mode, no encryption is used. This usually allows for higher throughput, but the data exchanged over your node is not ' .. '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.' 'protected against eavesdropping.'
) %> ) %>
<br /> <br>
</div> </div>
<div class="gluon-value-field-long-after"></div> <div class="gluon-value-field-long-after"></div>
</div> </div>

View File

@ -10,7 +10,7 @@ mode.package = "gluon-web-mesh-vpn-fastd"
mode.template = "mesh-vpn-fastd" mode.template = "mesh-vpn-fastd"
local methods = uci:get('fastd', 'mesh_vpn', 'method') 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 -- performance mode will only be used as default, if it is present in site.mesh_vpn.fastd.methods
mode.default = 'performance' mode.default = 'performance'
else 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 -- if performance mode was selected, and the method 'null' was not present in the original table, it will be added
local site_methods = {} local site_methods = {}
if data == 'performance' then if data == 'performance' then
table.insert(site_methods, 'null@l2tp')
table.insert(site_methods, 'null') table.insert(site_methods, 'null')
end end
for _, method in ipairs(site.mesh_vpn.fastd.methods()) do 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) table.insert(site_methods, method)
end end
end end

View File

@ -15,6 +15,6 @@
attr("name", id) .. attr("name", id) ..
attr("size", self.size) .. attr("size", self.size) ..
attr("placeholder", self.placeholder) attr("placeholder", self.placeholder)
%> /><br /> %>><br>
<% end %> <% end %>
</div> </div>

View File

@ -1,5 +1,5 @@
<form method="post" enctype="multipart/form-data" action="<%|url(request)%>" data-update="reset"> <form method="post" enctype="multipart/form-data" action="<%|url(request)%>" data-update="reset">
<input type="hidden" name="<%=id%>" value="1" /> <input type="hidden" name="<%=id%>" value="1">
<div class="gluon-form" id="form-<%=id%>"> <div class="gluon-form" id="form-<%=id%>">
<% if self.title and #self.title > 0 then %><h2 name="content"><%|self.title%></h2><% end %> <% if self.title and #self.title > 0 then %><h2 name="content"><%|self.title%></h2><% end %>
@ -16,12 +16,12 @@
<%- if self.submit ~= false then %> <%- if self.submit ~= false then %>
<input class="gluon-button gluon-button-submit" type="submit" value=" <input class="gluon-button gluon-button-submit" type="submit" value="
<%- if not self.submit then -%><%-:Save-%><%-else-%><%|self.submit%><%end-%> <%- if not self.submit then -%><%-:Save-%><%-else-%><%|self.submit%><%end-%>
" /> ">
<% end %> <% end %>
<%- if self.reset ~= false then %> <%- if self.reset ~= false then %>
<input class="gluon-button gluon-button-reset" type="reset" value=" <input class="gluon-button gluon-button-reset" type="reset" value="
<%- if not self.reset then -%><%-:Reset-%><%-else-%><%|self.reset%><%end-%> <%- if not self.reset then -%><%-:Reset-%><%-else-%><%|self.reset%><%end-%>
" /> ">
<% end %> <% end %>
</div> </div>
</form> </form>

View File

@ -1,5 +1,5 @@
<input data-update="click change" type="checkbox" value="1"<%= <input data-update="click change" type="checkbox" value="1"<%=
attr("id", id) .. attr("name", id) .. attr("id", id) .. attr("name", id) ..
attr("checked", self:cfgvalue() and "checked") attr("checked", self:cfgvalue() and "checked")
%> /> %>>
<label<%= attr("for", id)%>></label> <label<%= attr("for", id)%>></label>

View File

@ -1,5 +1,5 @@
<% <%
local br = self.orientation == "horizontal" and '&#160;&#160;&#160;' or '<br />' local br = self.orientation == "horizontal" and '&#160;&#160;&#160;' or '<br>'
local entries = self:entries() local entries = self:entries()
%> %>
@ -35,7 +35,7 @@
attr("name", id) .. attr("name", id) ..
attr("value", entry.key) .. attr("value", entry.key) ..
attr("checked", (self:cfgvalue() == entry.key) and "checked") attr("checked", (self:cfgvalue() == entry.key) and "checked")
%> /> %>>
<label<%= attr("for", id.."."..entry.key)%>></label> <label<%= attr("for", id.."."..entry.key)%>></label>
<%|entry.value%> <%|entry.value%>
</label> </label>

View File

@ -8,4 +8,4 @@
attr("maxlength", self.maxlength) .. attr("maxlength", self.maxlength) ..
attr("data-type", self.datatype) .. attr("data-type", self.datatype) ..
attr("data-optional", self.datatype and self.optional) attr("data-optional", self.datatype and self.optional)
%> /> %>>

View File

@ -7,7 +7,7 @@
<%- end -%> <%- end -%>
<% if self.subtemplate then include(self.subtemplate) end %> <% if self.subtemplate then include(self.subtemplate) end %>
<% if self.description and #self.description > 0 then -%> <% if self.description and #self.description > 0 then -%>
<br /> <br>
<div class="gluon-value-description"> <div class="gluon-value-description">
<%=self.description%> <%=self.description%>
</div> </div>

View File

@ -28,6 +28,9 @@ msgstr "PoE-Passthrough aktivieren"
msgid "Enable PoE Power Port %s" msgid "Enable PoE Power Port %s"
msgstr "PoE-Ausgabe auf Port %s aktivieren" 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" msgid "Enable meshing on the LAN interface"
msgstr "Mesh auf dem LAN-Port aktivieren" msgstr "Mesh auf dem LAN-Port aktivieren"

View File

@ -28,6 +28,9 @@ msgstr ""
msgid "Enable PoE Power Port %s" msgid "Enable PoE Power Port %s"
msgstr "" msgstr ""
msgid "Enable meshing on the Ethernet interface"
msgstr ""
msgid "Enable meshing on the LAN interface" msgid "Enable meshing on the LAN interface"
msgstr "Activer le réseau MESH sur le port LAN" msgstr "Activer le réseau MESH sur le port LAN"

View File

@ -19,6 +19,9 @@ msgstr ""
msgid "Enable PoE Power Port %s" msgid "Enable PoE Power Port %s"
msgstr "" msgstr ""
msgid "Enable meshing on the Ethernet interface"
msgstr ""
msgid "Enable meshing on the LAN interface" msgid "Enable meshing on the LAN interface"
msgstr "" msgstr ""

View File

@ -76,36 +76,37 @@ end
s = f:section(Section) s = f:section(Section)
local mesh_wan = s:option(Flag, "mesh_wan", translate("Enable meshing on the WAN interface")) local wired_mesh_help = {
mesh_wan.default = not uci:get_bool("network", "mesh_wan", "disabled") 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) local function wired_mesh(iface)
uci:set("network", "mesh_wan", "disabled", not data) if not sysconfig[iface .. '_ifname'] then return end
end local iface_roles = uci:get_list('gluon', 'iface_' .. iface, 'role')
if sysconfig.lan_ifname then local option = s:option(Flag, 'mesh_' .. iface, wired_mesh_help[iface])
s = f:section(Section) option.default = util.contains(iface_roles, 'mesh') ~= false
local mesh_lan = s:option(Flag, "mesh_lan", translate("Enable meshing on the LAN interface")) function option:write(data)
mesh_lan.default = not uci:get_bool("network", "mesh_lan", "disabled") local roles = uci:get_list('gluon', 'iface_' .. iface, 'role')
if data then
function mesh_lan:write(data) util.add_to_set(roles, 'mesh')
uci:set("network", "mesh_lan", "disabled", not data) else
util.remove_from_set(roles, 'mesh')
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
end 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
end end
wired_mesh('single')
wired_mesh('wan')
wired_mesh('lan')
local section local section
uci:foreach("system", "gpio_switch", function(si) uci:foreach("system", "gpio_switch", function(si)
if si[".name"]:match("poe") then if si[".name"]:match("poe") then
@ -160,7 +161,7 @@ function f:write()
uci:delete("network", "wan6", "ip6gw") uci:delete("network", "wan6", "ip6gw")
end end
uci:commit('gluon')
uci:commit("network") uci:commit("network")
uci:commit('system') uci:commit('system')
end end

View File

@ -4,7 +4,8 @@ local util = require "gluon.web.util"
local class = util.class 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 = {} local M = {}

View File

@ -56,15 +56,15 @@ msgstr "WLAN"
msgid "" msgid ""
"You can enable or disable your node's client and mesh network SSIDs here. " "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 " "Please don't disable the mesh network without a good reason, so other nodes "
"can mesh with yours.<br /><br />It is also possible to configure the WLAN " "can mesh with yours.<br><br>It is also possible to configure the WLAN "
"adapters transmission power here. Please note that the transmission power " "adapters transmission power here. Please note that the transmission power "
"values include the antenna gain where available, but there are many devices " "values include the antenna gain where available, but there are many devices "
"for which the gain is unavailable or inaccurate." "for which the gain is unavailable or inaccurate."
msgstr "" msgstr ""
"In diesem Abschnitt hast du die Möglichkeit, die SSIDs des Client- und des " "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-" "Mesh-Netzes zu aktivieren bzw. deaktivieren. Bitte lass die SSID des Mesh-"
"Netzes aktiviert, damit sich andere Knoten mit deinem verbinden können.<br /" "Netzes aktiviert, damit sich andere Knoten mit deinem verbinden können.<br"
"><br />Außerdem kann hier die Sendeleistung des WLAN-Adapters konfiguriert " "><br>Außerdem kann hier die Sendeleistung des WLAN-Adapters konfiguriert "
"werden. Wenn möglich, ist in den Werten der Sendeleistung der Antennengewinn " "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 " "enthalten; diese Werte sind allerdings für viele Geräte nicht verfügbar oder "
"fehlerhaft." "fehlerhaft."

View File

@ -51,14 +51,14 @@ msgstr "Wi-Fi"
msgid "" msgid ""
"You can enable or disable your node's client and mesh network SSIDs here. " "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 " "Please don't disable the mesh network without a good reason, so other nodes "
"can mesh with yours.<br /><br />It is also possible to configure the WLAN " "can mesh with yours.<br><br>It is also possible to configure the WLAN "
"adapters transmission power here. Please note that the transmission power " "adapters transmission power here. Please note that the transmission power "
"values include the antenna gain where available, but there are many devices " "values include the antenna gain where available, but there are many devices "
"for which the gain is unavailable or inaccurate." "for which the gain is unavailable or inaccurate."
msgstr "" msgstr ""
"Ici vous pouvez activer ou désactiver la SSID du client ou MESH. Pensez a " "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 " "laisser la SSID du MESH activée pour que les autres nœuds puissent se "
"connecter. <br /><br />Ici vous pouvez aussi configurer la puissance " "connecter. <br><br>Ici vous pouvez aussi configurer la puissance "
"d'émmission se votre Wi-Fi. Prenez note que les valeurs fournies pour la " "d'émmission se votre Wi-Fi. Prenez note que les valeurs fournies pour la "
"puissance de transmission prennent en compte les gains fournis par " "puissance de transmission prennent en compte les gains fournis par "
"l'antenne, et que ces valeurs ne sont pas toujours disponibles ou exactes." "l'antenne, et que ces valeurs ne sont pas toujours disponibles ou exactes."

View File

@ -42,7 +42,7 @@ msgstr ""
msgid "" msgid ""
"You can enable or disable your node's client and mesh network SSIDs here. " "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 " "Please don't disable the mesh network without a good reason, so other nodes "
"can mesh with yours.<br /><br />It is also possible to configure the WLAN " "can mesh with yours.<br><br>It is also possible to configure the WLAN "
"adapters transmission power here. Please note that the transmission power " "adapters transmission power here. Please note that the transmission power "
"values include the antenna gain where available, but there are many devices " "values include the antenna gain where available, but there are many devices "
"for which the gain is unavailable or inaccurate." "for which the gain is unavailable or inaccurate."

View File

@ -29,7 +29,7 @@ local f = Form(translate("WLAN"))
f:section(Section, nil, translate( f:section(Section, nil, translate(
"You can enable or disable your node's client and mesh network " "You can enable or disable your node's client and mesh network "
.. "SSIDs here. Please don't disable the mesh network without " .. "SSIDs here. Please don't disable the mesh network without "
.. "a good reason, so other nodes can mesh with yours.<br /><br />" .. "a good reason, so other nodes can mesh with yours.<br><br>"
.. "It is also possible to configure the WLAN adapters transmission power " .. "It is also possible to configure the WLAN adapters transmission power "
.. "here. Please note that the transmission power values include the antenna gain " .. "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." .. "where available, but there are many devices for which the gain is unavailable or inaccurate."

View File

@ -78,13 +78,6 @@ end
function Http:prepare_content(mime) function Http:prepare_content(mime)
if self.headers["content-type"] then return end 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) self:header("Content-Type", mime)
end end

View File

@ -67,6 +67,7 @@ define GluonSrcDiet
ifdef CONFIG_GLUON_MINIFY ifdef CONFIG_GLUON_MINIFY
# Use cp + rm instead of mv to preserve destination permissions # Use cp + rm instead of mv to preserve destination permissions
set -e; $(FIND) $(2) -type f | while read src; do \ set -e; $(FIND) $(2) -type f | while read src; do \
echo "Minifying $$$$src..."; \
luasrcdiet --noopt-binequiv -o "$$$$src.tmp" "$$$$src"; \ luasrcdiet --noopt-binequiv -o "$$$$src.tmp" "$$$$src"; \
cp "$$$$src.tmp" "$$$$src"; \ cp "$$$$src.tmp" "$$$$src"; \
rm "$$$$src.tmp"; \ rm "$$$$src.tmp"; \

View File

@ -0,0 +1,337 @@
From: Sven Eckelmann <sven@narfation.org>
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 <filename-of-initramfs-kernel>.bin && bootm $fileaddr
The actual sysupgrade image can then be transferred (on the LAN port) to the
device via
scp <filename-of-squashfs-sysupgrade>.bin root@192.168.1.1:/tmp/
On the device, the sysupgrade must then be started using
sysupgrade -n /tmp/<filename-of-squashfs-sysupgrade>.bin
Signed-off-by: Sven Eckelmann <sven@narfation.org>
(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 <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ 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 = &eth0;
+ };
+
+ keys {
+ compatible = "gpio-keys";
+
+ reset {
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ 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;
+ };
+};
+
+&eth0 {
+ 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>;
+ };
+};
+
+&eth1 {
+ 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

View File

@ -0,0 +1,151 @@
From: Sven Eckelmann <sven@narfation.org>
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 <filename-of-initramfs-kernel>.bin && bootm $fileaddr
The actual sysupgrade image can then be transferred (on the LAN port) to the
device via
scp <filename-of-squashfs-sysupgrade>.bin root@192.168.1.1:/tmp/
On the device, the sysupgrade must then be started using
sysupgrade -n /tmp/<filename-of-squashfs-sysupgrade>.bin
Signed-off-by: Sven Eckelmann <sven@narfation.org>
(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

View File

@ -0,0 +1,135 @@
From: Sven Eckelmann <sven@narfation.org>
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 <sven@narfation.org>
(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 <Abhimanyu.Vishwakarma@imgtec.com>
+Date: Sat, 25 Feb 2017 16:42:50 +0000
+Subject: mtd: nor: support mtd name from device tree
+
+Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
+
+--- 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 <Abhimanyu.Vishwakarma@imgtec.com>
+Date: Sat, 25 Feb 2017 16:42:50 +0000
+Subject: mtd: nor: support mtd name from device tree
+
+Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
+---
+ 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;

View File

@ -0,0 +1,316 @@
From: Sven Eckelmann <sven@narfation.org>
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 <filename-of-initramfs-kernel>.bin && bootm $fileaddr
The actual sysupgrade image can then be transferred (on the LAN port) to the
device via
scp <filename-of-squashfs-sysupgrade>.bin root@192.168.1.1:/tmp/
On the device, the sysupgrade must then be started using
sysupgrade -n /tmp/<filename-of-squashfs-sysupgrade>.bin
Signed-off-by: Sven Eckelmann <sven@narfation.org>
(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 <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ 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 = &eth0;
+ };
+
+ keys {
+ compatible = "gpio-keys";
+
+ reset {
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ 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;
+ };
+ };
+ };
+};
+
+&eth0 {
+ mtd-mac-address = <&art 0x0>;
+};
+
+&eth1 {
+ 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

View File

@ -0,0 +1,348 @@
From: Sven Eckelmann <sven@narfation.org>
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 <filename-of-initramfs-kernel>.bin && bootm $fileaddr
The actual sysupgrade image can then be transferred (on the LAN port) to the
device via
scp <filename-of-squashfs-sysupgrade>.bin root@192.168.1.1:/tmp/
On the device, the sysupgrade must then be started using
sysupgrade -n /tmp/<filename-of-squashfs-sysupgrade>.bin
Signed-off-by: Sven Eckelmann <sven@narfation.org>
(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 <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ 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 = &eth0;
+ };
+
+ 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;
+ };
+};
+
+&eth0 {
+ 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>;
+ };
+};
+
+&eth1 {
+ 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

View File

@ -0,0 +1,365 @@
From: Sven Eckelmann <sven@narfation.org>
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 <filename-of-initramfs-kernel>.bin && bootm $fileaddr
The actual sysupgrade image can then be transferred (on the LAN port) to the
device via
scp <filename-of-squashfs-sysupgrade>.bin root@192.168.1.1:/tmp/
On the device, the sysupgrade must then be started using
sysupgrade -n /tmp/<filename-of-squashfs-sysupgrade>.bin
Signed-off-by: Sven Eckelmann <sven@narfation.org>
(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 <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ 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 = &eth0;
+ };
+
+ keys {
+ compatible = "gpio-keys";
+
+ reset {
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ 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;
+ };
+};
+
+&eth0 {
+ 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>;
+ };
+};
+
+&eth1 {
+ 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

View File

@ -0,0 +1,124 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sun, 7 Mar 2021 11:48:32 +0100
Subject: fastd: simplify Config.in
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(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

View File

@ -0,0 +1,32 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
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 <mschiffer@universe-factory.net>
(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"

View File

@ -0,0 +1,59 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sun, 27 Jun 2021 13:07:49 +0200
Subject: fastd: update to v22
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(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 <mschiffer@universe-factory.net>
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 \

View File

@ -0,0 +1,88 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sun, 27 Jun 2021 13:26:26 +0200
Subject: fastd: add L2TP variant
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(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))

View File

@ -0,0 +1,63 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sun, 27 Jun 2021 14:48:48 +0200
Subject: fastd: fix start of non-L2TP variant
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(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 <mschiffer@universe-factory.net>
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: <d95ae843845760aecbbc62a734c2b93b401b1834.1624798048.git.mschiffer@universe-factory.net>
+From: Matthias Schiffer <mschiffer@universe-factory.net>
+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
+

View File

@ -0,0 +1,112 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
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 <mschiffer@universe-factory.net>
(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 <mschiffer@universe-factory.net>
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))

View File

@ -155,8 +155,6 @@ if #lib.devices > 0 then
handle_target_pkgs(lib.target_packages) handle_target_pkgs(lib.target_packages)
for _, dev in ipairs(lib.devices) do for _, dev in ipairs(lib.devices) do
local profile = dev.options.profile or dev.name
local device_pkgs = {} local device_pkgs = {}
local function handle_pkgs(pkgs) local function handle_pkgs(pkgs)
for _, pkg in ipairs(pkgs) do for _, pkg in ipairs(pkgs) do
@ -172,10 +170,10 @@ if #lib.devices > 0 then
handle_pkgs(dev.options.packages or {}) handle_pkgs(dev.options.packages or {})
handle_pkgs(site_packages(dev.image)) 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( lib.config(
'TARGET_DEVICE_' .. profile_config, true, 'TARGET_DEVICE_' .. profile_config, true,
string.format("unable to enable device '%s'", profile) string.format("unable to enable device '%s'", dev.name)
) )
lib.config( lib.config(
'TARGET_DEVICE_PACKAGES_' .. profile_config, 'TARGET_DEVICE_PACKAGES_' .. profile_config,

View File

@ -31,7 +31,6 @@ M.images = {}
local default_options = { local default_options = {
profile = false,
factory = '-squashfs-factory', factory = '-squashfs-factory',
factory_ext = '.bin', factory_ext = '.bin',
sysupgrade = '-squashfs-sysupgrade', sysupgrade = '-squashfs-sysupgrade',

View File

@ -22,6 +22,12 @@ local ATH10K_PACKAGES_QCA9888 = {
'-ath10k-firmware-qca9888-ct', '-ath10k-firmware-qca9888-ct',
} }
-- AVM
device('avm-fritz-wlan-repeater-450e', 'avm_fritz450e', {
factory = false,
})
-- devolo -- devolo
device('devolo-wifi-pro-1200e', 'devolo_dvl1200e', { 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 -- Enterasys
device('enterasys-ws-ap3705', 'enterasys_ws-ap3705i', { 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 -- setup via integrated (USB-)tty is possible as well
device('onion-omega', 'onion_omega') 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 -- Plasma Cloud
device('plasma-cloud-pa300', 'plasmacloud_pa300') device('plasma-cloud-pa300', 'plasmacloud_pa300')
@ -117,13 +266,34 @@ device('tp-link-archer-c6-v2', 'tplink_archer-c6-v2', {
packages = ATH10K_PACKAGES_QCA9888, 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', { device('tp-link-archer-d50-v1', 'tplink_archer-d50-v1', {
packages = ATH10K_PACKAGES_QCA9880, packages = ATH10K_PACKAGES_QCA9880,
factory = false, factory = false,
broken = true, -- 64M ath9k + ath10k & power LED not working 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-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-v2', 'tplink_cpe510-v2')
device('tp-link-cpe510-v3', 'tplink_cpe510-v3') 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-wdr3600-v1', 'tplink_tl-wdr3600-v1')
device('tp-link-tl-wdr4300-v1', 'tplink_tl-wdr4300-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') 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')