Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ffbs/ffbs-gluon
  • parabol1337/ffbs-gluon
  • darkbit/ffbs-gluon
3 results
Show changes
Commits on Source (23)
  • Ralf Jung's avatar
  • Matthias Schiffer's avatar
  • Matthias Schiffer's avatar
    gluon-config-mode-geo-location: fix source/i18n mismatch · a152a6e0
    Matthias Schiffer authored
    The text was changed in the i18n files, but the corresponding change in the
    Lua sources seemingly got lost during a rebase.
    
    Closes #1611
    
    (cherry picked from commit 2aa324ec)
    Unverified
    a152a6e0
  • Martin Weinelt's avatar
    gluon-status-page: rebuild status-page.js after 02dfc664 · b4a37a44
    Martin Weinelt authored
    The original commit only applied its changes to the source file and did
    not rebuild the minified file, therefore the change never went live.
    b4a37a44
  • David Bauer's avatar
    gluon-core: distribute dualband radios (#1606) · 4b236263
    David Bauer authored
    
    This commit distributes dualband radios evenly on 2.4 GHz and 5GHz with
    2.4 GHz being prioritised higher than 5 GHz. This means in case a device
    has only a single radio and this radio supports operation in both bands,
    it will be set to 2.4 GHz.
    
    Tested-by: default avatarMartin Weinelt <martin@darmstadt.freifunk.net>
    Signed-off-by: default avatarDavid Bauer <mail@david-bauer.net>
    4b236263
  • Martin Weinelt's avatar
  • Martin Weinelt's avatar
    modules: update OpenWrt · 17d22a56
    Martin Weinelt authored
    939fa07b04 kernel: bump 4.14 to 4.14.93
    cae263227f kernel: bump 4.9 to 4.9.150
    f34ad1a8f0 mt76: update to the latest version
    d58c6aedb6 tools/firmware-utils: fix sysupgrade typo in mkdapimg2
    0cef35f096 tools/firmware-utils: fix sysupgrade typo in mkdapimg
    0d6eaa0ba5 octeon: fix typo in platform.sh
    069fda746e fstools: update to the latest master branch
    3b4e779e93 fstools: update to git HEAD
    d7275c0312 fstools: filter unknown action in mount.hotplug script
    e0daa62af6 fstools: Install mount.hotplug and 10-fstab.defaults as 600
    4c0e15fc16 base-files: install missing /etc/iproute2/ematch_map
    c3fef269d6 cns3xxx: use actual size reads for PCIe
    367ccf7a2d kernel: bump 4.14 to 4.14.91
    b9dcf2de5f kernel: bump 4.9 to 4.9.148
    a8cc06c537 mac80211: brcmfmac: backport firmware loading changes & fix memory bugs
    c5c20f510a odhcpd: noop to fix PKG_SOURCE_DATE
    62ddfaff32 odhcpd: filter routes based on prefix_filter
    8a9b0b95df apm821xx: switch MX60(W)'s recovery images to multi-image method
    afcdf099b7 kernel: fix f2fs on big endian machines
    016a71a18a odhcpd: backport prefix filter/NETEV_ADDR6LIST_CHANGE event fixes
    806b570a35 ath10k: update QCA4019 firmware
    baa00b2182 brcm2708-gpu-fw: update to git HEAD
    5af6b7976f bcm53xx: backport DTS changes queued for the 4.21
    dbbba84ed4 bcm53xx: rename dts backport patches changing their prefixes
    
    Compile-tested: ar71xx, ramips-{mt7621,mt76x8}, x86-64
    Runtime-tested: ramips-mt7621 (D-Link DIR860L)
    17d22a56
  • Manu.WTF's avatar
    dc7ec574
  • Malte Moeller's avatar
    change device identifier to match machine identifier · 657e2e47
    Malte Moeller authored
    this matches the output of
    lua -e 'print(require(platform_info).get_image_name())'
    
    This way the manifest file is accepted by the autoupdater
    657e2e47
  • Martin Weinelt's avatar
  • Martin Weinelt's avatar
    gluon-core: fix unifiac-{lite,pro} primary mac selection · 35b34e2d
    Martin Weinelt authored
    fixes #1629
    35b34e2d
  • Martin Weinelt's avatar
    modules: update OpenWrt · f845cd98
    Martin Weinelt authored
    6e16dd1234 mt76: update to the latest version
    76037756d0 kernel: bump 4.14 to 4.14.94
    455bfd1065 kernel: bump 4.9 to 4.9.151
    fafd7691e6 opkg: update to latest Git head
    e789bd2243 opkg: drop argument from check_signature in opkg.conf
    3603c2321d ramips: mt7621: fix 5GHz WiFi LED on ZBT WG3526
    7f98cd8d50 odhcpd: fix onlink IA check (FS#2060)
    abd0f7995e kmod-sched-cake: bump to latest cake
    
    Compile-tested: ar71xx-{tiny,generic}, ramips-mt7621, x86-64
    f845cd98
  • Martin Weinelt's avatar
    modules: update routing · 1ae362f8
    Martin Weinelt authored
    ea345d1 Merge pull request #442 from ecsv/batadv-18.06
    0231308 batman-adv: Merge bugfixes from 2019.0
    
    Compile-tested: ar71xx-{tiny,generic}, ramips-mt7621, x86-64
    Runtime-tested: ar71xx-generic (TP-Link TL-WR1043NDv2)
    1ae362f8
  • Martin Weinelt's avatar
    modules: update OpenWrt · fcb08eaa
    Martin Weinelt authored
    13eeee7b2b mt76: update to the latest version
    ac1ce25671 OpenWrt v18.06.2: revert to branch defaults
    a02809f61b OpenWrt v18.06.2: adjust config defaults
    cddd7b4c77 base-files: config_get: prevent filename globbing
    e6162b2127 dnsmasq: backport missing braces fix
    d4178c8f47 build: fix umask detection bashism
    b98b55a64f build: fix STAGING_DIR cleaning for packages
    e6c2f3feb1 ar71xx: use correct wan mac address for the TP-Link Archer C7 v4
    2c7a1ccaea ar71xx: Add usb drivers in Archer C7 v4/v5 images
    39c3b5139f openssl: bump to 1.0.2q
    80ed6ebc56 dnsmasq: backport upstream static lease fix
    4f2199f528 wireguard: bump to 0.0.20190123
    8c105c62e4 wireguard: Update to snapshot 0.0.20181218
    1447924c95 mbedtls: update to 2.14.1 for 18.06
    e5a0b6cde0 uhttpd: disable concurrent requests by default
    11bfb39e39 kernel: bump 4.14 to 4.14.95
    dd5fa217dc kernel: bump 4.9 to 4.9.152
    91d3b87353 uboot-fritz4040: fix crash caused by interaction with gcc 7.1+
    
    Compile-tested: ar71xx-generic, mpc85xx-generic, ramips-mt7621
    Runtime-tested: ramips-mt7621 (D-Link DIR860L)
    fcb08eaa
  • Martin Weinelt's avatar
    modules: update OpenWrt · c58f780e
    Martin Weinelt authored
    9b14c7d3d1 netifd: handle hotplug event socket errors
    e33612484a brcm63xx: HG655b: fix the imagetag at dts
    ef17edae3d kernel: bump 4.14 to 4.14.97
    21762fe9d6 kernel: bump 4.9 to 4.9.154
    ab41836321 mt76: update to the latest version
    026f08a610 kernel: bump 4.14 to 4.14.96
    1f1f421af6 kernel: bump 4.9 to 4.9.153
    
    Compile-tested: ar71xx-generic, ramips-mt7621, x86-64
    c58f780e
  • Martin Weinelt's avatar
  • oszilloskop's avatar
    ar71xx: fix incorrect gl-ar150 and gl-ar300m image names (#1640) · 30f9665d
    oszilloskop authored
    also added manifest aliases for gl-ar150, gl-ar300m, gl-ar750
    30f9665d
  • David Bauer's avatar
    ramips-mt76x8: remove broken flag (#1608) · 9d8045f0
    David Bauer authored
    This commit removes the broken flag from all devices in the mt76x8
    subtarget.
    
    The stability of the mt76 driver for the mt7628 and mt7612 has greatly
    improved in the last half-year. It might be still behind ath9k and
    ath10k but it is suitable for daily use.
    
    This affects the following devices:
    
     - GL.iNet MT300N v2
     - TP-Link Archer C50 v3
     - TP-Link TL-WR841 v13
    9d8045f0
  • Martin Weinelt's avatar
    b5152481
  • David Bauer's avatar
    ramips-mt76x8: add support for TP-Link Archer C50 v4 (#1641) · 49dff9ce
    David Bauer authored
    This backports the TP-Link Archer C50 v4.
    
    We are dropping the following upstream commits. They add support for the
    TP-Link recovery-flag which enabled the web-recovery. As they are not
    needed for the router to work, we drop them for now.
    
    28cd2ca base-files: sysupgrade: support additional mtd options
    1e06482 mtd: add logic for TP-Link ramips recovery magic
    49dff9ce
  • Sven Eckelmann's avatar
    ath10k/ath10k-ct: support multicast and management rate control · 39948de2
    Sven Eckelmann authored
    Drivers with software rate control can directly use the selected multicast
    rate for multicast/broadcast frames and the minimal basic rate for
    management frames. But drivers with offloaded rate control algorithms must
    be informed about such upper layer decisions to configure the
    hardware/firmware.
    
    A new BSS_CHANGED_MCAST_RATE is introduced in mac80211 to automatically
    inform all drivers. ath10k can detect this event and forward it via WMI to
    the driver. The already existing BSS_CHANGED_BASIC_RATES can be used to
    select the management rate.
    
    Without the WMI commands, a low rate (not necessarily one from the basic
    rates) is used for bcast/mcast/management frames. This means that the
    /etc/config/wireless settings basic_rate and mcast_rate would have no
    effect on the rates selected by this driver for the mentioned frames.
    39948de2
  • David Bauer's avatar
    gluon-scheduled-domain-switch: add package (#1555) · ed3d890b
    David Bauer authored
    This package allows to automatically switch to another domain, either
    at a given point in time or after the node was offline long enough.
    ed3d890b
  • Martin Weinelt's avatar
    modules: update OpenWrt · 2f0d32ee
    Martin Weinelt authored
    62feabecd8 kernel: bump 4.14 to 4.14.99
    9fb3710a8b kernel: bump 4.9 to 4.9.156
    e5ace80759 mt76: update to the latest version
    fbb2186fbd kernel: bump 4.14 to 4.14.98
    72870cc108 kernel: bump 4.9 to 4.9.155
    19a6c4b2b3 mac80211: brcmfmac: fix a possible NULL pointer dereference
    d997712c71 ath9k: register GPIO chip for OF targets
    
    Compile-tested: ipq40xx, ramips-mt7621
    Runtime-tested: none
    2f0d32ee
Showing
with 669 additions and 48 deletions
......@@ -4,7 +4,9 @@ https://gluon.readthedocs.io/.
If you're new to Gluon and ready to get your feet wet, have a look at the
[Getting Started Guide](https://gluon.readthedocs.io/en/latest/user/getting_started.html).
**Gluon IRC channel: `#gluon` in [hackint](https://hackint.org/)**
Gluon's developers frequent an IRC chatroom at [#gluon](ircs://irc.hackint.org/#gluon)
on [hackint](https://hackint.org/). There is also a [webchat](https://webirc.hackint.org/#irc://irc.hackint.org/#gluon)
that allows for access from within your browser.
## Issues & Feature requests
......
......@@ -15,9 +15,13 @@ The `main repo`_ does have issues enabled.
IRC
---
Gluon's developers frequent `#gluon on hackint`_. You're welcome to join us!
Gluon's developers frequent the IRC chatroom `#gluon`_ on `hackint`_.
There is a `webchat`_ that allows for easy access from within your
webbrowser. You're welcome to join us!
.. _#gluon on hackint: irc://irc.hackint.org/#gluon
.. _#gluon: ircs://irc.hackint.org/#gluon
.. _hackint: https://hackint.org/
.. _webchat: https://webirc.hackint.org/#irc://irc.hackint.org/#gluon
Working with repositories
......
......@@ -135,6 +135,7 @@ ar71xx-generic
* AVM
- Fritz!Box 4020 [#avmflash]_
- Fritz!WLAN Repeater 300E [#avmflash]_
- Fritz!WLAN Repeater 450E [#avmflash]_
* Buffalo
......@@ -351,6 +352,10 @@ ramips-mt7620
- GL-MT300N [#80211s]_
- GL-MT750 [#80211s]_
* Nexx
- WT3020AD/F/H
ramips-mt7621
^^^^^^^^^^^^^
......@@ -371,6 +376,16 @@ ramips-mt7621
ramips-mt76x8
^^^^^^^^^^^^^
* GL.iNet
- GL-MT300N v2 [#80211s]_
* TP-Link
- TL-WR841N v13 [#80211s]_
- Archer C50 v3 [#80211s]_
- Archer C50 v4 [#80211s]_
* VoCore
- VoCore2 [#80211s]_
......
gluon-scheduled-domain-switch
=============================
This package allows to switch a routers domain at a given point
in time. This is needed for switching between incompatible transport
protocols (e.g. 802.11s and IBSS or VXLAN).
Nodes will switch when the defined *switch-time* has passed. In case the node was
powered off while this was supposed to happen, it might not be able to aquire the
correct time. In this case, the node will switch after it has not seen any gateway
for a given period of time.
site.conf
---------
All those settings have to be defined exclusively in the domain, not the site.
domain_switch : optional (needed for domains to switch)
target_domain :
- target domain to switch to
switch_after_offline_mins :
- amount of time without reachable gateway to switch unconditionally
switch_time :
- UNIX epoch after which domain will be switched
connection_check_targets :
- array of IPv6 addresses which are probed to determine if the node is
connected to the mesh
Example::
domain_switch = {
target_domain = 'new_domain',
switch_after_offline_mins = 120,
switch_time = 1546344000, -- 01.01.2019 - 12:00 UTC
connection_check_targets = {
'2001:4860:4860::8888',
'2001:4860:4860::8844',
},
},
......@@ -81,6 +81,12 @@ ramips-mt7621 [#noibss]_
AP+IBSS mode unsupported: This target is not built when *GLUON_WLAN_MESH* is
set to ``ibss``.
.. note::
The *ramips-mt7628* target has been renamed to *ramips-mt76x8*, and the *sunxi*
target has been renamed to *sunxi-cortexa7*. You might have to update your build
scripts accordingly.
New features
************
......@@ -90,10 +96,11 @@ following larger new features:
OpenStreetMap-based map in config wizard
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
When the features *web-wizard* and *web-osm* are enabled, the configuration
wizard will try to load an OSM-based map to allow the user to specify the node
location. Loading the map requires a working internet connection, for example
via WLAN (while connected to the Gluon node via Ethernet).
When the feature *config-mode-geo-location-osm* (package
*gluon-config-mode-geo-location-osm*) is enabled, the configuration wizard will
try to load an OSM-based map to allow the user to specify the node location.
Loading the map requires a working internet connection, for example via WLAN
(while connected to the Gluon node via Ethernet).
See the :ref:`config_mode <user-site-config_mode>` section for the *site.conf*
configuration of this feature.
......
......@@ -2,7 +2,7 @@ GLUON_FEEDS='packages routing luci gluon'
OPENWRT_REPO=https://git.openwrt.org/openwrt/openwrt.git
OPENWRT_BRANCH=openwrt-18.06
OPENWRT_COMMIT=eef6bd3393f406f73187a670fa34d5e6a228f9e8
OPENWRT_COMMIT=62feabecd8a84cfe0d6a5aa3bad2720dbf328370
PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git
PACKAGES_PACKAGES_BRANCH=openwrt-18.06
......@@ -10,7 +10,7 @@ PACKAGES_PACKAGES_COMMIT=d05b98c6c86da58db5cbda3c945007be09583609
PACKAGES_ROUTING_REPO=https://github.com/openwrt-routing/packages.git
PACKAGES_ROUTING_BRANCH=openwrt-18.06
PACKAGES_ROUTING_COMMIT=bc6e7f6903c8237c77131aedfc92dba40e1bc6ac
PACKAGES_ROUTING_COMMIT=ea345d16a6e27c2a8fdf67bf543cc36a5f189131
PACKAGES_LUCI_REPO=https://github.com/openwrt/luci.git
PACKAGES_LUCI_BRANCH=openwrt-18.06
......
......@@ -15,7 +15,7 @@ return function(form, uci)
if not text then
text = pkg_i18n.translate(
'If you want the location of your node to ' ..
'be displayed on the map, you can enter its coordinates here.'
'be displayed on public maps, you can enter its coordinates here.'
)
if osm then
text = text .. ' ' .. osm.help(i18n)
......
......@@ -3,15 +3,6 @@ need_string(in_site({'site_name'}))
-- this_domain() returns nil when multidomain support is disabled
if this_domain() then
function need_domain_name(path)
need_string(path)
need(path, function(default_domain)
local f = io.open(os.getenv('IPKG_INSTROOT') .. '/lib/gluon/domains/' .. default_domain .. '.json')
if not f then return false end
f:close()
return true
end, nil, 'be a valid domain name')
end
need_domain_name(in_site({'default_domain'}))
need_table(in_domain({'domain_names'}), function(domain)
......
......@@ -26,10 +26,10 @@ end
if platform.match('ar71xx', 'generic', {'tl-wdr3600', 'tl-wdr4300',
'tl-wr902ac-v1'}) then
table.insert(try_files, 1, '/sys/class/ieee80211/phy1/macaddress')
elseif platform.match('ramips', 'mt7621', {'dir-860l-b1'}) then
table.insert(try_files, 1, '/sys/class/ieee80211/phy1/macaddress')
elseif platform.match('ar71xx', 'generic', {'unifi-outdoor-plus', 'carambola2',
'a40', 'a60', 'koala',
elseif platform.match('ar71xx', 'generic', {'a40', 'a60',
'archer-c7-v4', 'archer-c7-v5',
'carambola2',
'koala',
'mr600', 'mr600v2',
'mr900', 'mr900v2',
'mr1750', 'mr1750v2',
......@@ -39,7 +39,8 @@ elseif platform.match('ar71xx', 'generic', {'unifi-outdoor-plus', 'carambola2',
'om2p-lc',
'om5p', 'om5p-an',
'om5p-ac', 'om5p-acv2',
'archer-c7-v4', 'archer-c7-v5'}) then
'unifi-outdoor-plus',
'unifiac-lite', 'unifiac-pro'}) then
table.insert(try_files, 1, '/sys/class/net/eth0/address')
elseif platform.match('ar71xx', 'generic', {'archer-c5', 'archer-c58-v1',
'archer-c59-v1', 'archer-c60-v1',
......@@ -48,6 +49,8 @@ elseif platform.match('ar71xx', 'generic', {'archer-c5', 'archer-c58-v1',
elseif platform.match('ipq40xx', nil, {'avm,fritzbox-4040',
'openmesh,a42', 'openmesh,a62'}) then
table.insert(try_files, 1, '/sys/class/net/eth0/address')
elseif platform.match('ramips', 'mt7621', {'dir-860l-b1'}) then
table.insert(try_files, 1, '/sys/class/ieee80211/phy1/macaddress')
end
......
......@@ -10,6 +10,43 @@ local uci = require('simple-uci').cursor()
-- Initial
if not sysconfig.gluon_version then
uci:delete_all('wireless', 'wifi-iface')
-- First count all radios with a fixed frequency band.
-- This is needed to distribute devices which have radios
-- capable of operating in the 2.4 GHz and 5 GHz band need
-- to be distributed evenly.
local radio_band_count = {band24=0, band5=0}
util.foreach_radio(uci, function(radio, index, config)
local hwmodes = iwinfo.nl80211.hwmodelist(util.find_phy(radio))
if (hwmodes.a or hwmodes.ac) and hwmodes.g then
-- Dualband - do nothing in this step
elseif hwmodes.g then
-- 2.4 GHz
radio_band_count["band24"] = radio_band_count["band24"] + 1
elseif hwmodes.a or hwmodes.ac then
-- 5 GHz
radio_band_count["band5"] = radio_band_count["band5"] + 1
end
end)
-- Use the number of all fixed 2.4G GHz and 5 GHz radios to
-- distribute dualband radios in this step.
util.foreach_radio(uci, function(radio, index, config)
local radio_name = radio['.name']
local hwmodes = iwinfo.nl80211.hwmodelist(util.find_phy(radio))
if (hwmodes.a or hwmodes.ac) and hwmodes.g then
-- Dualband radio
if radio_band_count["band24"] <= radio_band_count["band5"] then
-- Assign radio to 2.4GHz band
radio_band_count["band24"] = radio_band_count["band24"] + 1
uci:set('wireless', radio_name, 'hwmode', '11g')
else
-- Assign radio to 5GHz band
radio_band_count["band5"] = radio_band_count["band5"] + 1
uci:set('wireless', radio_name, 'hwmode', '11a')
end
end
end)
end
local function get_channel(radio, config)
......
......@@ -253,3 +253,12 @@ function foreach_radio(uci, f)
end
end
end
function get_uptime()
local uptime_file = readfile("/proc/uptime")
if uptime_file == nil then
-- Something went wrong reading "/proc/uptime"
return nil
end
return tonumber(uptime_file:match('^[^ ]+'))
end
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-scheduled-domain-switch
PKG_VERSION:=1
include ../gluon.mk
define Package/gluon-scheduled-domain-switch
TITLE:=Allows scheduled migrations between domains
DEPENDS:=+gluon-core @GLUON_MULTIDOMAIN
endef
$(eval $(call BuildPackageGluon,gluon-scheduled-domain-switch))
if need_table(in_domain({'domain_switch'}), check_domain_switch, false) then
need_domain_name(in_domain({'domain_switch', 'target_domain'}))
need_number(in_domain({'domain_switch', 'switch_after_offline_mins'}))
need_number(in_domain({'domain_switch', 'switch_time'}))
need_string_array_match(in_domain({'domain_switch', 'connection_check_targets'}), '^[%x:]+$')
end
#!/usr/bin/lua
local json = require 'jsonc'
local site = require 'gluon.site'
local unistd = require 'posix.unistd'
local cronfile = "/usr/lib/micron.d/gluon-scheduled-domain-switch"
-- Check if domain switch is scheduled
if site.domain_switch() == nil then
-- In case no domain switch is scheduled, remove cronfile
os.remove(cronfile)
os.exit(0)
end
-- Only in case domain switch is scheduled
local f = io.open(cronfile, "w")
f:write("* * * * * /usr/bin/gluon-check-connection\n")
f:write("*/5 * * * * /usr/bin/gluon-switch-domain\n")
f:close()
#!/usr/bin/lua
local unistd = require 'posix.unistd'
local util = require 'gluon.util'
local site = require 'gluon.site'
local offline_flag_file = "/tmp/gluon_offline"
local is_offline = true
-- Check if domain-switch is scheduled
if site.domain_switch() == nil then
-- Switch not applicable for current domain
os.exit(0)
end
-- Check reachability of pre-defined targets
for _, ip in ipairs(site.domain_switch.connection_check_targets()) do
local exit_code = os.execute("ping -c 1 -w 10 " .. ip)
if exit_code == 0 then
is_offline = false
break
end
end
if is_offline then
-- Check if we were previously offline
if unistd.access(offline_flag_file) then
os.exit(0)
end
-- Create offline flag
local f = io.open(offline_flag_file, "w")
f:write(tostring(util.get_uptime()))
f:close()
else
os.remove(offline_flag_file)
end
#!/usr/bin/lua
local uci = require('simple-uci').cursor()
local unistd = require 'posix.unistd'
local util = require 'gluon.util'
local site = require 'gluon.site'
-- Returns true if node was offline long enough to perform domain switch
function switch_after_min_reached()
if not unistd.access("/tmp/gluon_offline") then
return false
end
local switch_after_sec = site.domain_switch.switch_after_offline_mins() * 60
local current_uptime = util.get_uptime()
if current_uptime == nil then
return false
end
local f = util.readfile("/tmp/gluon_offline")
if f == nil then
return false
end
local offline_since = tonumber(f)
local offline_time_sec = current_uptime - offline_since
if offline_time_sec > switch_after_sec then
return true
end
return false
end
-- Returns true in case switch time has passed
function switch_time_passed()
local current_time = os.time()
local switch_time = site.domain_switch.switch_time()
return switch_time < current_time
end
if site.domain_switch() == nil then
-- Switch not applicable for current domain
print("No domain switch defined for the current domain.")
os.exit(0)
end
local current_domain = uci:get("gluon", "core", "domain")
local target_domain = site.domain_switch.target_domain()
if target_domain == current_domain then
-- Current and target domain are equal
print("Domain '" .. target_domain .. "' equals current domain.")
os.exit(1)
end
if not switch_after_min_reached() and not switch_time_passed() then
-- Neither switch-time passed nor switch_after_min reached
os.exit(0)
end
uci:set("gluon", "core", "domain", target_domain)
uci:commit("gluon")
os.execute("gluon-reconfigure")
os.execute("reboot")
"use strict";!function(){var a=JSON.parse(document.body.getAttribute("data-translations"));function i(t,e){return t.toFixed(e).replace(/\./,a["."])}function o(t,e){e--;for(var n=t;10<=n&&0<e;n/=10)e--;return i(t,e)}function r(t){return function(t,e,n){var r=0;if(void 0===n)return"- ";for(;e<n&&r<t.length-1;)n/=e,r++;return(n=o(n,3))+" "+t[r]}(["","K","M","G","T"],1024,t)}String.prototype.sprintf=function(){var t=0,e=arguments;return this.replace(/%s/g,function(){return e[t++]})};var u={id:function(t){return t},decimal:function(t){return i(t,2)},percent:function(t){return a["%s used"].sprintf(o(100*t,3)+"%")},memory:function(t){var e=1-(t.free+t.buffers+t.cached)/t.total;return u.percent(e)},time:function(t){var e=Math.round(t/60),n=Math.floor(e/1440),r=Math.floor(e%1440/60);e=Math.floor(e%60);var i="";return 1===n?i+=a["1 day"]+", ":1<n&&(i+=a["%s days"].sprintf(n)+", "),i+=r+":",e<10&&(i+="0"),i+=e},packetsDiff:function(t,e,n){if(0<n)return r=(t-e)/n,a["%s packets/s"].sprintf(i(r,0));var r},bytesDiff:function(t,e,n){if(0<n)return r(8*((t-e)/n))+"bps"},bytes:function(t){return r(t)+"B"}};function f(e,t){return t.split("/").forEach(function(t){e&&(e=e[t])}),e}function l(t,n){var e=new EventSource(t),r={};e.onmessage=function(t){var e=JSON.parse(t.data);n(e,r),r=e},e.onerror=function(){e.close(),window.setTimeout(function(){l(t,n)},3e3)}}var y,C=document.body.getAttribute("data-node-address");try{y=JSON.parse(document.body.getAttribute("data-node-location"))}catch(t){}var t=document.querySelectorAll("[data-statistics]");l("/cgi-bin/dyn/statistics",function(o,c){var s=o.uptime-c.uptime;t.forEach(function(t){var e=t.getAttribute("data-statistics"),n=t.getAttribute("data-format"),r=f(c,e),i=f(o,e);try{var a=u[n](i,r,s);void 0!==a&&(t.textContent=a)}catch(t){console.error(t)}});try{!function(t){var e=document.getElementById("mesh-vpn");if(t){e.style.display="";for(var i=document.getElementById("mesh-vpn-peers");i.lastChild;)i.removeChild(i.lastChild);var n=function e(n,r){return Object.keys(r.peers||{}).forEach(function(t){n.push([t,r.peers[t]])}),Object.keys(r.groups||{}).forEach(function(t){e(n,r.groups[t])}),n}([],t);n.sort(),n.forEach(function(t){var e=document.createElement("tr"),n=document.createElement("th");n.textContent=t[0],e.appendChild(n);var r=document.createElement("td");t[1]?r.textContent=a.connected+" ("+u.time(t[1].established)+")":r.textContent=a["not connected"],e.appendChild(r),i.appendChild(e)})}else e.style.display="none"}(o.mesh_vpn)}catch(t){console.error(t)}});var c={};function w(a){var o=document.createElement("canvas"),c=o.getContext("2d"),s=null,u=1.2;return{canvas:o,highlight:!1,resize:function(t,e){try{c.getImageData(0,0,t,e)}catch(t){}o.width=t,o.height=e},draw:function(t,e){var n,r,i=e(s);c.clearRect(t,0,5,o.height),i&&(n=t,r=i,c.beginPath(),c.fillStyle=a,c.arc(n,r,u,0,2*Math.PI,!1),c.closePath(),c.fill())},set:function(t){s=t}}}function h(){var s=-100,u=0,n=0,r=[],f=document.createElement("canvas");f.className="signalgraph",f.height=200;var l=f.getContext("2d");function t(){f.width=f.clientWidth,r.forEach(function(t){t.resize(f.width,f.height)})}function i(){if(0!==f.clientWidth){f.width!==f.clientWidth&&t(),l.clearRect(0,0,f.width,f.height);var e=!1;r.forEach(function(t){t.highlight&&(e=!0)}),l.save(),r.forEach(function(t){e&&(l.globalAlpha=.2),t.highlight&&(l.globalAlpha=1),t.draw(n,function(t){return e=t,n=s,r=u,i=f.height,(1-(e-n)/(r-n))*i;var e,n,r,i}),l.drawImage(t.canvas,0,0)}),l.restore(),l.save(),l.beginPath(),l.strokeStyle="rgba(255, 180, 0, 0.15)",l.lineWidth=5,l.moveTo(n+2.5,0),l.lineTo(n+2.5,f.height),l.stroke(),function(){var t,e,n,r,i=Math.floor(f.height/40);l.save(),l.lineWidth=.5,l.strokeStyle="rgba(0, 0, 0, 0.25)",l.fillStyle="rgba(0, 0, 0, 0.5)",l.textAlign="end",l.textBaseline="bottom",l.beginPath();for(var a=0;a<i;a++){var o=f.height-40*a;l.moveTo(0,o-.5),l.lineTo(f.width,o-.5);var c=Math.round((t=o,e=s,n=u,r=f.height,(e*t+n*(r-t))/r))+" dBm";l.save(),l.strokeStyle="rgba(255, 255, 255, 0.9)",l.lineWidth=4,l.miterLimit=2,l.strokeText(c,f.width-5,o-2.5),l.fillText(c,f.width-5,o-2.5),l.restore()}l.stroke(),l.strokeStyle="rgba(0, 0, 0, 0.83)",l.lineWidth=1.5,l.strokeRect(.5,.5,f.width-1,f.height-1),l.restore()}()}}t(),window.addEventListener("resize",i);var a=0;return window.requestAnimationFrame(function t(e){40<e-a&&(i(),n=(n+1)%f.width,a=e),window.requestAnimationFrame(t)}),{el:f,addSignal:function(t){r.push(t),t.resize(f.width,f.height)},removeSignal:function(t){r.splice(r.indexOf(t),1)}}}function d(t,e,n,r){var i=t.table.firstElementChild,a=t.table.insertRow(),o=a.insertCell();if(t.wireless){var c=document.createElement("span");c.textContent="",c.style.color=n,o.appendChild(c)}var h=document.createElement("span");h.textContent=e,o.appendChild(h);var s,d,u,f,l,v={};function g(t){var e=t.getAttribute("data-key");if(e){var n=t.getAttribute("data-suffix")||"",r=a.insertCell();r.textContent="-",v[e]={td:r,suffix:n}}}for(var m=0;m<i.children.length;m++)g(i.children[m]);function p(){l&&window.clearTimeout(l),l=window.setTimeout(function(){f&&t.signalgraph.removeSignal(f),a.parentNode.removeChild(a),r()},6e4)}function b(t){var e=function(t){"::"==t.slice(0,2)&&(t="0"+t),"::"==t.slice(-2)&&(t+="0");var e=t.split(":"),n=e.length,r=[];return e.forEach(function(t,e){if(""===t)for(;n++<=8;)r.push(0);else{if(!/^[a-f0-9]{1,4}$/i.test(t))return;r.push(parseInt(t,16))}}),r}(t);if(e){var n="";return e.forEach(function(t){n+=("0000000000000000"+t.toString(2)).slice(-16)}),n}}return t.wireless&&((s=a.insertCell()).textContent="-",(d=a.insertCell()).textContent="-",(u=a.insertCell()).textContent="-",f=w(n),t.signalgraph.addSignal(f)),a.onmouseenter=function(){a.classList.add("highlight"),f&&(f.highlight=!0)},a.onmouseleave=function(){a.classList.remove("highlight"),f&&(f.highlight=!1)},p(),{update_nodeinfo:function(t){var e,n,r,i,a,o,c,s,u=function(t){var r=b(C);if(t&&t[0]){(t=t.map(function(t){var e=b(t);if(!e)return[-1];var n=0;return r&&(n=function(t,e){var n;for(n=0;n<t.length&&n<e.length&&t[n]===e[n];n++);return n}(r,e)),[n,e,t]})).sort(function(t,e){return t[0]<e[0]?1:t[0]>e[0]?-1:t[1]<e[1]?-1:t[1]>e[1]?1:0});var e=t[0][2];return e&&!/^fe80:/i.test(e)?e:void 0}}(t.network.addresses);if(u){if("span"===h.nodeName.toLowerCase()){var f=h;h=document.createElement("a"),f.parentNode.replaceChild(h,f)}h.href="http://["+u+"]/"}if(h.textContent=t.hostname,y&&t.location){var l=(e=y.latitude,n=y.longitude,r=t.location.latitude,i=t.location.longitude,a=Math.PI/180,o=(r*=a)-(e*=a),c=(i*=a)-(n*=a),s=Math.sin(o/2)*Math.sin(o/2)+Math.sin(c/2)*Math.sin(c/2)*Math.cos(e)*Math.cos(r),2*Math.asin(Math.sqrt(s))*6372.8);d.textContent=Math.round(1e3*l)+" m"}p()},update_mesh:function(n){Object.keys(v).forEach(function(t){var e=v[t];e.td.textContent=n[t]+e.suffix}),p()},update_wifi:function(t){s.textContent=t.signal,u.textContent=Math.round(t.inactive/1e3)+" s",a.classList.toggle("inactive",200<t.inactive),f.set(200<t.inactive?null:t.signal),p()}}}function s(t,e,n){var r,a={};n&&(r=h(),t.appendChild(r.el));var i={table:t.firstElementChild,signalgraph:r,ifname:e,wireless:n},o=!1,c={},s=[];function u(){if(!o){o=!0;var t=new EventSource("/cgi-bin/dyn/neighbours-nodeinfo?"+encodeURIComponent(e));t.addEventListener("neighbour",function(t){try{var n=JSON.parse(t.data);(e=n,r=[],i=e.network.mesh,Object.keys(i).forEach(function(t){var e=i[t].interfaces;Object.keys(e).forEach(function(t){e[t].forEach(function(t){r.push(t)})})}),r).forEach(function(t){var e=a[t];if(e){delete c[t];try{e.update_nodeinfo(n)}catch(t){console.error(t)}}})}catch(t){console.error(t)}var e,r,i},!1),t.onerror=function(){t.close(),o=!1,Object.keys(c).forEach(function(t){0<c[t]&&(c[t]--,u())})}}}function f(t){var e=a[t];return e||(c[t]=3,e=a[t]=d(i,t,(s[0]||(s=["#396AB1","#DA7C30","#3E9651","#CC2529","#535154","#6B4C9A","#922428","#948B3D"]),s.shift()),function(){delete c[t],delete a[t]}),u()),e}return n&&l("/cgi-bin/dyn/stations?"+encodeURIComponent(e),function(n){Object.keys(n).forEach(function(t){var e=n[t];f(t).update_wifi(e)})}),{get_neigh:f}}document.querySelectorAll("[data-interface]").forEach(function(t){var e=t.getAttribute("data-interface"),n=(t.getAttribute("data-interface-address"),!!t.getAttribute("data-interface-wireless"));c[e]=s(t,e,n)});var e=document.body.getAttribute("data-mesh-provider");e&&l(e,function(r){Object.keys(r).forEach(function(t){var e=r[t],n=c[e.ifname];n&&n.get_neigh(t).update_mesh(e)})})}();
\ No newline at end of file
"use strict";!function(){var a=JSON.parse(document.body.getAttribute("data-translations"));function r(t,e){return t.toFixed(e).replace(/\./,a["."])}function o(t,e){e--;for(var n=t;10<=n&&0<e;n/=10)e--;return r(t,e)}function i(t){return function(t,e,n){var i=0;if(void 0===n)return"- ";for(;e<n&&i<t.length-1;)n/=e,i++;return(n=o(n,3))+" "+t[i]}(["","K","M","G","T"],1024,t)}String.prototype.sprintf=function(){var t=0,e=arguments;return this.replace(/%s/g,function(){return e[t++]})};var u={id:function(t){return t},decimal:function(t){return r(t,2)},percent:function(t){return a["%s used"].sprintf(o(100*t,3)+"%")},memory:function(t){var e=1-t.available/t.total;return u.percent(e)},time:function(t){var e=Math.round(t/60),n=Math.floor(e/1440),i=Math.floor(e%1440/60);e=Math.floor(e%60);var r="";return 1===n?r+=a["1 day"]+", ":1<n&&(r+=a["%s days"].sprintf(n)+", "),r+=i+":",e<10&&(r+="0"),r+=e},packetsDiff:function(t,e,n){if(0<n)return i=(t-e)/n,a["%s packets/s"].sprintf(r(i,0));var i},bytesDiff:function(t,e,n){if(0<n)return i(8*((t-e)/n))+"bps"},bytes:function(t){return i(t)+"B"}};function l(e,t){return t.split("/").forEach(function(t){e&&(e=e[t])}),e}function f(t,n){var e=new EventSource(t),i={};e.onmessage=function(t){var e=JSON.parse(t.data);n(e,i),i=e},e.onerror=function(){e.close(),window.setTimeout(function(){f(t,n)},3e3)}}var y,C=document.body.getAttribute("data-node-address");try{y=JSON.parse(document.body.getAttribute("data-node-location"))}catch(t){}var t=document.querySelectorAll("[data-statistics]");f("/cgi-bin/dyn/statistics",function(o,c){var s=o.uptime-c.uptime;t.forEach(function(t){var e=t.getAttribute("data-statistics"),n=t.getAttribute("data-format"),i=l(c,e),r=l(o,e);try{var a=u[n](r,i,s);void 0!==a&&(t.textContent=a)}catch(t){console.error(t)}});try{!function(t){var e=document.getElementById("mesh-vpn");if(t){e.style.display="";for(var r=document.getElementById("mesh-vpn-peers");r.lastChild;)r.removeChild(r.lastChild);var n=function e(n,i){return Object.keys(i.peers||{}).forEach(function(t){n.push([t,i.peers[t]])}),Object.keys(i.groups||{}).forEach(function(t){e(n,i.groups[t])}),n}([],t);n.sort(),n.forEach(function(t){var e=document.createElement("tr"),n=document.createElement("th");n.textContent=t[0],e.appendChild(n);var i=document.createElement("td");t[1]?i.textContent=a.connected+" ("+u.time(t[1].established)+")":i.textContent=a["not connected"],e.appendChild(i),r.appendChild(e)})}else e.style.display="none"}(o.mesh_vpn)}catch(t){console.error(t)}});var c={};function w(a){var o=document.createElement("canvas"),c=o.getContext("2d"),s=null;return{canvas:o,highlight:!1,resize:function(t,e){try{c.getImageData(0,0,t,e)}catch(t){}o.width=t,o.height=e},draw:function(t,e){var n,i,r=e(s);c.clearRect(t,0,5,o.height),r&&(n=t,i=r,c.beginPath(),c.fillStyle=a,c.arc(n,i,1.2,0,2*Math.PI,!1),c.closePath(),c.fill())},set:function(t){s=t}}}function h(){var s=-100,u=0,n=0,i=[],l=document.createElement("canvas");l.className="signalgraph",l.height=200;var f=l.getContext("2d");function t(){l.width=l.clientWidth,i.forEach(function(t){t.resize(l.width,l.height)})}function r(){if(0!==l.clientWidth){l.width!==l.clientWidth&&t(),f.clearRect(0,0,l.width,l.height);var e=!1;i.forEach(function(t){t.highlight&&(e=!0)}),f.save(),i.forEach(function(t){e&&(f.globalAlpha=.2),t.highlight&&(f.globalAlpha=1),t.draw(n,function(t){return e=t,n=s,i=u,r=l.height,(1-(e-n)/(i-n))*r;var e,n,i,r}),f.drawImage(t.canvas,0,0)}),f.restore(),f.save(),f.beginPath(),f.strokeStyle="rgba(255, 180, 0, 0.15)",f.lineWidth=5,f.moveTo(n+2.5,0),f.lineTo(n+2.5,l.height),f.stroke(),function(){var t,e,n,i,r=Math.floor(l.height/40);f.save(),f.lineWidth=.5,f.strokeStyle="rgba(0, 0, 0, 0.25)",f.fillStyle="rgba(0, 0, 0, 0.5)",f.textAlign="end",f.textBaseline="bottom",f.beginPath();for(var a=0;a<r;a++){var o=l.height-40*a;f.moveTo(0,o-.5),f.lineTo(l.width,o-.5);var c=Math.round((t=o,e=s,n=u,i=l.height,(e*t+n*(i-t))/i))+" dBm";f.save(),f.strokeStyle="rgba(255, 255, 255, 0.9)",f.lineWidth=4,f.miterLimit=2,f.strokeText(c,l.width-5,o-2.5),f.fillText(c,l.width-5,o-2.5),f.restore()}f.stroke(),f.strokeStyle="rgba(0, 0, 0, 0.83)",f.lineWidth=1.5,f.strokeRect(.5,.5,l.width-1,l.height-1),f.restore()}()}}t(),window.addEventListener("resize",r);var a=0;return window.requestAnimationFrame(function t(e){40<e-a&&(r(),n=(n+1)%l.width,a=e),window.requestAnimationFrame(t)}),{el:l,addSignal:function(t){i.push(t),t.resize(l.width,l.height)},removeSignal:function(t){i.splice(i.indexOf(t),1)}}}function d(t,e,n,i){var r=t.table.firstElementChild,a=t.table.insertRow(),o=a.insertCell();if(t.wireless){var c=document.createElement("span");c.textContent="",c.style.color=n,o.appendChild(c)}var h=document.createElement("span");h.textContent=e,o.appendChild(h);var s,d,u,l,f,v={};function g(t){var e=t.getAttribute("data-key");if(e){var n=t.getAttribute("data-suffix")||"",i=a.insertCell();i.textContent="-",v[e]={td:i,suffix:n}}}for(var m=0;m<r.children.length;m++)g(r.children[m]);function p(){f&&window.clearTimeout(f),f=window.setTimeout(function(){l&&t.signalgraph.removeSignal(l),a.parentNode.removeChild(a),i()},6e4)}function b(t){var e=function(t){"::"==t.slice(0,2)&&(t="0"+t),"::"==t.slice(-2)&&(t+="0");var e=t.split(":"),n=e.length,i=[];return e.forEach(function(t,e){if(""===t)for(;n++<=8;)i.push(0);else{if(!/^[a-f0-9]{1,4}$/i.test(t))return;i.push(parseInt(t,16))}}),i}(t);if(e){var n="";return e.forEach(function(t){n+=("0000000000000000"+t.toString(2)).slice(-16)}),n}}return t.wireless&&((s=a.insertCell()).textContent="-",(d=a.insertCell()).textContent="-",(u=a.insertCell()).textContent="-",l=w(n),t.signalgraph.addSignal(l)),a.onmouseenter=function(){a.classList.add("highlight"),l&&(l.highlight=!0)},a.onmouseleave=function(){a.classList.remove("highlight"),l&&(l.highlight=!1)},p(),{update_nodeinfo:function(t){var e,n,i,r,a,o,c,s,u=function(t){var i=b(C);if(t&&t[0]){(t=t.map(function(t){var e=b(t);if(!e)return[-1];var n=0;return i&&(n=function(t,e){var n;for(n=0;n<t.length&&n<e.length&&t[n]===e[n];n++);return n}(i,e)),[n,e,t]})).sort(function(t,e){return t[0]<e[0]?1:t[0]>e[0]?-1:t[1]<e[1]?-1:t[1]>e[1]?1:0});var e=t[0][2];return e&&!/^fe80:/i.test(e)?e:void 0}}(t.network.addresses);if(u){if("span"===h.nodeName.toLowerCase()){var l=h;h=document.createElement("a"),l.parentNode.replaceChild(h,l)}h.href="http://["+u+"]/"}if(h.textContent=t.hostname,y&&t.location){var f=(e=y.latitude,n=y.longitude,i=t.location.latitude,r=t.location.longitude,a=Math.PI/180,o=(i*=a)-(e*=a),c=(r*=a)-(n*=a),s=Math.sin(o/2)*Math.sin(o/2)+Math.sin(c/2)*Math.sin(c/2)*Math.cos(e)*Math.cos(i),2*Math.asin(Math.sqrt(s))*6372.8);d.textContent=Math.round(1e3*f)+" m"}p()},update_mesh:function(n){Object.keys(v).forEach(function(t){var e=v[t];e.td.textContent=n[t]+e.suffix}),p()},update_wifi:function(t){s.textContent=t.signal,u.textContent=Math.round(t.inactive/1e3)+" s",a.classList.toggle("inactive",200<t.inactive),l.set(200<t.inactive?null:t.signal),p()}}}function s(t,e,n){var i,a={};n&&(i=h(),t.appendChild(i.el));var r={table:t.firstElementChild,signalgraph:i,ifname:e,wireless:n},o=!1,c={},s=[];function u(){if(!o){o=!0;var t=new EventSource("/cgi-bin/dyn/neighbours-nodeinfo?"+encodeURIComponent(e));t.addEventListener("neighbour",function(t){try{var n=JSON.parse(t.data);(e=n,i=[],r=e.network.mesh,Object.keys(r).forEach(function(t){var e=r[t].interfaces;Object.keys(e).forEach(function(t){e[t].forEach(function(t){i.push(t)})})}),i).forEach(function(t){var e=a[t];if(e){delete c[t];try{e.update_nodeinfo(n)}catch(t){console.error(t)}}})}catch(t){console.error(t)}var e,i,r},!1),t.onerror=function(){t.close(),o=!1,Object.keys(c).forEach(function(t){0<c[t]&&(c[t]--,u())})}}}function l(t){var e=a[t];return e||(c[t]=3,e=a[t]=d(r,t,(s[0]||(s=["#396AB1","#DA7C30","#3E9651","#CC2529","#535154","#6B4C9A","#922428","#948B3D"]),s.shift()),function(){delete c[t],delete a[t]}),u()),e}return n&&f("/cgi-bin/dyn/stations?"+encodeURIComponent(e),function(n){Object.keys(n).forEach(function(t){var e=n[t];l(t).update_wifi(e)})}),{get_neigh:l}}document.querySelectorAll("[data-interface]").forEach(function(t){var e=t.getAttribute("data-interface"),n=(t.getAttribute("data-interface-address"),!!t.getAttribute("data-interface-wireless"));c[e]=s(t,e,n)});var e=document.body.getAttribute("data-mesh-provider");e&&f(e,function(i){Object.keys(i).forEach(function(t){var e=i[t],n=c[e.ifname];n&&n.get_neigh(t).update_mesh(e)})})}();
\ No newline at end of file
From: Andreas Ziegler <dev@andreas-ziegler.de>
Date: Thu, 27 Dec 2018 15:02:41 +0100
Subject: ramips: mt7621: fix 5GHz WiFi LED on ZBT WG3526
This fixes the 5GHz WiFi LED which was previously not working.
Signed-off-by: Andreas Ziegler <dev@andreas-ziegler.de>
diff --git a/target/linux/ramips/dts/ZBT-WG3526.dtsi b/target/linux/ramips/dts/ZBT-WG3526.dtsi
index 104a51f8de7110c0f65f760af70033853f3da745..e42ec5e33de7fb69a9c668406f876f6443d2912b 100644
--- a/target/linux/ramips/dts/ZBT-WG3526.dtsi
+++ b/target/linux/ramips/dts/ZBT-WG3526.dtsi
@@ -101,6 +101,10 @@
mediatek,mtd-eeprom = <&factory 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
};
+
+ led {
+ led-sources = <2>;
+ };
};
};
From: David Bauer <mail@david-bauer.net>
Date: Wed, 28 Nov 2018 23:56:31 +0100
Subject: tools: mktplinkfw2: add split-uboot layout
This commit adds the split-uboot partition layout used by the
Archer C50 v4 to mktplinkfw2.
Signed-off-by: David Bauer <mail@david-bauer.net>
diff --git a/tools/firmware-utils/src/mktplinkfw2.c b/tools/firmware-utils/src/mktplinkfw2.c
index dead49e7af8839bac5d1dee7445cf8921208c970..35db848bbab9f8315526dfa24ed351ad58878dde 100644
--- a/tools/firmware-utils/src/mktplinkfw2.c
+++ b/tools/firmware-utils/src/mktplinkfw2.c
@@ -146,6 +146,12 @@ static struct flash_layout layouts[] = {
.kernel_la = 0x80000000,
.kernel_ep = 0x80000000,
.rootfs_ofs = 0x140000,
+ }, {
+ .id = "8MSUmtk", /* Split U-Boot OS */
+ .fw_max_len = 0x770000,
+ .kernel_la = 0x80000000,
+ .kernel_ep = 0x80000000,
+ .rootfs_ofs = 0x140000,
}, {
.id = "8MLmtk",
.fw_max_len = 0x7b0000,
From: David Bauer <mail@david-bauer.net>
Date: Sun, 3 Feb 2019 00:23:18 +0100
Subject: ramips: add support for Archer C50 v4
This adds support for the TP-Link Archer C50 v4.
It uses the same hardware as the v3 variant, sharing the same FCC-ID.
CPU: MediaTek MT7628 (580MHz)
RAM: 64M DDR2
FLASH: 8M SPI
WiFi: 2.4GHz 2x2 MT7628 b/g/n integrated
WiFI: 5GHz 2x2 MT7612 a/n/ac
ETH: 1x WAN 4x LAN
LED: Power, WiFi2, WiFi5, LAN, WAN, WPS
BTN: WPS/WiFi, RESET
UART: Near ETH ports, 115200 8n1, TP-Link pinout
Create Factory image
--------------------
As all installation methods require a U-Boot to be integrated into the
Image (and we do not ship one with the image) we are not able to create
an image in the OpenWRT build-process.
Download a TP-Link image from their Wesite and a OpenWRT sysupgrade
image for the device and build yourself a factory image like following:
TP-Link image: tpl.bin
OpenWRT sysupgrade image: owrt.bin
> dd if=tpl.bin of=boot.bin bs=131584 count=1
> cat owrt.bin >> boot.bin
Installing via Web-UI
---------------------
Upload the boot.bin via TP-Links firmware upgrade tool in the
web-interface.
Installing via Recovery
-----------------------
Activate Web-Recovery by beginning the upgrade Process with a
Firmware-Image from TP-Link. After starting the Firmware Upgrade,
wait ~3 seconds (When update status is switching to 0%), then
disconnect the power supply from the device. Upgrade flag (which
activates Web-Recovery) is written before the OS-image is touched and
removed after write is succesfull, so this procedure should be safe.
Plug the power back in. It will come up in Recovery-Mode on 192.168.0.1.
When active, all LEDs but the WPS LED are off.
Remeber to assign yourself a static IP-address as DHCP is not active in
this mode.
The boot.bin can now be uploaded and flashed using the web-recovery.
Installing via TFTP
-------------------
Prepare an image like following (Filenames from factory image steps
apply here)
> dd if=/dev/zero of=tp_recovery.bin bs=196608 count=1
> dd if=tpl.bin of=tmp.bin bs=131584 count=1
> dd if=tmp.bin of=boot.bin bs=512 skip=1
> cat boot.bin >> tp_recovery.bin
> cat owrt.bin >> tp_recovery.bin
Place tp_recovery.bin in root directory of TFTP server and listen on
192.168.0.66/24.
Connect router LAN ports with your computer and power up the router
while pressing the reset button. The router will download the image via
tftp and after ~1 Minute reboot into OpenWRT.
U-Boot CLI
----------
U-Boot CLI can be activated by holding down '4' on bootup.
Dual U-Boot
-----------
This is the first TP-Link MediaTek device to feature a split-uboot
design. The first (factory-uboot) provides recovery via TFTP and HTTP,
jumping straight into the second (firmware-uboot) if no recovery needs
to be performed. The firmware-uboot unpacks and executed the kernel.
Web-Recovery
------------
TP-Link integrated a new Web-Recovery like the one on the Archer C7v4 /
TL-WR1043v5. Stock-firmware sets a flag in the "romfile" partition
before beginning to write and removes it afterwards. If the router boots
with this flag set, bootloader will automatically start Web-recovery and
listens on 192.168.0.1. This way, the vendor-firmware or an OpenWRT
factory image can be written.
It is important to note that Web-Recovery is only based on this flag. It
can't detect e.g. a crashing kernel or other means. Once activated it
won't boot the OS before a recovery action (either via TFTP or HTTP) is
performed. This recovery-mode is indicated by an illuminated WPS-LED on
boot.
Signed-off-by: David Bauer <mail@david-bauer.net>
diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index 6057275978591192e3b7799a8e6d97761c3e23a5..19386b9e139a25fd1ac29cd9a66b738b5b092cdf 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -410,7 +410,8 @@ tplink,c20-v4)
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
ucidef_set_led_netdev "wlan2g" "wlan2g" "$boardname:green:wlan2g" "wlan0"
;;
-tplink,c50-v3)
+tplink,c50-v3|\
+tplink,c50-v4)
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan2g" "phy0tpt"
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index ebf40ad1fa874d324b43c8f0613bca53a19ab2d0..1c6cc6b0af745b43b81bbfffc9b5462c1b88defc 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -205,6 +205,7 @@ ramips_setup_interfaces()
rt-n14u|\
tplink,c20-v4|\
tplink,c50-v3|\
+ tplink,c50-v4|\
tplink,tl-mr3420-v5|\
tplink,tl-wr842n-v5|\
tl-wr840n-v4|\
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index 2f51add331fef4693e997433a4ab0e665da80e02..6d021b6def2f1fe7b71a67f36749c440f3bad1d4 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -42,6 +42,7 @@ get_status_led() {
r6220|\
tplink,c20-v4|\
tplink,c50-v3|\
+ tplink,c50-v4|\
tplink,tl-mr3420-v5|\
tplink,tl-wr842n-v5|\
tplink,tl-wr902ac-v3|\
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index ffdc5e73e0ede286c10396810954a230c8ea32fc..8055853508fc850a1826166c7e0cbdf443df27cb 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -256,6 +256,7 @@ platform_check_image() {
tplink,c20-v1|\
tplink,c20-v4|\
tplink,c50-v3|\
+ tplink,c50-v4|\
tplink,tl-mr3420-v5|\
tplink,tl-wr842n-v5|\
tplink,tl-wr902ac-v3|\
diff --git a/target/linux/ramips/dts/ArcherC50V4.dts b/target/linux/ramips/dts/ArcherC50V4.dts
new file mode 100644
index 0000000000000000000000000000000000000000..bb4a65436fa435e5636aca3bf326b5a3ca61f7e3
--- /dev/null
+++ b/target/linux/ramips/dts/ArcherC50V4.dts
@@ -0,0 +1,93 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include "TPLINK-8M-SPLIT-UBOOT.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ compatible = "tplink,c50-v4", "mediatek,mt7628an-soc";
+ model = "TP-Link Archer C50 v4";
+
+ keys {
+ compatible = "gpio-keys-polled";
+ poll-interval = <20>;
+
+ reset {
+ label = "reset";
+ gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_RESTART>;
+ };
+
+ rfkill {
+ label = "rfkill";
+ gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_RFKILL>;
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led_power: power {
+ label = "c50-v4:green:power";
+ gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
+ };
+
+ wlan2 {
+ label = "c50-v4:green:wlan2g";
+ gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
+ };
+
+ wlan5 {
+ label = "c50-v4:green:wlan5g";
+ gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
+ };
+
+ lan {
+ label = "c50-v4:green:lan";
+ gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
+ };
+
+ wan {
+ label = "c50-v4:green:wan";
+ gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
+ };
+
+ wan_orange {
+ label = "c50-v4:orange:wan";
+ gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
+ };
+
+ wps {
+ label = "c50-v4:green:wps";
+ gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "p0led_an", "p1led_an", "p2led_an",
+ "p3led_an", "p4led_an", "wdt", "wled_an";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&pcie {
+ status = "okay";
+
+ pcie-bridge {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&radio 0x8000>;
+ ieee80211-freq-limit = <5000000 6000000>;
+ mtd-mac-address = <&rom 0xf100>;
+ mtd-mac-address-increment = <(-1)>;
+ };
+ };
+};
\ No newline at end of file
diff --git a/target/linux/ramips/dts/TPLINK-8M-SPLIT-UBOOT.dtsi b/target/linux/ramips/dts/TPLINK-8M-SPLIT-UBOOT.dtsi
new file mode 100644
index 0000000000000000000000000000000000000000..539f476dce6e1fe43769f3ed41ae94d5f6fbc2cc
--- /dev/null
+++ b/target/linux/ramips/dts/TPLINK-8M-SPLIT-UBOOT.dtsi
@@ -0,0 +1,90 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+#include "mt7628an.dtsi"
+
+/ {
+ chosen {
+ bootargs = "console=ttyS0,115200";
+ };
+
+ memory@0 {
+ device_type = "memory";
+ reg = <0x0 0x4000000>;
+ };
+};
+
+&spi0 {
+ status = "okay";
+
+ flash@0 {
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency = <10000000>;
+ m25p,chunked-io = <32>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "factory-uboot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "boot";
+ reg = <0x30000 0x20000>;
+ read-only;
+ };
+
+ partition@50000 {
+ compatible = "tplink,firmware";
+ label = "firmware";
+ reg = <0x50000 0x770000>;
+ };
+
+ partition@7c0000 {
+ label = "config";
+ reg = <0x7c0000 0x10000>;
+ read-only;
+ };
+
+ rom: partition@7d0000 {
+ label = "rom";
+ reg = <0x7d0000 0x10000>;
+ read-only;
+ };
+
+ partition@7e0000 {
+ label = "romfile";
+ reg = <0x7e0000 0x10000>;
+ };
+
+ radio: partition@7f0000 {
+ label = "radio";
+ reg = <0x7f0000 0x10000>;
+ read-only;
+ };
+ };
+ };
+};
+
+&ehci {
+ status = "disabled";
+};
+
+&ohci {
+ status = "disabled";
+};
+
+&wmac {
+ status = "okay";
+ mtd-mac-address = <&rom 0xf100>;
+ mediatek,mtd-eeprom = <&radio 0x0>;
+};
+
+&ethernet {
+ mtd-mac-address = <&rom 0xf100>;
+ mediatek,portmap = "llllw";
+};
diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk
index 21c5357a089fdd0675afa6f131ff5b34a9a8f54d..34bd662f3a9490bdb0fd125af5ffa8a0f77c5f16 100644
--- a/target/linux/ramips/image/mt76x8.mk
+++ b/target/linux/ramips/image/mt76x8.mk
@@ -182,6 +182,20 @@ define Device/tplink_c50-v3
endef
TARGET_DEVICES += tplink_c50-v3
+define Device/tplink_c50-v4
+ $(Device/tplink)
+ DTS := ArcherC50V4
+ IMAGE_SIZE := 7616k
+ DEVICE_TITLE := TP-Link ArcherC50 v4
+ TPLINK_FLASHLAYOUT := 8MSUmtk
+ TPLINK_HWID := 0x001D589B
+ TPLINK_HWREV := 0x93
+ TPLINK_HWREVADD := 0x2
+ TPLINK_HVERSION := 3
+ IMAGES := sysupgrade.bin
+endef
+TARGET_DEVICES += tplink_c50-v4
+
define Device/tplink_tl-mr3420-v5
$(Device/tplink)
DTS := TL-MR3420V5