mirror of https://github.com/aredn/aredn.git
Update AREDN to OpenWRT 22.3.2 (Major Upgrade) (#574)
* Update to Openwrt 21.02 and add support for the CPE710 v1 Update scripts to change references to ifname to device due to a change in Openwrt naming reverse-wpad-basic-wolfssl and disable SSL on Curl NOTE: The compile host must have python3-distutils installed for gpsd to build * aredn: initial working upgrade to openwrt 21.02.1 * aredn: update 1 to working upgrade to openwrt 21.02.1 * aredn: add cpe710v1 to build config * Andrew's patches * Remove duplicates + display perl * Temp disable wifi extension patch * ifname/ports support * Add spectrum patch back in * Generic function to extra interfaces * New api to get wifi ifname * Disables jails * Style link * aredn: partial upgrade to openwrt 22.0.3.0 added AC device images and partial migration to 22.0.3.0 firewall upgrade pending * aredn: update mesh-release and revert config.mk * Unused * NFT firewall rewrite * Common-isze configs * Fix network layout for hap2 * Use local packages dev (new firewall rules) * Add HAP2 * Add pause after network restart to let bridge reinitialize * Various lua fixes for new lua version * Tweak config * Re-fix networking (lost patch change) * Add new radio names * Tolerate missing wifi * Fix hap-lite switch setup * More devices * New radio id * Build Rocket 5AC lite * Remove need for luci.sys * Remove need for luci.sys * Explicitly name wlan interfaces * Handle different compatibility verisoning * Update networking for switches * ipref version bump * Extra flag for curl * Better compat_version fix * Remove wolfssl * Fix dns server * Fix device name * Unused * Remove things we dont need * Remove unused packages * Generic macaddr overrides * Fix uci commit * Fix luci.template.parser to avoid luci.http loading the real thing * Rocket-M build * Add search-domain dhcp option * Turn of ipv6 * No IPV6 in dnsmasq * Override mac addresses if devices all the same * Working from master (for now) * Put back hostap * Disable old ethmac fixup * Tweak configs * Move back to v22.03.2 Leave ipq4019 builds to master * Need IPV6 to compile nft firewall * Rocket-M fixes * Before we start * WIP * Working snapshot * Cleaned patches * Merged patch * Single patch to support HAP2 * Fix typo * Add nanostation-m * 5/10Mhz patch * 5+10MHz patch for ath10k-ct driver * Extend 2Ghz channel check to include -4 to -1 * Add chanbw setup for ath10k (like ath9k) * Added TP-Link CPE710 v1 * Override firmwares * Missing patch * Dropbear config like 3.22.8.0 * Add Ubiquiti Rocket 5AC Lite * Fix c6 * Update * Need more scan channels * Remove IPV6 * Improve mac fixups * Put back missing nft app * IPv6 removed so dont have to disable it * Fix rocket-m flash bug * Fix nanostation-m * Nanobridge is tiny * Fix wifi order for ar750 * Rocket M5 XW support * New rates * Fix firewall4 so we don't need IPv6 * Allow channel width to be restricted * Move channel list into library * Fix naming * Mechanism to block specific channels on specific radios * Refresh buttons * routerboard-sxt-5nd * CPE605 v1.0 * Improve rocket m xw * tpink * Update patch * Update to remove disable * Remove BW restrictions on cpe710 * Restrict to what has been tested * Remove test BW restrictions * sxtsq-5-ac * Update * Update * powerbeam-m5-300 support * Fix * Fix hap2 * Tidy unused patches * Remove limit * Add ubnt_bullet-m-ar7241 * Added ubnt_nanobeam-ac-gen2 * Fix typo * Tolerate missing dtd ip * Explicitly gix hap2 mac addresses * Fix some broken patches * Hap2 wont work at 5MHz * Ubiquiti LiteBeam 5AC Gen2 * Fix compat_version for sxt 5ac * Update patch * Unused * Fix lan configuration for some devices * Rolling average of noise level * Unused * Split out the ath10k rssi monitor (its very simple at the moment) * Ignore .DS_Store * Reboot if ethernet doesnt come up (but only once!) * reboot returns - add exit * Add some logging info * Fix ] * Check all possibly ethernet bridges * Improve mac fixing * Remove HostAP on small memory devices * Reduce dropbear footprint * Add setsid * Kill hostap when upgrading to save memory * Different way to detect hostapd unavailable * New build steps * Improve manager logging * Fix name conflict for the two monitors * Try to improve test mesh name resolve problem * Migrate tiny to generic (tiny doesnt work properly) * Typo * Another attempt to fix macs for Mikrotik * Protect against missing trackers * Fix wpad for ipq40xx * Remove old tunnel check code * Enable ZRAM swap to aid low memory devices * ath10k noise can something be out of range - protect against that * Updated with current devices and status * Update firmware which has been tested * Updated with more builds * More binary/README * Fix css error * Start noise at sensible base level * Unfix the css so it looks how it use to. * Save as much memory as we can on lowmem nodes * Hide some options on low memory devices * Add "eol" to 32MB devices * Restart network rather than reboot node if it seems to be broken * Fixes * Revert network reset * Fix ar750 networking * Continue to trim tiny configs * More devices * Dump IW output messages * Fix Rocket 5AC intermittent ethernet issue * Ethernet fix for PowerBeam 5AC 500 * More tiny size reduction * More support data * Fixed POE and USB power features * Add Ubiquiti NanoBeam AC (gen1) * NanoStation (not NanoBeam) * Add mii-tool package * Device updates * Bump update time to 5 minutes * Fix ethernet negotiation for rocker-5ac and nanobeam * Fix iplookup * Config changes based on call feedback * Radio listing fixes * Update with more untested builds * Fallback TxMbps extracted from iw station dump * Fix tunnel detection for low memory nodes * Remove unused feed packages * snapshot build * Update stability info * Add powerbeam-5ac-500 * Typo * Add missing 3.22.1.0 * Add MikroTik LHG 5 AC * Fix permissions * Fix permissions * AirGrid's take Bullet builds * Mikrotik AC3 * Improve supportdata structure a little to make it easier to find things * Restore WAN VLAN overrides * Fix vlan regex for hap2 and hap3 * Support old and new style poe controls * hap-ac3 is version 1.1 * Handle typo in some openwrt config files * Fix HAP AC3 install * Update hap ac3 status * Support user overrides for network ports (non-swconfig devices) * LHG 5AC support * Remove -nand * Remove non-working platform.sh change * tunnel weight override * Omit LinkQualityMult when value is 1 * Add mANTBox 19s and 15s * Support ath79 mikrotik devices which require ath10k in the initramfs Co-authored-by: apcameron <apcameron@softhome.net> Co-authored-by: Joe AE6XE <ae6xe@arrl.net> Co-authored-by: Joe Ayers <joe@arrl.net>
This commit is contained in:
parent
74810d01b4
commit
6950479bf1
|
@ -21,16 +21,28 @@ jobs:
|
||||||
echo "${TARGET_DIR}"
|
echo "${TARGET_DIR}"
|
||||||
- run:
|
- run:
|
||||||
name: Build
|
name: Build
|
||||||
command: make
|
command: make MAINTARGET=ath79 SUBTARGET=generic
|
||||||
no_output_timeout: 2h
|
no_output_timeout: 2h
|
||||||
- run:
|
- run:
|
||||||
name: Build
|
name: Build
|
||||||
command: make SUBTARGET=mikrotik
|
command: make MAINTARGET=ath79 SUBTARGET=tiny
|
||||||
no_output_timeout: 1h
|
no_output_timeout: 1h
|
||||||
- run:
|
- run:
|
||||||
name: Build
|
name: Build
|
||||||
command: make MAINTARGET=ath79
|
command: make MAINTARGET=ath79 SUBTARGET=mikrotik
|
||||||
no_output_timeout: 1h
|
no_output_timeout: 1h
|
||||||
|
- run:
|
||||||
|
name: Build
|
||||||
|
command: make MAINTARGET=ath79 SUBTARGET=mikrotik ALTTARGET=ath10k
|
||||||
|
no_output_timeout: 1h
|
||||||
|
- run:
|
||||||
|
name: Build
|
||||||
|
command: make MAINTARGET=ath79 SUBTARGET=nand
|
||||||
|
no_output_timeout: 1h
|
||||||
|
- run:
|
||||||
|
name: Build
|
||||||
|
command: make MAINTARGET=ipq40xx SUBTARGET=mikrotik
|
||||||
|
no_output_timeout: 2h
|
||||||
- run:
|
- run:
|
||||||
name: Compress build files
|
name: Compress build files
|
||||||
command: tar -cjf ~/${CIRCLE_BRANCH}_${ARTIFACTS_FILE} -C ${MY_WORKING_DIRECTORY}/${ARTIFACTS_DIR} .
|
command: tar -cjf ~/${CIRCLE_BRANCH}_${ARTIFACTS_FILE} -C ${MY_WORKING_DIRECTORY}/${ARTIFACTS_DIR} .
|
||||||
|
|
|
@ -5,4 +5,8 @@
|
||||||
# Files created during make
|
# Files created during make
|
||||||
.stamp*
|
.stamp*
|
||||||
firmware
|
firmware
|
||||||
openwrt/
|
openwrt/
|
||||||
|
|
||||||
|
# Other
|
||||||
|
.DS_Store
|
||||||
|
._.DS_Store
|
||||||
|
|
33
Makefile
33
Makefile
|
@ -4,6 +4,7 @@ include openwrt.mk
|
||||||
# get main- and subtarget name from TARGET
|
# get main- and subtarget name from TARGET
|
||||||
MAINTARGET=$(word 1, $(subst -, ,$(TARGET)))
|
MAINTARGET=$(word 1, $(subst -, ,$(TARGET)))
|
||||||
SUBTARGET=$(word 2, $(subst -, ,$(TARGET)))
|
SUBTARGET=$(word 2, $(subst -, ,$(TARGET)))
|
||||||
|
ALTTARGET=$(word 3, $(subst -, ,$(TARGET)))
|
||||||
|
|
||||||
GIT_BRANCH=$(shell git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
|
GIT_BRANCH=$(shell git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
|
||||||
GIT_COMMIT=$(shell git rev-parse --short HEAD)
|
GIT_COMMIT=$(shell git rev-parse --short HEAD)
|
||||||
|
@ -11,7 +12,7 @@ GIT_COMMIT=$(shell git rev-parse --short HEAD)
|
||||||
# set dir and file names
|
# set dir and file names
|
||||||
TOP_DIR=$(shell pwd)
|
TOP_DIR=$(shell pwd)
|
||||||
OPENWRT_DIR=$(TOP_DIR)/openwrt
|
OPENWRT_DIR=$(TOP_DIR)/openwrt
|
||||||
TARGET_CONFIG=$(TOP_DIR)/configs/common.config $(TOP_DIR)/configs/$(MAINTARGET)-$(SUBTARGET).config
|
TARGET_CONFIG=$(TOP_DIR)/configs/common.config $(TOP_DIR)/configs/$(MAINTARGET)-$(SUBTARGET)$(patsubst %,-%,$(ALTTARGET)).config
|
||||||
UMASK=umask 022
|
UMASK=umask 022
|
||||||
|
|
||||||
# set variables based on private or CircleCI build
|
# set variables based on private or CircleCI build
|
||||||
|
@ -57,6 +58,7 @@ openwrt-clean: stamp-clean-openwrt-cleaned .stamp-openwrt-cleaned
|
||||||
ln -sf $(TOP_DIR)/patches $(OPENWRT_DIR)/
|
ln -sf $(TOP_DIR)/patches $(OPENWRT_DIR)/
|
||||||
ln -sf $(TOP_DIR)/files $(OPENWRT_DIR)/
|
ln -sf $(TOP_DIR)/files $(OPENWRT_DIR)/
|
||||||
sed -i "s/^.*freifunk.*$$//" $(OPENWRT_DIR)/feeds.conf.default
|
sed -i "s/^.*freifunk.*$$//" $(OPENWRT_DIR)/feeds.conf.default
|
||||||
|
sed -i "s/luci.git$$/luci.git;openwrt-22.03/" $(OPENWRT_DIR)/feeds.conf.default
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
# update openwrt and checkout specified commit
|
# update openwrt and checkout specified commit
|
||||||
|
@ -76,6 +78,7 @@ feeds-update: stamp-clean-feeds-updated .stamp-feeds-updated
|
||||||
.stamp-feeds-updated: $(OPENWRT_DIR)/feeds.conf
|
.stamp-feeds-updated: $(OPENWRT_DIR)/feeds.conf
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds uninstall -a
|
cd $(OPENWRT_DIR); ./scripts/feeds uninstall -a
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds update -a
|
cd $(OPENWRT_DIR); ./scripts/feeds update -a
|
||||||
|
cd $(OPENWRT_DIR); ./scripts/feeds install libpam
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install libcap
|
cd $(OPENWRT_DIR); ./scripts/feeds install libcap
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install jansson
|
cd $(OPENWRT_DIR); ./scripts/feeds install jansson
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install libidn2
|
cd $(OPENWRT_DIR); ./scripts/feeds install libidn2
|
||||||
|
@ -84,22 +87,21 @@ feeds-update: stamp-clean-feeds-updated .stamp-feeds-updated
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install libidn
|
cd $(OPENWRT_DIR); ./scripts/feeds install libidn
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install libopenldap
|
cd $(OPENWRT_DIR); ./scripts/feeds install libopenldap
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install libgnutls
|
cd $(OPENWRT_DIR); ./scripts/feeds install libgnutls
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install libpam
|
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install libnetsnmp
|
cd $(OPENWRT_DIR); ./scripts/feeds install libnetsnmp
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install -p arednpackages olsrd
|
cd $(OPENWRT_DIR); ./scripts/feeds install -p arednpackages olsrd
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install perl
|
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install -p arednpackages vtun
|
cd $(OPENWRT_DIR); ./scripts/feeds install -p arednpackages vtun
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install -a -p arednpackages
|
cd $(OPENWRT_DIR); ./scripts/feeds install -p arednpackages dd-wrt-ath10k-firmware
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install snmpd
|
cd $(OPENWRT_DIR); ./scripts/feeds install snmpd
|
||||||
|
cd $(OPENWRT_DIR); ./scripts/feeds install curl
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install ntpclient
|
cd $(OPENWRT_DIR); ./scripts/feeds install ntpclient
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install socat
|
cd $(OPENWRT_DIR); ./scripts/feeds install socat
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install xinetd
|
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install luci-base
|
cd $(OPENWRT_DIR); ./scripts/feeds install luci-base
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install luci-lib-nixio
|
cd $(OPENWRT_DIR); ./scripts/feeds install luci-lib-nixio
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install luci-lib-ip
|
cd $(OPENWRT_DIR); ./scripts/feeds install luci-lib-ip
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install luci-lib-jsonc
|
cd $(OPENWRT_DIR); ./scripts/feeds install luci-lib-jsonc
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install luaposix
|
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install luasocket
|
cd $(OPENWRT_DIR); ./scripts/feeds install luasocket
|
||||||
|
cd $(OPENWRT_DIR); ./scripts/feeds install iperf3
|
||||||
|
cd $(OPENWRT_DIR); ./scripts/feeds install mii-tool
|
||||||
cd $(OPENWRT_DIR); ./scripts/feeds install mmc-utils
|
cd $(OPENWRT_DIR); ./scripts/feeds install mmc-utils
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
|
@ -145,11 +147,26 @@ compile: stamp-clean-compiled .stamp-compiled
|
||||||
$(TOP_DIR)/scripts/tests-prebuild.sh
|
$(TOP_DIR)/scripts/tests-prebuild.sh
|
||||||
$(UMASK); \
|
$(UMASK); \
|
||||||
$(MAKE) -C $(OPENWRT_DIR) $(MAKE_ARGS)
|
$(MAKE) -C $(OPENWRT_DIR) $(MAKE_ARGS)
|
||||||
for FILE in `find $(TOP_DIR)/firmware/targets/ -path "*packages" -prune -o \( -type f -a \
|
for FILE in `find $(TOP_DIR)/firmware/targets/$(MAINTARGET)/$(SUBTARGET) -path "*packages" -prune -o \( -type f -a \
|
||||||
! \( -name "*factory.bin" -o -name "*sysupgrade.bin" -o -name "*initramfs.elf" -o \
|
! \( -name "*factory.bin" -o -name "*sysupgrade.bin" -o -name "*initramfs.elf" -o \
|
||||||
-name sha256sums -o -name "*.buildinfo" -o -name "*.json" \) \
|
-name "*kernel.bin" -o -name sha256sums -o -name "*.buildinfo" -o -name "*.json" \) \
|
||||||
-print \)`; do rm $$FILE; \
|
-print \)`; do rm $$FILE; \
|
||||||
done;
|
done;
|
||||||
|
for FILE in `find $(TOP_DIR)/firmware/targets/$(MAINTARGET)/$(SUBTARGET) -type f -a \
|
||||||
|
\( -name "*ath79-generic-*" \
|
||||||
|
-o -name "*ath79-tiny-*" \
|
||||||
|
-o -name "*ath79-mikrotik-*" \
|
||||||
|
-o -name "*ath79-nand-*" \
|
||||||
|
-o -name "*ipq40xx-mikrotik*squashfs*" \
|
||||||
|
\) -print`; do \
|
||||||
|
NEWNAME="$${FILE/generic-/}"; \
|
||||||
|
NEWNAME="$${NEWNAME/squashfs-/}"; \
|
||||||
|
NEWNAME="$${NEWNAME/-nand-glinet/}"; \
|
||||||
|
NEWNAME="$${NEWNAME/-nand/}"; \
|
||||||
|
NEWNAME="$${NEWNAME/-ath79-mikrotik/}"; \
|
||||||
|
NEWNAME="$${NEWNAME/_routerboard/}"; \
|
||||||
|
[ "$$FILE" = "$$NEWNAME" ] || mv "$$FILE" "$$NEWNAME"; \
|
||||||
|
done;
|
||||||
$(TOP_DIR)/scripts/tests-postbuild.sh
|
$(TOP_DIR)/scripts/tests-postbuild.sh
|
||||||
|
|
||||||
$(TOP_DIR)/firmware:
|
$(TOP_DIR)/firmware:
|
||||||
|
|
175
README.md
175
README.md
|
@ -19,7 +19,7 @@ to no pre-planning or IT expertise. A user can deploy a 'node' anywhere
|
||||||
to connect in and extend an AREDN network. Device hardware options exist to
|
to connect in and extend an AREDN network. Device hardware options exist to
|
||||||
provide sector coverage, build point-to-point links, and connect end
|
provide sector coverage, build point-to-point links, and connect end
|
||||||
point services to the network. High speed link rates are routinely achieved
|
point services to the network. High speed link rates are routinely achieved
|
||||||
over long distances, e.g. 60Mbps+ on 10MHz channels over 80km links.
|
over long distances, e.g. 60Mbps+ on 10MHz channels over 80km links.
|
||||||
|
|
||||||
For further information on obtaining an Amateur Radio Technician Class
|
For further information on obtaining an Amateur Radio Technician Class
|
||||||
license, please refer to http://www.arrl.org/getting-your-technician-license
|
license, please refer to http://www.arrl.org/getting-your-technician-license
|
||||||
|
@ -46,71 +46,98 @@ turned into a release.
|
||||||
Please refer to https://github.com/aredn/aredn/issues
|
Please refer to https://github.com/aredn/aredn/issues
|
||||||
for a list of outstanding defects.
|
for a list of outstanding defects.
|
||||||
|
|
||||||
|
|
||||||
### Images built
|
### Images built
|
||||||
|
|
||||||
Device | target | Image to Use | RAM | Stability
|
Device | Target | Image | RAM | Stability
|
||||||
------ | ------ | ------------ | --- | ---------
|
------ | ------ | ----- | --- | ---------
|
||||||
AirGrid XM | ar71xx | bullet-m | 32Mb | stable
|
AirGrid XM | ath79 | ubnt_bullet-m-ar7241 | 32MB | untested sunset
|
||||||
AirGrid XW | ar71xx | loco-m-xw | 32Mb | stable
|
AirGrid XW | ath79 | ubnt_bullet-m-xw | 32MB | untested sunset
|
||||||
AirRouter | ath79 | airrouter | 32Mb | stable
|
AirRouter | ath79 | ubnt_airrouter | 32MB | untested sunset
|
||||||
AirRouter HP | ath79 | airrouter | 32Mb | stable
|
AirRouter HP | ath79 | ubnt_airrouter | 32MB | untested sunset
|
||||||
Bullet M2Ti/M5/M5Ti | ar71xx | bullet-m | 32Mb | stable
|
Bullet M2Ti/M5/M5Ti | ath79 | - | 32MB | untested sunset
|
||||||
Bullet M2 | ath79 | bullet-m | 32Mb | stable
|
Bullet M2 | ath79 | ubnt_bullet-m-ar7241 | 32MB | stable sunset
|
||||||
Bullet M2 XW | ath79 | bullet-m-xw | 64Mb | stable
|
Bullet M2 XW | ath79 | ubnt_bullet-m-xw | 64MB | untested
|
||||||
LiteBeam M5 | ar71xx | lbe-m5 | 64Mb | stable
|
LiteBeam AC5 Gen2 | ath79 | ubnt_litebeam-ac-gen2 | 64MB | stable new
|
||||||
NanoBeam M2-13/M5-16/M5-19 | ar71xx | loco-m-xw | 32Mb | stable
|
LiteBeam M5 | ath79 | - | 64MB | untested
|
||||||
NanoBridge 2G18 | ar71xx | bullet-m | 32Mb | stable
|
NanoBeam AC 5 | ath79 | ubnt_nanobeam-ac | 64MB | untested new
|
||||||
NanoBridge 5G22/25 | ar71xx | bullet-m | 32Mb | stable
|
NanoBeam AC 5 Gen 2 | ath79 | ubnt_nanobeam-ac-gen2 | 128MB | stable new
|
||||||
NanoBridge M9 | ar71xx | bullet-m | 32Mb | stable
|
NanoBeam M2-13/M5-16/M5-19 | ath79 | - | 32MB | untested sunset
|
||||||
NanoStation Loco M2/M5/M9 XM | ar71xx | bullet-m | 32Mb | stable
|
NanoBridge 2G18 | ath79 | ubnt_nanobridge-m | 32MB | untested sunset
|
||||||
NanoStation Loco M2 XW | ar71xx | loco-m-xw | 64Mb | stable
|
NanoBridge 5G22/25 | ath79 | ubnt_nanobridge-m | 32MB | untested sunset
|
||||||
NanoStation Loco M5 XW with test date before ~Nov 2017| ar71xx | loco-m-xw | 64Mb | stable
|
NanoBridge M9 | ath79 | ubnt_nanobridge-m | 32MB | untested sunset
|
||||||
NanoStation Loco M5 XW with test date on or after ~Nov 2017 | ar71xx | rocket-m-xw | 64Mb | stable
|
NanoStation AC 5 | ath79 | ubnt_nanostation-ac | 64MB | untested new
|
||||||
NanoStation M2/M3/M5 XM | ath79 | nanostation-m | 32Mb | stable
|
NanoStation Loco M2/M5/M9 XM | ath79 | ubnt_nanostation-loco-m | 32MB | untested sunset
|
||||||
NanoStation M2/M5 XW | ath79 | nanostation-m-xw | 64Mb | stable
|
NanoStation Loco M2 XW | ath79 | ubnt_nanostation-loco-m-xw | 64MB | untested
|
||||||
PicoStation M2 | ar71xx | bullet-m | 32Mb | stable
|
NanoStation Loco M5 XW | ath79 | ubnt_nanostation-loco-m-xw | 64MB | stable
|
||||||
PowerBeam-M2-400 | ar71xx | loco-m-xw | 64Mb | stable
|
NanoStation M2/M3/M5 XM | ath79 | ubnt_nanostation-m | 32MB | stable sunset
|
||||||
PowerBeam-M5-300 | ar71xx | loco-m-xw | 64Mb | stable
|
NanoStation M2/M5 XW | ath79 | ubnt_nanostation-m-xw | 64MB | stable
|
||||||
PowerBeam-M5-400/400ISO/620 | ar71xx | rocket-m-xw | 64Mb | stable
|
PicoStation M2 | ath79 | ubnt_picostation-m | 32MB | untested sunset
|
||||||
PowerBridge | ar71xx | nano-m | 64Mb | stable
|
PowerBeam AC 5 500 | ath79 | ubnt_powerbeam-5ac-500 | 128MB | stable new
|
||||||
Rocket M9/M2/M3/M5/M5GPS XM | ath79 | rocket-m | 64Mb | stable
|
PowerBeam-M2-400 | ath79 | ubnt_powerbeam-m2-xw | 64MB | untested
|
||||||
Rocket M2/M5 XM with USB port | ar71xx | rocket-m | 64Mb | stable
|
PowerBeam-M5-300 | ath79 | ubnt_powerbeam-m5-300 | 64MB | stable
|
||||||
Rocket M2 XW | ar71xx | loco-m-xw | 64Mb | stable
|
PowerBeam-M5-400/400ISO/620 | ath79 | ubnt_powerbeam-m5-xw | 64MB | stable
|
||||||
Rocket M5 XW | ar71xx | rocket-m-xw | 64Mb | stable
|
PowerBridge | ath79 | ubnt_powerbridge-m | 64MB | untested
|
||||||
Rocket M2 Titanium TI | ar71xx | rocket-m-ti | 64Mb | unknown
|
Rocket AC Lite 5 | ath79 | ubnt_rocket-5ac-lite | 128MB | stable new
|
||||||
Rocket M2 Titanium XW | ar71xx | rocket-m-xw | 64Mb | unknown
|
Rocket M9/M2/M3/M5/M5GPS XM | ath79 | ubnt_rocket-m | 64MB | stable
|
||||||
Rocket M5 Titanium TI | ar71xx | rocket-m-ti | 64Mb | stable
|
Rocket M2/M5 XM with USB port | ath79 | ubnt_rocket-m | 64MB | untested
|
||||||
Rocket M5 Titanium XW | ar71xx | rocket-m-xw | 64Mb | stable
|
Rocket M2 XW | ath79 | ubnt_rocket-m-xw | 64MB | untested
|
||||||
TPLink CPE210 v1.0/v1.1 | ath79 | cpe210-v1 | 64Mb | stable
|
Rocket M5 XW | ath79 | ubnt_rocket-m-xw | 64MB | stable
|
||||||
TPLink CPE210 v2.0 | ath79 | cpe210-v2 | 64Mb | stable
|
Rocket M2 Titanium TI | ath79 | - | 64MB | untested
|
||||||
TPLink CPE210 v3.0 | ath79 | cpe210-v3 | 64Mb | stable
|
Rocket M2 Titanium XW | ath79 | ubnt_rocket-m-xw | 64MB | untested
|
||||||
TPLink CPE220 v2.0 | ath79 | cpe220-v2 | 64Mb | stable
|
Rocket M5 Titanium TI | ath79 | - | 64MB | untested
|
||||||
TPLink CPE220 v3.0 | ath79 | cpe220-v3 | 64Mb | stable
|
Rocket M5 Titanium XW | ath79 | ubnt_rocket-m-xw | 64MB | stable
|
||||||
TPLink CPE510 v1.0/v1.1 | ath79 | cpe510-v1 | 64Mb | stable
|
TPLink CPE210 v1.X | ath79 | tplink_cpe210-v1 | 64MB | stable
|
||||||
TPLink CPE510 v2.0 | ath79 | cpe510-v2 | 64Mb | stable
|
TPLink CPE210 v2.0 | ath79 | tplink_cpe210-v2 | 64MB | stable
|
||||||
TPLink CPE510 v3.0 | ath79 | cpe510-v3 | 64Mb | stable
|
TPLink CPE210 v3.0 | ath79 | tplink_cpe210-v3 | 64MB | untested
|
||||||
TPLink CPE610 v1.0 | ath79 | cpe610-v1 | 64Mb | stable
|
TPLink CPE220 v2.0 | ath79 | tplink_cpe220-v2 | 64MB | untested
|
||||||
TPLink CPE610 v2.0 | ath79 | cpe610-v2 | 64Mb | stable
|
TPLink CPE220 v3.0 | ath79 | tplink_cpe220-v3 | 64MB | untested
|
||||||
TPLink WBS210 v1.0 | ath79 | wbs210-v1 | 64mb | stable
|
TPLink CPE510 v1.X | ath79 | tplink_cpe510-v1 | 64MB | untested
|
||||||
TPLink WBS210 v2.0 | ath79 | wbs210-v2 | 64mb | stable
|
TPLink CPE510 v2.0 | ath79 | tplink_cpe510-v2 | 64MB | stable
|
||||||
TPLink WBS510 v1.0 | ath79 | wbs510-v1 | 64mb | stable
|
TPLink CPE510 v3.0 | ath79 | tplink_cpe510-v3 | 64MB | stable
|
||||||
TPLink WBS510 v2.0 | ath79 | wbs510-v2 | 64mb | stable
|
TPLink CPE605 v1.0 | ath79 | tplink_cpe605-v1 | 64MB | untested
|
||||||
Mikrotik Basebox RB912UAG-5HPnD/2HPnD | ar71xx | mikrotik-nand-large | 64Mb | stable
|
TPLink CPE610 v1.0 | ath79 | tplink_cpe610-v1 | 64MB | untested
|
||||||
Mikrotik hAP ac lite 952Ui-5ac2nD | ar71xx | mikrotik-rb-nor-flash-16M-ac | 64Mb | stable
|
TPLink CPE610 v2.0 | ath79 | tplink_cpe610-v2 | 64MB | untested
|
||||||
Mikrotik RBLHG-2nD/5nD | ar71xx | mikrotik-rb-nor-flash-16M | 64Mb | stable
|
TPLink CPE710 v1.0 | ath79 | tplink_cpe710-v1 | 128MB | stable new
|
||||||
Mikrotik RBLHG-5HPnD | ar71xx | mikrotik-rb-nor-flash-16M | 64Mb | stable
|
TPLink WBS210 v1.0 | ath79 | tplink_wbs210-v1 | 64MB | untested
|
||||||
Mikrotik RBLHG-2nD-XL/5HPnD-XL | ar71xx | mikrotik-rb-nor-flash-16M | 64Mb | stable
|
TPLink WBS210 v2.0 | ath79 | tplink_wbs210-v2 | 64MB | untested
|
||||||
Mikrotik RBLDF-2nD/5nD | ar71xx | mikrotik-rb-nor-flash-16M | 64Mb | stable
|
TPLink WBS510 v1.0 | ath79 | tplink_wbs510-v1 | 64MB | untested
|
||||||
Mikrotik QRT5 RB911G-5HPnD-QRT | ar71xx | mikrotik-nand-large | 64Mb | stable
|
TPLink WBS510 v2.0 | ath79 | tplink_wbs510-v2 | 64MB | untested
|
||||||
Mikrotik mAntbox RB911G-2HPnD/5HPnD | ar71xx | mikrotik-nand-large | 64Mb | stable
|
Mikrotik Basebox RB912UAG-2HPnD | ath79 | mikrotik_routerboard-912uag-2hpnd | 64MB | untested
|
||||||
Mikrotik SXTsq 5HPnD/5nD/2nD | ar71xx | mikrotik-rb-nor-flash-16M | 64Mb | stable
|
Mikrotik Basebox RB912UAG-5HPnD | ath79 | - | 64MB | untested
|
||||||
GL.iNet GL-AR150 | ath79 | gl-ar150 | 64Mb | stable
|
Mikrotik hAP ac lite 952Ui-5ac2nD | ath79 | mikrotik_routerboard-952ui-5ac2nd | 64MB | stable
|
||||||
GL.iNet GL-USB150 | ar71xx | gl-usb150 | 64Mb | stable
|
Mikrotik RBLHG-2nD(-XL) | ath79 | mikrotik_routerboard-lhg-2nd | 64MB | stable
|
||||||
GL.iNet GL-AR300M16 | ar71xx | gl-ar300m | 64Mb | stable
|
Mikrotik RBLHG-5nD | ath79 | mikrotik_routerboard-lhg-5nd | 64MB | stable
|
||||||
GL.iNet GL-AR300M w/ 128Mb NAND | None | None | 64Mb | Not compatible
|
Mikrotik RBLHG-5HPnD(-XL) | ath79 | mikrotik_routerboard-lhg-5nd | 64MB | stable
|
||||||
GL.iNet GL-AR750 | ar71xx | gl-ar750 | 128Mb | stable
|
MikroTik RBLHGG-5acD(-XL) | ipq40xx | mikrotik_lhgg-5acd | 256MB | stable new
|
||||||
Meraki MR-16 | ar71xx | mr16 | 64mb | stable
|
Mikrotik RBLDF-2nD | ath79 | - | 64MB | untested
|
||||||
|
Mikrotik RBLDF-5nD | ath79 | - | 64MB | untested
|
||||||
|
Mikrotik QRT5 RB911G-5HPnD-QRT | ath79 | - | 64MB | untested
|
||||||
|
Mikrotik mANTBox RB911G-2HPnD | ath79 | - | 64MB | untested
|
||||||
|
Mikrotik mANTBox RB911G-5HPnD | ath79 | - | 64MB | untested
|
||||||
|
Mikrotik mANTBox RB912UAG-2HPnD | ath79 | mikrotik_routerboard-912uag-2hpnd | 128MB | untested
|
||||||
|
Mikrotik mANTBox RB912UAG-5HPnD | ath79 | - | 128MB | untested
|
||||||
|
Mikrotik mANTBox RB921GS-5HPacD 15s | ath79 | mikrotik_routerboard-921gs-5hpacd-15s | 128MB | stable new
|
||||||
|
Mikrotik mANTBox RB921GS-5HPacD 19s | ath79 | mikrotik_routerboard-921gs-5hpacd-19s | 128MB | stable new
|
||||||
|
Mikrotik SXTsq 5HPnD | ath79 | mikrotik_routerboard-sxt-5nd | 64MB | stable
|
||||||
|
Mikrotik SXTsq 5nD | ath79 | mikrotik_routerboard-sxt-5nd | 64MB | stable
|
||||||
|
Mikrotik SXTsq 2nD | ath79 | - | 64MB | untested
|
||||||
|
MikroTik RouterBOARD D52G-5HacD2HnD | ipq40xx | mikrotik_hap-ac2 | 128MB | stable new
|
||||||
|
MikroTik RouterBOARD D53iG-5HacD2HnD | ipq40xx | mikrotik_hap-ac3 | 256MB | stable new
|
||||||
|
MikroTik RouterBOARD SXTsqG-5acD | ipq40xx | mikrotik_sxtsq-5-ac | 256MB | stable new
|
||||||
|
GL.iNet GL-AR150 | ath79 | glinet_gl-ar150 | 64MB | stable
|
||||||
|
GL.iNet GL-USB150 | ath79 | glinet_gl-usb150 | 64MB | stable
|
||||||
|
GL.iNet GL-AR300M16 | ath79 | glinet_gl-ar300m | 64MB | stable
|
||||||
|
GL.iNet GL-AR300M w/ 128MB NAND | ath79 | - | 64MB | untested
|
||||||
|
GL.iNet GL-AR750 | ath79 | glinet_gl-ar750 | 128MB | stable
|
||||||
|
Meraki MR-16 | ath79 | - | 64MB | brick
|
||||||
|
|
||||||
|
#### Stability
|
||||||
|
|
||||||
|
* *brick* - this image has been tested and will currently brick your hardware. Avoid for now.
|
||||||
|
* *untested* - this image has not been tested on hardware. It may or may not work.
|
||||||
|
* *stable* - this image has been tested on hardware. There may still be bugs.
|
||||||
|
* *sunset* - this device has been sunsetted and support will be deprecated at some point.
|
||||||
|
* *new* - this device is newly supported.
|
||||||
|
|
||||||
The 'target' is a directory to find the image on at http://downloads.arednmesh.org
|
The 'target' is a directory to find the image on at http://downloads.arednmesh.org
|
||||||
|
|
||||||
|
@ -191,7 +218,7 @@ docker run -it --name builder arednmesh/builder
|
||||||
|
|
||||||
To pull an image (or any other file) out of the docker container:
|
To pull an image (or any other file) out of the docker container:
|
||||||
```
|
```
|
||||||
docker cp builder:/opt/aredn/aredn/firmware/targets/ar71xx/generic/<image>.bin <local directory>
|
docker cp builder:/opt/aredn/aredn/firmware/targets/ath79/generic/<image>.bin <local directory>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Build Prerequisites
|
### Build Prerequisites
|
||||||
|
@ -229,9 +256,9 @@ bash
|
||||||
git clone https://github.com/aredn/aredn.git
|
git clone https://github.com/aredn/aredn.git
|
||||||
cd aredn
|
cd aredn
|
||||||
vi config.mk # enter your callsign, etc.
|
vi config.mk # enter your callsign, etc.
|
||||||
# build default legacy ar71xx target ubnt and tplink images
|
# build default legacy ath79 target ubnt and tplink images
|
||||||
make
|
make
|
||||||
# build and add legacy ar71xx target mikrotik images
|
# build and add legacy ath79 target mikrotik images
|
||||||
make SUBTARGET=mikrotik
|
make SUBTARGET=mikrotik
|
||||||
# build and add ath79 target (latest linux kernel) ubnt, tplink, and gl images
|
# build and add ath79 target (latest linux kernel) ubnt, tplink, and gl images
|
||||||
make MAINTARGET=ath79
|
make MAINTARGET=ath79
|
||||||
|
@ -239,7 +266,7 @@ make MAINTARGET=ath79
|
||||||
|
|
||||||
Building the images may take minutes or hours depending on the machine.
|
Building the images may take minutes or hours depending on the machine.
|
||||||
For more details see [build options](https://openwrt.org/docs/guide-developer/build-system/use-buildsystem).
|
For more details see [build options](https://openwrt.org/docs/guide-developer/build-system/use-buildsystem).
|
||||||
Review the build options in config.mk: `-j <number of cores + 1>`.
|
Review the build options in config.mk: `-j <nuMBer of cores + 1>`.
|
||||||
`V=s` will give more verbose error messages.
|
`V=s` will give more verbose error messages.
|
||||||
|
|
||||||
An internet connection is required during the build process. A good internet
|
An internet connection is required during the build process. A good internet
|
||||||
|
@ -252,6 +279,12 @@ You need approximately 10GB of space for the build.
|
||||||
Prior AREDN images can be rebuilt. Replace one of the following after
|
Prior AREDN images can be rebuilt. Replace one of the following after
|
||||||
the "cd aredn" command above:
|
the "cd aredn" command above:
|
||||||
|
|
||||||
|
AREDN release 3.22.12.0
|
||||||
|
|
||||||
|
```
|
||||||
|
git checkout 3.22.12.0
|
||||||
|
```
|
||||||
|
|
||||||
AREDN release 3.22.8.0
|
AREDN release 3.22.8.0
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -264,6 +297,12 @@ AREDN release 3.22.6.0
|
||||||
git checkout 3.22.6.0
|
git checkout 3.22.6.0
|
||||||
```
|
```
|
||||||
|
|
||||||
|
AREDN release 3.22.1.0
|
||||||
|
|
||||||
|
```
|
||||||
|
git checkout 3.22.1.0
|
||||||
|
```
|
||||||
|
|
||||||
AREDN release 3.21.4.0
|
AREDN release 3.21.4.0
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -12,8 +12,8 @@ MAKE_ARGS=-j3
|
||||||
# Where will the installed image find add-on Packages to download?
|
# Where will the installed image find add-on Packages to download?
|
||||||
# This URL must contain the packages from this build
|
# This URL must contain the packages from this build
|
||||||
# downloading packages within the AREDN UI uses signatures
|
# downloading packages within the AREDN UI uses signatures
|
||||||
PRIVATE_BUILD_PACKAGES=http://downloads.arednmesh.org/releases/3/22/3.22.12.0
|
PRIVATE_BUILD_PACKAGES=http://downloads.arednmesh.org/snapshots
|
||||||
|
|
||||||
# These options are for more complex changes
|
# These options are for more complex changes
|
||||||
SHELL:=$(shell which bash)
|
SHELL:=$(shell which bash)
|
||||||
TARGET=ar71xx-generic
|
TARGET=ath79-generic
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
How to update AREDN config files
|
||||||
|
|
||||||
|
1) do (or start) an AREDN build, e.g. "make MAINTARGET=ipq40xx SUBTARGET=mikrotik"
|
||||||
|
2) from ./openwrt directory, "make menuconfig"
|
||||||
|
3) update config options via the menu and save
|
||||||
|
4) capture the updated config, from ./openwrt directory, e.g.:
|
||||||
|
"./scripts/diffconfig.sh > ../configs/ipq40xx-mikrotik.config"
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
1) adding the same option to every MAINTARGET-SUBTARGET.config file is
|
||||||
|
done one at a time.
|
||||||
|
2) It can be very difficult to manually determine compatible dependencies
|
||||||
|
of config options.
|
||||||
|
3) Not recommended to manually update the MAINTARGET-SUBTARGET.config
|
||||||
|
file. If you do, append the setting at the end (will take
|
||||||
|
precendent).
|
|
@ -1,21 +0,0 @@
|
||||||
CONFIG_TARGET_ar71xx=y
|
|
||||||
CONFIG_TARGET_ar71xx_generic=y
|
|
||||||
CONFIG_TARGET_MULTI_PROFILE=y
|
|
||||||
CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_ubnt-bullet-m=y
|
|
||||||
CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_ubnt-loco-m-xw=y
|
|
||||||
CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_ubnt-nano-m=y
|
|
||||||
CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_ubnt-rocket-m-ti=y
|
|
||||||
CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_ubnt-rocket-m-xw=y
|
|
||||||
CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_ubnt-rocket-m=y
|
|
||||||
CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_ubnt-lbe-m5=y
|
|
||||||
CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_gl-ar300m=y
|
|
||||||
CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_gl-usb150=y
|
|
||||||
CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_gl-ar750=y
|
|
||||||
CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_mr16=y
|
|
||||||
CONFIG_HAS_SUBTARGETS=y
|
|
||||||
CONFIG_HAS_DEVICES=y
|
|
||||||
CONFIG_TARGET_BOARD="ar71xx"
|
|
||||||
CONFIG_TARGET_SUBTARGET="generic"
|
|
||||||
CONFIG_TARGET_ARCH_PACKAGES="mips_24kc"
|
|
||||||
CONFIG_DEFAULT_TARGET_OPTIMIZATION="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc"
|
|
||||||
CONFIG_CPU_TYPE="24kc"
|
|
|
@ -1,14 +0,0 @@
|
||||||
CONFIG_TARGET_ar71xx=y
|
|
||||||
CONFIG_TARGET_ar71xx_mikrotik=y
|
|
||||||
CONFIG_TARGET_MULTI_PROFILE=y
|
|
||||||
CONFIG_TARGET_SUBTARGET=mikrotik
|
|
||||||
CONFIG_TARGET_DEVICE_ar71xx_mikrotik_DEVICE_nand-large=y
|
|
||||||
CONFIG_TARGET_DEVICE_ar71xx_mikrotik_DEVICE_rb-nor-flash-16M-ac=y
|
|
||||||
CONFIG_TARGET_DEVICE_ar71xx_mikrotik_DEVICE_rb-nor-flash-16M=y
|
|
||||||
CONFIG_DEFAULT_ath10k-firmware-qca9887=y
|
|
||||||
CONFIG_DEFAULT_ath10k-firmware-qca988x=y
|
|
||||||
CONFIG_DEFAULT_kmod-ath10k=y
|
|
||||||
CONFIG_DEFAULT_kmod-ledtrig-gpio=y
|
|
||||||
CONFIG_DEFault_kmod-usb-ehci=y
|
|
||||||
CONFIG_DEFAULT_rssileds=y
|
|
||||||
CONFIG_PACKAGE_rbcfg=y
|
|
|
@ -1,32 +1,41 @@
|
||||||
CONFIG_TARGET_ath79=y
|
CONFIG_TARGET_ath79=y
|
||||||
CONFIG_TARGET_ath79_generic=y
|
CONFIG_TARGET_ath79_generic=y
|
||||||
CONFIG_TARGET_MULTI_PROFILE=y
|
|
||||||
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_glinet_gl-ar150=y
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_glinet_gl-ar150=y
|
||||||
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_wbs210-v1=y
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_glinet_gl-ar300m16=y
|
||||||
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_wbs210-v2=y
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_glinet_gl-ar750=y
|
||||||
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_wbs510-v1=y
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_glinet_gl-usb150=y
|
||||||
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_wbs510-v2=y
|
|
||||||
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe510-v1=y
|
|
||||||
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe510-v2=y
|
|
||||||
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe510-v3=y
|
|
||||||
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe610-v1=y
|
|
||||||
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe610-v2=y
|
|
||||||
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe210-v1=y
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe210-v1=y
|
||||||
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe210-v2=y
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe210-v2=y
|
||||||
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe210-v3=y
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe210-v3=y
|
||||||
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe220-v2=y
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe220-v2=y
|
||||||
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe220-v3=y
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe220-v3=y
|
||||||
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_airrouter=y
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe510-v1=y
|
||||||
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_bullet-m=y
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe510-v2=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe510-v3=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe605-v1=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe610-v1=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe610-v2=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_cpe710-v1=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_wbs210-v1=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_wbs210-v2=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_wbs510-v1=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_tplink_wbs510-v2=y
|
||||||
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_bullet-m-xw=y
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_bullet-m-xw=y
|
||||||
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_nanostation-m=y
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_bullet-ac=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_bullet-m-xw=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_litebeam-ac-gen2=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_nanobeam-ac-gen2=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_nanobeam-ac=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_nanobeam-m5-xw=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_nanostation-ac=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_nanostation-loco-m-xw=y
|
||||||
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_nanostation-m-xw=y
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_nanostation-m-xw=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_powerbeam-m5-300=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_powerbeam-m2-xw=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_powerbeam-m5-xw=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_powerbeam-5ac-500=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_powerbeam-5ac-gen2=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_powerbridge-m=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_rocket-5ac-lite=y
|
||||||
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_rocket-m=y
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_rocket-m=y
|
||||||
CONFIG_HAS_SUBTARGETS=y
|
CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_rocket-m-xw=y
|
||||||
CONFIG_HAS_DEVICES=y
|
|
||||||
CONFIG_TARGET_BOARD="ath79"
|
|
||||||
CONFIG_TARGET_SUBTARGET="generic"
|
|
||||||
CONFIG_TARGET_ARCH_PACKAGES="mips_24kc"
|
|
||||||
CONFIG_DEFAULT_TARGET_OPTIMIZATION="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc"
|
|
||||||
CONFIG_CPU_TYPE="24kc"
|
|
||||||
CONFIG_PACKAGE_sysfsutils=m
|
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
CONFIG_TARGET_ath79=y
|
||||||
|
CONFIG_TARGET_ath79_mikrotik=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_mikrotik_DEVICE_mikrotik_routerboard-921gs-5hpacd-15s=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_mikrotik_DEVICE_mikrotik_routerboard-921gs-5hpacd-19s=y
|
||||||
|
#
|
||||||
|
# DEVICE_PACKAGES are not included in the initramfs, but for these devices we need
|
||||||
|
# extra packages pre-installed to successfully install sysupgrade.
|
||||||
|
#
|
||||||
|
CONFIG_PACKAGE_ath10k-board-qca988x=y
|
||||||
|
CONFIG_PACKAGE_ath10k-firmware-qca988x-ct=y
|
||||||
|
CONFIG_PACKAGE_kmod-ath10k-ct=y
|
||||||
|
CONFIG_PACKAGE_nand-utils=y
|
|
@ -0,0 +1,8 @@
|
||||||
|
CONFIG_TARGET_ath79=y
|
||||||
|
CONFIG_TARGET_ath79_mikrotik=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_mikrotik_DEVICE_mikrotik_routerboard-912uag-2hpnd=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_mikrotik_DEVICE_mikrotik_routerboard-952ui-5ac2nd=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_mikrotik_DEVICE_mikrotik_routerboard-lhg-2nd=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_mikrotik_DEVICE_mikrotik_routerboard-lhg-5nd=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_mikrotik_DEVICE_mikrotik_routerboard-sxt-5nd=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_mikrotik_DEVICE_mikrotik_routerboard-sxt-5nd-r2=y
|
|
@ -0,0 +1,7 @@
|
||||||
|
CONFIG_TARGET_ath79=y
|
||||||
|
CONFIG_TARGET_ath79_nand=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_glinet_gl-ar300m-nand=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_glinet_gl-ar300m-nor=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_glinet_gl-ar750s-nor-nand=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_glinet_gl-ar750s-nor=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_glinet_gl-e750=y
|
|
@ -0,0 +1,19 @@
|
||||||
|
CONFIG_TARGET_ath79=y
|
||||||
|
CONFIG_TARGET_ath79_tiny=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_tiny_DEVICE_ubnt_airrouter=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_tiny_DEVICE_ubnt_bullet-m-ar7241=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_tiny_DEVICE_ubnt_nanostation-loco-m=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_tiny_DEVICE_ubnt_nanobridge-m=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_tiny_DEVICE_ubnt_nanostation-m=y
|
||||||
|
CONFIG_TARGET_DEVICE_ath79_tiny_DEVICE_ubnt_picostation-m=y
|
||||||
|
|
||||||
|
# Overrides to save as much space as we can
|
||||||
|
CONFIG_KERNEL_CC_STACKPROTECTOR_NONE=y
|
||||||
|
CONFIG_KERNEL_PRINTK=n
|
||||||
|
CONFIG_PACKAGE_ATH_SPECTRAL=n
|
||||||
|
CONFIG_PACKAGE_wpad-mini=m
|
||||||
|
CONFIG_PACKAGE_vtun=m
|
||||||
|
CONFIG_PACKAGE_ethtool=m
|
||||||
|
CONFIG_PACKAGE_iperf3=m
|
||||||
|
CONFIG_PKG_CC_STACKPROTECTOR_NONE=y
|
||||||
|
CONFIG_PKG_FORTIFY_SOURCE_NONE=y
|
|
@ -1,127 +1,177 @@
|
||||||
CONFIG_KERNEL_CRASHLOG=n
|
|
||||||
CONFIG_KERNEL_SWAP=n
|
|
||||||
CONFIG_KERNEL_KALLSYMS=n
|
|
||||||
CONFIG_KERNEL_DEBUG_INFO=n
|
|
||||||
CONFIG_KERNEL_ELF_CORE=n
|
|
||||||
CONFIG_KERNEL_MAGIC_SYSRQ=n
|
|
||||||
CONFIG_PACKAGE_MAC80211_MESH=n
|
|
||||||
CONFIG_STRIP_KERNEL_EXPORTS=y
|
|
||||||
CONFIG_USE_MKLIBS=y
|
|
||||||
CONFIG_LOG_BUF_SHIFT=16
|
|
||||||
CONFIG_LOG_CPU_MAX_BUF_SHIFT=16
|
|
||||||
CONFIG_KERNEL_IPV6=n
|
|
||||||
CONFIG_KERNEL_IPV6_MULTIPLE_TABLES=n
|
|
||||||
CONFIG_KERNEL_IPV6_SUBTREES=n
|
|
||||||
CONFIG_KERNEL_IPV6_MROUTE=n
|
|
||||||
CONFIG_IPV6=n
|
|
||||||
CONFIG_ATH_USER_REGD=y
|
CONFIG_ATH_USER_REGD=y
|
||||||
CONFIG_PACKAGE_bridge=y
|
|
||||||
CONFIG_PACKAGE_busybox=y
|
|
||||||
CONFIG_BUSYBOX_CUSTOM=y
|
|
||||||
CONFIG_BUSYBOX_DEFAULT_FEATURE_IPV6=n
|
|
||||||
CONFIG_BUSYBOX_CONFIG_FEATURE_IPV6=n
|
|
||||||
CONFIG_BUSYBOX_CONFIG_TELNETD=y
|
|
||||||
CONFIG_BUSYBOX_DEFAULT_MKSWAP=n
|
|
||||||
CONFIG_BUSYBOX_CONFIG_MKSWAP=n
|
|
||||||
CONFIG_BUSYBOX_CONFIG_FEATURE_TOP_INTERACTIVE=y
|
|
||||||
CONFIG_BUSYBOX_CONFIG_ARPING=y
|
CONFIG_BUSYBOX_CONFIG_ARPING=y
|
||||||
CONFIG_PACKAGE_dnsmasq=y
|
CONFIG_BUSYBOX_CONFIG_CROND=n
|
||||||
CONFIG_PACKAGE_dropbear=y
|
CONFIG_BUSYBOX_CONFIG_FEATURE_IPV6=n
|
||||||
CONFIG_PACKAGE_iperf3=y
|
CONFIG_BUSYBOX_CONFIG_FEATURE_TOP_INTERACTIVE=y
|
||||||
CONFIG_PACKAGE_iptables=y
|
CONFIG_BUSYBOX_CONFIG_MKSWAP=n
|
||||||
CONFIG_PACKAGE_kmod-ipt-nathelper=y
|
CONFIG_BUSYBOX_CONFIG_NTPD=y
|
||||||
CONFIG_PACKAGE_kmod-usb-core=m
|
CONFIG_BUSYBOX_CONFIG_SETSID=y
|
||||||
CONFIG_PACKAGE_kmod-usb-ehci=m
|
CONFIG_BUSYBOX_CONFIG_TELNETD=y
|
||||||
CONFIG_PACKAGE_kmod-usb-ohci=m
|
CONFIG_BUSYBOX_CUSTOM=y
|
||||||
CONFIG_PACKAGE_kmod-usb-uhci=m
|
CONFIG_DROPBEAR_AGENTFORWARD=n
|
||||||
CONFIG_PACKAGE_kmod-usb2=m
|
CONFIG_DROPBEAR_CURVE25519=n
|
||||||
CONFIG_PACKAGE_kmod-usb3=m
|
CONFIG_DROPBEAR_CHACHA20POLY1305=n
|
||||||
CONFIG_PACKAGE_block-mount=m
|
CONFIG_DROPBEAR_DBCLIENT_AGENTFORWARD=n
|
||||||
CONFIG_PACKAGE_kmod-fs-vfat=m
|
CONFIG_DROPBEAR_ECC=y
|
||||||
CONFIG_PACKAGE_kmod-fs-ntfs=m
|
CONFIG_DROPBEAR_ED25519=n
|
||||||
CONFIG_PACKAGE_kmod-fs-ext4=m
|
|
||||||
CONFIG_PACKAGE_e2fsprogs=m
|
|
||||||
CONFIG_PACKAGE_kmod-usb-storage=m
|
|
||||||
CONFIG_PACKAGE_kmod-usb-storage-extras=m
|
|
||||||
CONFIG_PACKAGE_kmod-usb-storage-uas=m
|
|
||||||
CONFIG_PACKAGE_kmod-mmc=m
|
|
||||||
CONFIG_PACKAGE_mmc-utils=m
|
|
||||||
CONFIG_PACKAGE_kmod-sdhci=m
|
|
||||||
CONFIG_PACKAGE_kmod-sdhci-mt7620=m
|
|
||||||
CONFIG_PACKAGE_libgcc=y
|
|
||||||
CONFIG_PACKAGE_mtd=y
|
|
||||||
CONFIG_PACKAGE_ppp=n
|
|
||||||
CONFIG_PACKAGE_ppp-mod-pppoe=n
|
|
||||||
CONFIG_PACKAGE_odhcp6c=n
|
|
||||||
CONFIG_PACKAGE_odhcpd=n
|
|
||||||
CONFIG_PACKAGE_odhcpd-ipv6only=n
|
|
||||||
CONFIG_PACKAGE_kmod-ppp=n
|
|
||||||
CONFIG_PACKAGE_kmod-pppoe=n
|
|
||||||
CONFIG_PACKAGE_kmod-pppox=n
|
|
||||||
CONFIG_PACKAGE_uhttpd=y
|
|
||||||
CONFIG_PACKAGE_olsrd=y
|
|
||||||
CONFIG_PACKAGE_perl=m
|
|
||||||
CONFIG_PACKAGE_olsrd-mod-arprefresh=y
|
|
||||||
CONFIG_PACKAGE_olsrd-mod-dyn-gw=y
|
|
||||||
CONFIG_PACKAGE_olsrd-mod-nameservice=y
|
|
||||||
CONFIG_PACKAGE_olsrd-mod-txtinfo=y
|
|
||||||
CONFIG_PACKAGE_olsrd-mod-jsoninfo=y
|
|
||||||
CONFIG_PACKAGE_olsrd-mod-dot-draw=y
|
|
||||||
CONFIG_PACKAGE_olsrd-mod-watchdog=y
|
|
||||||
CONFIG_PACKAGE_olsrd-mod-secure=m
|
|
||||||
CONFIG_PACKAGE_perlbase-essential=m
|
|
||||||
CONFIG_PACKAGE_perlbase-xsloader=m
|
|
||||||
CONFIG_PACKAGE_perlbase-file=m
|
|
||||||
CONFIG_PACKAGE_perlbase-perlio=m
|
|
||||||
CONFIG_PACKAGE_libpcap=m
|
|
||||||
CONFIG_PACKAGE_tcpdump-mini=m
|
|
||||||
CONFIG_PACKAGE_ntpclient=m
|
|
||||||
CONFIG_PACKAGE_xinetd=m
|
|
||||||
CONFIG_PACKAGE_kmod-ipv6=n
|
|
||||||
CONFIG_PACKAGE_ip6tables=n
|
|
||||||
CONFIG_PACKAGE_kmod-ip6tables=n
|
|
||||||
CONFIG_PACKAGE_libip6tc=n
|
|
||||||
CONFIG_PACKAGE_ip=y
|
|
||||||
CONFIG_PACKAGE_iptables-mod-ipopt=y
|
|
||||||
CONFIG_PACKAGE_iwinfo=y
|
|
||||||
CONFIG_PACKAGE_libiwinfo=y
|
|
||||||
CONFIG_PACKAGE_socat=y
|
|
||||||
CONFIG_PACKAGE_curl=y
|
|
||||||
CONFIG_PACKAGE_libnetsnmp=m
|
|
||||||
CONFIG_PACKAGE_snmpd=m
|
|
||||||
CONFIG_PACKAGE_lua=y
|
|
||||||
CONFIG_PACKAGE_liblua=y
|
|
||||||
CONFIG_PACKAGE_libuci-lua=y
|
|
||||||
CONFIG_PACKAGE_libubus-lua=y
|
|
||||||
CONFIG_PACKAGE_luci-base=y
|
|
||||||
CONFIG_PACKAGE_luci-lib-nixio=y
|
|
||||||
CONFIG_PACKAGE_luci-lib-ip=y
|
|
||||||
CONFIG_PACKAGE_luci-lib-jsonc=y
|
|
||||||
CONFIG_PACKAGE_libc=y
|
|
||||||
CONFIG_PACKAGE_libjson-c=y
|
|
||||||
CONFIG_PACKAGE_libnl_tiny=y
|
|
||||||
CONFIG_PACKAGE_libiwinfo-lua=y
|
|
||||||
CONFIG_PACKAGE_luaposix=y
|
|
||||||
CONFIG_PACKAGE_luasocket=y
|
|
||||||
CONFIG_PACKAGE_vtun=y
|
|
||||||
CONFIG_PACKAGE_kmod-ipip=y
|
|
||||||
CONFIG_IMAGEOPT=y
|
CONFIG_IMAGEOPT=y
|
||||||
CONFIG_VERSIONOPT=y
|
CONFIG_IPV6=n
|
||||||
CONFIG_VERSION_DIST="AREDN"
|
CONFIG_JSON_OVERVIEW_IMAGE_INFO=y
|
||||||
CONFIG_PACKAGE_ATH_DYNACK=y
|
CONFIG_KERNEL_AIO=n
|
||||||
|
CONFIG_KERNEL_CC_OPTIMIZE_FOR_SIZE=y
|
||||||
|
CONFIG_KERNEL_CGROUPS=n
|
||||||
|
CONFIG_KERNEL_CRASHLOG=n
|
||||||
|
CONFIG_KERNEL_DEBUG_INFO=n
|
||||||
|
CONFIG_KERNEL_DEVPTS_MULTIPLE_INSTANCES=n
|
||||||
|
CONFIG_KERNEL_ELF_CORE=n
|
||||||
|
CONFIG_KERNEL_IO_URING=n
|
||||||
|
CONFIG_KERNEL_IP_MROUTE=n
|
||||||
|
CONFIG_KERNEL_IPV6=n
|
||||||
|
CONFIG_KERNEL_KALLSYMS=n
|
||||||
|
CONFIG_KERNEL_KEYS=n
|
||||||
|
CONFIG_KERNEL_MAGIC_SYSRQ=n
|
||||||
|
CONFIG_KERNEL_NAMESPACES=n
|
||||||
|
CONFIG_KERNEL_POSIX_MQUEUE=n
|
||||||
|
CONFIG_KERNEL_RELAY=y
|
||||||
|
CONFIG_KERNEL_SECCOMP=n
|
||||||
|
CONFIG_KERNEL_SWAP=n
|
||||||
|
CONFIG_LIBCURL_COOKIES=y
|
||||||
|
CONFIG_LIBCURL_FILE=y
|
||||||
|
CONFIG_LIBCURL_FTP=y
|
||||||
|
CONFIG_LIBCURL_HTTP=y
|
||||||
|
CONFIG_LIBCURL_NGHTTP2=n
|
||||||
|
CONFIG_LIBCURL_NO_SMB=y
|
||||||
|
CONFIG_LIBCURL_NOSSL=y
|
||||||
|
CONFIG_LIBCURL_PROXY=y
|
||||||
|
CONFIG_LIBCURL_NO_RTSP=n
|
||||||
CONFIG_PACKAGE_ATH_DEBUG=y
|
CONFIG_PACKAGE_ATH_DEBUG=y
|
||||||
|
CONFIG_PACKAGE_ATH_DYNACK=y
|
||||||
CONFIG_PACKAGE_ATH_SPECTRAL=y
|
CONFIG_PACKAGE_ATH_SPECTRAL=y
|
||||||
CONFIG_PACKAGE_blockknownencryption=m
|
CONFIG_PACKAGE_blockknownencryption=m
|
||||||
CONFIG_PACKAGE_kmod-udptunnel4=m
|
CONFIG_PACKAGE_block-mount=m
|
||||||
CONFIG_PACKAGE_libmnl0=m
|
CONFIG_PACKAGE_cgi-io=n
|
||||||
CONFIG_PACKAGE_libssp=m
|
CONFIG_PACKAGE_curl=y
|
||||||
|
CONFIG_PACKAGE_e2fsprogs=m
|
||||||
|
CONFIG_PACKAGE_ethtool=y
|
||||||
|
CONFIG_PACKAGE_firewall4=y
|
||||||
|
CONFIG_PACKAGE_iperf3=y
|
||||||
|
CONFIG_PACKAGE_jansson=n
|
||||||
|
CONFIG_PACKAGE_kmod-crypto-crc32c=m
|
||||||
|
CONFIG_PACKAGE_kmod-fs-ext4=m
|
||||||
|
CONFIG_PACKAGE_kmod-fs-ntfs=m
|
||||||
|
CONFIG_PACKAGE_kmod-fs-vfat=m
|
||||||
|
CONFIG_PACKAGE_kmod-ipip=y
|
||||||
|
CONFIG_PACKAGE_kmod-iptunnel4=y
|
||||||
|
CONFIG_PACKAGE_kmod-iptunnel=y
|
||||||
|
CONFIG_PACKAGE_kmod-lib-crc16=m
|
||||||
|
CONFIG_PACKAGE_kmod-lib-crc-ccitt=m
|
||||||
|
CONFIG_PACKAGE_kmod-nft-core=y
|
||||||
|
CONFIG_PACKAGE_kmod-nft-fib=y
|
||||||
|
CONFIG_PACKAGE_kmod-nft-nat=y
|
||||||
|
CONFIG_PACKAGE_kmod-nft-offload=y
|
||||||
|
CONFIG_PACKAGE_kmod-nls-cp437=m
|
||||||
|
CONFIG_PACKAGE_kmod-nls-iso8859-1=m
|
||||||
|
CONFIG_PACKAGE_kmod-nls-utf8=m
|
||||||
|
CONFIG_PACKAGE_kmod-ppp=m
|
||||||
|
CONFIG_PACKAGE_kmod-pppoe=m
|
||||||
|
CONFIG_PACKAGE_kmod-pppox=m
|
||||||
|
CONFIG_PACKAGE_kmod-scsi-core=m
|
||||||
|
CONFIG_PACKAGE_kmod-slhc=m
|
||||||
|
CONFIG_PACKAGE_kmod-tun=m
|
||||||
|
CONFIG_PACKAGE_kmod-usb2=m
|
||||||
|
CONFIG_PACKAGE_kmod-usb3=m
|
||||||
|
CONFIG_PACKAGE_kmod-usb-ohci=m
|
||||||
|
CONFIG_PACKAGE_kmod-usb-storage-extras=m
|
||||||
|
CONFIG_PACKAGE_kmod-usb-storage=m
|
||||||
|
CONFIG_PACKAGE_kmod-usb-storage-uas=m
|
||||||
|
CONFIG_PACKAGE_kmod-usb-uhci=m
|
||||||
|
CONFIG_PACKAGE_kmod-usb-xhci-hcd=m
|
||||||
CONFIG_PACKAGE_kmod-wireguard=m
|
CONFIG_PACKAGE_kmod-wireguard=m
|
||||||
|
CONFIG_PACKAGE_libblkid=m
|
||||||
|
CONFIG_PACKAGE_libcomerr=m
|
||||||
|
CONFIG_PACKAGE_libcurl=y
|
||||||
|
CONFIG_PACKAGE_libext2fs=m
|
||||||
|
CONFIG_PACKAGE_libiwinfo-lua=y
|
||||||
|
CONFIG_PACKAGE_liblua=y
|
||||||
|
CONFIG_PACKAGE_liblucihttp-lua=y
|
||||||
|
CONFIG_PACKAGE_liblucihttp=y
|
||||||
|
CONFIG_PACKAGE_liblzo=m
|
||||||
|
CONFIG_PACKAGE_libnetsnmp=m
|
||||||
|
CONFIG_PACKAGE_libnftnl=y
|
||||||
|
CONFIG_PACKAGE_libnghttp2=n
|
||||||
|
CONFIG_PACKAGE_libpcap=m
|
||||||
|
CONFIG_PACKAGE_libpci=m
|
||||||
|
CONFIG_PACKAGE_libpcre=m
|
||||||
|
CONFIG_PACKAGE_librt=y
|
||||||
|
CONFIG_PACKAGE_libss=m
|
||||||
|
CONFIG_PACKAGE_libsysfs=m
|
||||||
|
CONFIG_PACKAGE_libubus-lua=y
|
||||||
|
CONFIG_PACKAGE_libuci-lua=y
|
||||||
|
CONFIG_PACKAGE_libustream-wolfssl=n
|
||||||
|
CONFIG_PACKAGE_libuuid=m
|
||||||
|
CONFIG_PACKAGE_libwolfssl=n
|
||||||
|
CONFIG_PACKAGE_libxtables=y
|
||||||
|
CONFIG_PACKAGE_lua-bit32=y
|
||||||
|
CONFIG_PACKAGE_luaposix=n
|
||||||
|
CONFIG_PACKAGE_luasocket=y
|
||||||
|
CONFIG_PACKAGE_lua=y
|
||||||
|
CONFIG_PACKAGE_luci-base=n
|
||||||
|
CONFIG_PACKAGE_luci-lib-base=y
|
||||||
|
CONFIG_PACKAGE_luci-lib-ip=y
|
||||||
|
CONFIG_PACKAGE_luci-lib-jsonc=y
|
||||||
|
CONFIG_PACKAGE_luci-lib-nixio=y
|
||||||
|
CONFIG_PACKAGE_mii-tool=m
|
||||||
|
CONFIG_PACKAGE_nftables-json=y
|
||||||
|
CONFIG_PACKAGE_nftables=y
|
||||||
|
CONFIG_PACKAGE_odhcp6c=n
|
||||||
|
CONFIG_PACKAGE_odhcpd-ipv6only=n
|
||||||
|
CONFIG_PACKAGE_odhcpd=n
|
||||||
|
CONFIG_PACKAGE_olsrd-mod-arprefresh=y
|
||||||
|
CONFIG_PACKAGE_olsrd-mod-dot-draw=y
|
||||||
|
CONFIG_PACKAGE_olsrd-mod-dyn-gw=y
|
||||||
|
CONFIG_PACKAGE_olsrd-mod-jsoninfo=y
|
||||||
|
CONFIG_PACKAGE_olsrd-mod-nameservice=y
|
||||||
|
CONFIG_PACKAGE_olsrd-mod-secure=m
|
||||||
|
CONFIG_PACKAGE_olsrd-mod-txtinfo=y
|
||||||
|
CONFIG_PACKAGE_olsrd-mod-watchdog=y
|
||||||
|
CONFIG_PACKAGE_olsrd=y
|
||||||
|
CONFIG_PACKAGE_ppp=m
|
||||||
|
CONFIG_PACKAGE_ppp-mod-pppoe=m
|
||||||
|
CONFIG_PACKAGE_procd-seccomp=n
|
||||||
|
CONFIG_PACKAGE_procd-ujail=n
|
||||||
|
CONFIG_PACKAGE_rpcd-mod-file=y
|
||||||
|
CONFIG_PACKAGE_rpcd-mod-luci=y
|
||||||
|
CONFIG_PACKAGE_rpcd=y
|
||||||
|
CONFIG_PACKAGE_snmpd=m
|
||||||
|
CONFIG_PACKAGE_socat=m
|
||||||
|
CONFIG_PACKAGE_sysfsutils=m
|
||||||
|
CONFIG_PACKAGE_tcpdump-mini=m
|
||||||
|
CONFIG_PACKAGE_ubi-utils=y
|
||||||
|
CONFIG_PACKAGE_uhttpd=y
|
||||||
|
CONFIG_PACKAGE_vtun=y
|
||||||
CONFIG_PACKAGE_wireguard=m
|
CONFIG_PACKAGE_wireguard=m
|
||||||
CONFIG_PACKAGE_wireguard-tools=m
|
CONFIG_PACKAGE_wireguard-tools=m
|
||||||
|
CONFIG_PACKAGE_wpad-mini=y
|
||||||
|
CONFIG_PACKAGE_xinetd=n
|
||||||
|
CONFIG_PACKAGE_zlib=m
|
||||||
|
CONFIG_PACKAGE_zram-swap=n
|
||||||
CONFIG_PREINITOPT=y
|
CONFIG_PREINITOPT=y
|
||||||
|
CONFIG_SECCOMP=n
|
||||||
|
CONFIG_STRIP_KERNEL_EXPORTS=y
|
||||||
|
CONFIG_TARGET_MULTI_PROFILE=y
|
||||||
|
CONFIG_TARGET_PER_DEVICE_ROOTFS=y
|
||||||
CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE=y
|
CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE=y
|
||||||
|
CONFIG_VERSION_BUG_URL="https://github.com/aredn/aredn/issues"
|
||||||
|
CONFIG_VERSION_CODE=""
|
||||||
|
CONFIG_VERSION_DIST="AREDN"
|
||||||
|
CONFIG_VERSION_FILENAMES=y
|
||||||
|
CONFIG_VERSION_HOME_URL=""
|
||||||
|
CONFIG_VERSION_HWREV=""
|
||||||
|
CONFIG_VERSION_MANUFACTURER=""
|
||||||
|
CONFIG_VERSION_MANUFACTURER_URL=""
|
||||||
|
CONFIG_VERSIONOPT=y
|
||||||
|
CONFIG_VERSION_PRODUCT=""
|
||||||
|
CONFIG_VERSION_REPO="http://downloads.arednmesh.org/snapshots"
|
||||||
|
CONFIG_VERSION_SUPPORT_URL="https://arednmesh.org"
|
||||||
|
CONFIG_VTUN_LZO=y
|
||||||
CONFIG_VTUN_SSL=n
|
CONFIG_VTUN_SSL=n
|
||||||
CONFIG_PACKAGE_ethtool=y
|
|
||||||
CONFIG_JSON_OVERVIEW_IMAGE_INFO=y
|
|
||||||
CONFIG_PACKAGE_kmod-rtc-ds1307=m
|
|
||||||
CONFIG_DROPBEAR_ECC=y
|
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
CONFIG_TARGET_ipq40xx=y
|
||||||
|
CONFIG_TARGET_ipq40xx_mikrotik=y
|
||||||
|
CONFIG_TARGET_DEVICE_ipq40xx_mikrotik_DEVICE_mikrotik_hap-ac2=y
|
||||||
|
CONFIG_TARGET_DEVICE_ipq40xx_mikrotik_DEVICE_mikrotik_hap-ac3=y
|
||||||
|
CONFIG_TARGET_DEVICE_ipq40xx_mikrotik_DEVICE_mikrotik_lhgg-5acd=y
|
||||||
|
CONFIG_TARGET_DEVICE_ipq40xx_mikrotik_DEVICE_mikrotik_sxtsq-5-ac=y
|
|
@ -1 +1 @@
|
||||||
src-git arednpackages https://github.com/aredn/aredn_packages;develop
|
src-git arednpackages https://github.com/kn6plv/aredn_packages;openwrt-22.3.0-lua
|
||||||
|
|
|
@ -15,6 +15,12 @@
|
||||||
/etc/config.mesh/xlink
|
/etc/config.mesh/xlink
|
||||||
/etc/aredn_include/swconfig.user
|
/etc/aredn_include/swconfig.user
|
||||||
/etc/aredn_include/static_routes
|
/etc/aredn_include/static_routes
|
||||||
|
/etc/aredn_include/fixedmac.lan
|
||||||
|
/etc/aredn_include/fixedmac.wan
|
||||||
|
/etc/aredn_include/fixedmac.dtdlink
|
||||||
|
/etc/aredn_include/lan.network.user
|
||||||
|
/etc/aredn_include/wan.network.user
|
||||||
|
/etc/aredn_include/dtdlink.network.user
|
||||||
/etc/dropbear/dropbear_dss_host_key
|
/etc/dropbear/dropbear_dss_host_key
|
||||||
/etc/dropbear/dropbear_rsa_host_key
|
/etc/dropbear/dropbear_rsa_host_key
|
||||||
/etc/dropbear/dropbear_ecdsa_host_key
|
/etc/dropbear/dropbear_ecdsa_host_key
|
||||||
|
|
|
@ -44,3 +44,5 @@ time_zone = UTC
|
||||||
ntp_server = us.pool.ntp.org
|
ntp_server = us.pool.ntp.org
|
||||||
|
|
||||||
description_node =
|
description_node =
|
||||||
|
|
||||||
|
compat_version = 1.0
|
||||||
|
|
|
@ -45,3 +45,5 @@ time_zone_name = UTC
|
||||||
ntp_server = us.pool.ntp.org
|
ntp_server = us.pool.ntp.org
|
||||||
|
|
||||||
description_node =
|
description_node =
|
||||||
|
|
||||||
|
compat_version = 1.0
|
||||||
|
|
|
@ -81,11 +81,12 @@ config rule
|
||||||
option target ACCEPT
|
option target ACCEPT
|
||||||
|
|
||||||
config include
|
config include
|
||||||
option path /usr/local/bin/mesh-firewall
|
option path /usr/local/bin/mesh-firewall
|
||||||
option reload 1
|
option fw4_compatible 1
|
||||||
|
|
||||||
config include
|
config include
|
||||||
option path /etc/firewall.user
|
option path /etc/firewall.user
|
||||||
|
option fw4_compatible 1
|
||||||
|
|
||||||
config rule
|
config rule
|
||||||
option src wan
|
option src wan
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# This file is interpreted as shell script.
|
# This file is interpreted as shell script.
|
||||||
# Put your custom iptables rules here, they will
|
# Put your custom nft rules here, they will
|
||||||
# be executed with each firewall (re-)start.
|
# be executed with each firewall (re-)start.
|
||||||
|
|
||||||
|
|
|
@ -1,46 +1,62 @@
|
||||||
#### Loopback configuration
|
#### Loopback configuration
|
||||||
config interface loopback
|
config interface loopback
|
||||||
option ifname "lo"
|
option device "lo"
|
||||||
option proto static
|
option proto static
|
||||||
option ipaddr 127.0.0.1
|
option ipaddr 127.0.0.1
|
||||||
option netmask 255.0.0.0
|
option netmask 255.0.0.0
|
||||||
|
|
||||||
|
|
||||||
#### LAN configuration
|
#### LAN configuration
|
||||||
config interface lan
|
config device
|
||||||
option ifname "<lan_intf>"
|
option name "br-lan"
|
||||||
option type "bridge"
|
option type "bridge"
|
||||||
|
include /etc/aredn_include/fixedmac.lan
|
||||||
|
include /etc/aredn_include/lan.network.config
|
||||||
|
|
||||||
|
config interface lan
|
||||||
|
option device "br-lan"
|
||||||
option proto <lan_proto>
|
option proto <lan_proto>
|
||||||
option ipaddr <lan_ip>
|
option ipaddr <lan_ip>
|
||||||
option netmask <lan_mask>
|
option netmask <lan_mask>
|
||||||
option dns "<wan_dns1> <wan_dns2>"
|
option dns "<wan_dns1> <wan_dns2>"
|
||||||
option gateway <lan_gw>
|
option gateway <lan_gw>
|
||||||
include /etc/aredn_include/ethmacfixup
|
|
||||||
|
|
||||||
#### WAN configuration
|
#### WAN configuration
|
||||||
|
config device
|
||||||
|
option name "br-wan"
|
||||||
|
option type "bridge"
|
||||||
|
include /etc/aredn_include/fixedmac.wan
|
||||||
|
include /etc/aredn_include/wan.network.config
|
||||||
|
|
||||||
config interface wan
|
config interface wan
|
||||||
option ifname "<wan_intf>"
|
option device "br-wan"
|
||||||
include /etc/aredn_include/bridge_ports
|
|
||||||
option proto <wan_proto>
|
option proto <wan_proto>
|
||||||
option ipaddr <wan_ip>
|
option ipaddr <wan_ip>
|
||||||
option netmask <wan_mask>
|
option netmask <wan_mask>
|
||||||
option gateway <wan_gw>
|
option gateway <wan_gw>
|
||||||
|
|
||||||
|
|
||||||
#### WIFI configuration
|
#### WIFI configuration
|
||||||
|
config device
|
||||||
|
option name "<wifi_intf>"
|
||||||
|
|
||||||
config interface wifi
|
config interface wifi
|
||||||
option ifname "<wifi_intf>"
|
option device "<wifi_intf>"
|
||||||
option proto <wifi_proto>
|
option proto <wifi_proto>
|
||||||
option ipaddr <wifi_ip>
|
option ipaddr <wifi_ip>
|
||||||
option netmask <wifi_mask>
|
option netmask <wifi_mask>
|
||||||
|
|
||||||
#### device to device configuration
|
#### device to device configuration
|
||||||
|
config device
|
||||||
|
option name "br-dtdlink"
|
||||||
|
option type "bridge"
|
||||||
|
include /etc/aredn_include/fixedmac.dtdlink
|
||||||
|
include /etc/aredn_include/dtdlink.network.config
|
||||||
|
|
||||||
config interface dtdlink
|
config interface dtdlink
|
||||||
option ifname "<dtdlink_intf>"
|
option device "br-dtdlink"
|
||||||
include /etc/aredn_include/bridge_ports
|
option proto static
|
||||||
option proto static
|
option ipaddr <dtdlink_ip>
|
||||||
option ipaddr <dtdlink_ip>
|
option netmask 255.0.0.0
|
||||||
option netmask 255.0.0.0
|
|
||||||
|
|
||||||
config interface wifi_mon
|
config interface wifi_mon
|
||||||
option proto none
|
option proto none
|
||||||
|
|
|
@ -2,6 +2,7 @@ config 'system'
|
||||||
option 'hostname' '<NODE>'
|
option 'hostname' '<NODE>'
|
||||||
option 'timezone' '<time_zone>'
|
option 'timezone' '<time_zone>'
|
||||||
option 'description' '<description_node>'
|
option 'description' '<description_node>'
|
||||||
|
option 'compat_version' '<compat_version>'
|
||||||
|
|
||||||
config 'timeserver' 'ntp'
|
config 'timeserver' 'ntp'
|
||||||
list 'server' '<ntp_server>'
|
list 'server' '<ntp_server>'
|
||||||
|
|
|
@ -47,8 +47,8 @@ config rule
|
||||||
option target ACCEPT
|
option target ACCEPT
|
||||||
|
|
||||||
config include
|
config include
|
||||||
option path /etc/firewall.user
|
option path '/etc/firewall.user'
|
||||||
|
option fw4_compatible 1
|
||||||
|
|
||||||
config rule
|
config rule
|
||||||
option src wan
|
option src wan
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
config 'system'
|
config 'system'
|
||||||
option 'hostname' 'NOCALL'
|
option 'hostname' 'NOCALL'
|
||||||
option 'timezone' 'UTC'
|
option 'timezone' 'UTC'
|
||||||
|
option 'compat_version' '1.0'
|
||||||
|
|
||||||
config 'timeserver' 'ntp'
|
config 'timeserver' 'ntp'
|
||||||
list 'server' 'us.pool.ntp.org'
|
list 'server' 'us.pool.ntp.org'
|
||||||
|
|
|
@ -5,7 +5,6 @@ filterwin2k
|
||||||
localise-queries
|
localise-queries
|
||||||
|
|
||||||
# allow /etc/hosts and dhcp lookups via *.lan
|
# allow /etc/hosts and dhcp lookups via *.lan
|
||||||
#local=/lan/
|
|
||||||
domain=local.mesh
|
domain=local.mesh
|
||||||
expand-hosts
|
expand-hosts
|
||||||
no-negcache
|
no-negcache
|
||||||
|
@ -25,5 +24,8 @@ read-ethers
|
||||||
# default route(s): dhcp-option=3,192.168.1.1,192.168.1.2
|
# default route(s): dhcp-option=3,192.168.1.1,192.168.1.2
|
||||||
# dns server(s): dhcp-option=6,192.168.1.1,192.168.1.2
|
# dns server(s): dhcp-option=6,192.168.1.1,192.168.1.2
|
||||||
|
|
||||||
|
# Make sure clients use our domain
|
||||||
|
dhcp-option=option:domain-search,local.mesh
|
||||||
|
|
||||||
strict-order
|
strict-order
|
||||||
log-facility=/dev/null
|
log-facility=/dev/null
|
||||||
|
|
|
@ -9,10 +9,9 @@ ip rule del pref 20010 fwmark 0x15 lookup 29 > /dev/null 2>&1
|
||||||
ip rule add pref 20010 fwmark 0x15 lookup 29
|
ip rule add pref 20010 fwmark 0x15 lookup 29
|
||||||
|
|
||||||
#tag traffic for use later in iprule's
|
#tag traffic for use later in iprule's
|
||||||
iptables -t mangle -I PREROUTING -d $wifiip/32 -j MARK --set-xmark 0x15/0xffffffff
|
nft insert rule ip fw4 mangle_prerouting ip daddr $wifiip counter meta mark set 0x15
|
||||||
iptables -t mangle -I PREROUTING -d $dtdlinkip/32 -j MARK --set-xmark 0x15/0xffffffff
|
nft insert rule ip fw4 mangle_prerouting ip daddr $dtdlinkip counter meta mark set 0x15
|
||||||
|
|
||||||
# Mark and masq local traffic going out the dtdlink interface.
|
# Mark and masq local traffic going out the dtdlink interface.
|
||||||
iptables -t nat -A zone_lan_prerouting -j MARK --set-xmark 0xe/0xffffffff
|
nft add rule ip fw4 helper_lan counter meta mark set 0xe
|
||||||
iptables -t nat -A zone_dtdlink_postrouting -m mark --mark 0xe -j MASQUERADE
|
nft add rule ip fw4 srcnat mark 0xe mark 0xe counter masquerade
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ if [ "$ACTION" = "ifup" ] ; then
|
||||||
if [ $bridge = "bridge" ] ; then
|
if [ $bridge = "bridge" ] ; then
|
||||||
lan_ifname="br-lan"
|
lan_ifname="br-lan"
|
||||||
else
|
else
|
||||||
lan_ifname=$(uci -q get network.lan.ifname | cut -f1)
|
lan_ifname=$(uci -q get network.lan.device | cut -f1)
|
||||||
fi
|
fi
|
||||||
if [ "$lan_ifname" != "" ] && [ "$lan_ipaddr" != "" ] && [ "$lan_netmask" != "" ] ; then
|
if [ "$lan_ifname" != "" ] && [ "$lan_ipaddr" != "" ] && [ "$lan_netmask" != "" ] ; then
|
||||||
lan_networkip=$(ipcalc.sh $lan_ipaddr $lan_netmask|grep NETWORK|cut -d'=' -f2)
|
lan_networkip=$(ipcalc.sh $lan_ipaddr $lan_netmask|grep NETWORK|cut -d'=' -f2)
|
||||||
|
|
|
@ -4,45 +4,6 @@
|
||||||
START=99
|
START=99
|
||||||
boot() {
|
boot() {
|
||||||
|
|
||||||
if [ ! -f /etc/aredn_include/ethmacfixup ]
|
|
||||||
then
|
|
||||||
mkdir -p /etc/aredn_include
|
|
||||||
touch /etc/aredn_include/ethmacfixup
|
|
||||||
local lanintf="$(uci -q get 'network.lan.ifname')"
|
|
||||||
lanintf=${lanintf%% *}
|
|
||||||
local wifiintf="$(uci -q get 'network.wifi.ifname')"
|
|
||||||
local lanmac=`ifconfig $lanintf | grep -o -E '([[:xdigit:]]{2}:){5}[[:xdigit:]]{2}'`
|
|
||||||
local wifimac=`ifconfig $wifiintf | grep -o -E '([[:xdigit:]]{2}:){5}[[:xdigit:]]{2}'`
|
|
||||||
|
|
||||||
local intlanmac=${lanmac//:/}
|
|
||||||
local intwanmac=${wifimac//:/}
|
|
||||||
local macdelta=$((0x$intwanmac - 0x$intlanmac))
|
|
||||||
|
|
||||||
# Deal with lan and wifi having same mac address (common on TP-Link)
|
|
||||||
# Deal with lan mac + ~10 = wifi mac address (common on Microtik and
|
|
||||||
# breaks OLSR if using derived IP addresses)
|
|
||||||
# Deal with lan on AR300M always having the same mac address.
|
|
||||||
if [ $macdelta -le 10 -o $lanmac = "00:03:7F:11:23:C6" ]
|
|
||||||
then
|
|
||||||
local wifimacdigit=`printf "%X" $(((0x${wifimac:9:2} + 1) % 256))`
|
|
||||||
local newmac=${wifimac:0:9}${wifimacdigit}${wifimac:11}
|
|
||||||
lanintf=${lanintf%%.*}
|
|
||||||
echo "" > /etc/aredn_include/ethmacfixup
|
|
||||||
echo "config interface 'setethmac'" >> /etc/aredn_include/ethmacfixup
|
|
||||||
echo -e "\toption\tifname\t'$lanintf'" >> /etc/aredn_include/ethmacfixup
|
|
||||||
echo -e "\toption\tproto\t'none'" >> /etc/aredn_include/ethmacfixup
|
|
||||||
echo -e "\toption\tmacaddr\t$newmac" >> /etc/aredn_include/ethmacfixup
|
|
||||||
uci set "network.setethmac=interface"
|
|
||||||
uci set "network.setethmac.ifname=$lanintf"
|
|
||||||
uci set "network.setethmac.proto=none"
|
|
||||||
uci set "network.setethmac.macaddr=$newmac"
|
|
||||||
uci commit
|
|
||||||
/etc/init.d/network reload
|
|
||||||
/etc/init.d/network restart
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
[ -x /usr/local/bin/aredn_postupgrade ] && /usr/local/bin/aredn_postupgrade
|
[ -x /usr/local/bin/aredn_postupgrade ] && /usr/local/bin/aredn_postupgrade
|
||||||
|
|
||||||
# setup nvram variables
|
# setup nvram variables
|
||||||
|
@ -96,6 +57,17 @@ boot() {
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# did the ethernet come up? we get one reboot to try to fix it.
|
||||||
|
pkt_lan=$(ifconfig br-lan | grep "RX packets" | sed "s/^.*RX packets:\(\d*\).*$/\1/")
|
||||||
|
pkt_dtd=$(ifconfig br-dtdlink | grep "RX packets" | sed "s/^.*RX packets:\(\d*\).*$/\1/")
|
||||||
|
pkt_wan=$(ifconfig br-wan | grep "RX packets" | sed "s/^.*RX packets:\(\d*\).*$/\1/")
|
||||||
|
if [ ! -f /did_ether_reboot -a "$pkt_lan" = "0" -a "$pkt_dtd" = "0" -a "$pkt_wan" = "0" ]; then
|
||||||
|
touch /did_ether_reboot
|
||||||
|
reboot
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
rm -f /did_ether_reboot
|
||||||
|
|
||||||
if [ -z "$(uci -q get aredn.@alerts[0])" ]; then
|
if [ -z "$(uci -q get aredn.@alerts[0])" ]; then
|
||||||
uci -q add aredn alerts
|
uci -q add aredn alerts
|
||||||
uci -q commit aredn
|
uci -q commit aredn
|
||||||
|
|
|
@ -44,7 +44,7 @@ options_config() {
|
||||||
config_get ppp "$cfg" ppp "/usr/sbin/pppd"
|
config_get ppp "$cfg" ppp "/usr/sbin/pppd"
|
||||||
config_get ifconfig "$cfg" ifconfig "/sbin/ifconfig"
|
config_get ifconfig "$cfg" ifconfig "/sbin/ifconfig"
|
||||||
config_get route "$cfg" route "/sbin/route"
|
config_get route "$cfg" route "/sbin/route"
|
||||||
config_get firewall "$cfg" firewall "/usr/sbin/iptables"
|
config_get firewall "$cfg" firewall "/usr/sbin/nft"
|
||||||
config_get ip "$cfg" ip "/sbin/ip"
|
config_get ip "$cfg" ip "/sbin/ip"
|
||||||
|
|
||||||
echo "options {" >> $new_file
|
echo "options {" >> $new_file
|
||||||
|
|
|
@ -29,7 +29,7 @@ options_config() {
|
||||||
config_get ppp "$cfg" ppp "/usr/sbin/pppd"
|
config_get ppp "$cfg" ppp "/usr/sbin/pppd"
|
||||||
config_get ifconfig "$cfg" ifconfig "/sbin/ifconfig"
|
config_get ifconfig "$cfg" ifconfig "/sbin/ifconfig"
|
||||||
config_get route "$cfg" route "/sbin/route"
|
config_get route "$cfg" route "/sbin/route"
|
||||||
config_get firewall "$cfg" firewall "/usr/sbin/iptables"
|
config_get firewall "$cfg" firewall "/usr/sbin/nft"
|
||||||
config_get ip "$cfg" ip "/sbin/ip"
|
config_get ip "$cfg" ip "/sbin/ip"
|
||||||
|
|
||||||
echo "options {" >> $new_file
|
echo "options {" >> $new_file
|
||||||
|
|
|
@ -39,62 +39,59 @@ if [ "$MESHFW_TUNNELS_ENABLED" != "1" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# In all cases - restart, flush, clear -- it is necessary to clean up any remenant rules to ensure chain order is correct
|
# In all cases - restart, flush, clear -- it is necessary to clean up any remenant rules to ensure chain order is correct
|
||||||
|
nft flush chain ip fw4 forwarding_vpn_rule 2>/dev/null
|
||||||
iptables -D FORWARD -i tun+ -j zone_vpn_forward 2>/dev/null
|
nft flush chain ip fw4 input_vpn 2>/dev/null
|
||||||
iptables -D INPUT -i tun+ -j zone_vpn_input 2>/dev/null
|
nft flush chain ip fw4 accept_vpn 2>/dev/null
|
||||||
iptables -D OUTPUT -o tun+ -j zone_vpn_ACCEPT 2>/dev/null
|
nft flush chain ip fw4 reject_vpn 2>/dev/null
|
||||||
iptables -F forwarding_vpn_rule 2>/dev/null
|
nft flush chain ip fw4 forward_vpn 2>/dev/null
|
||||||
iptables -F zone_vpn_input 2>/dev/null
|
nft flush chain ip fw4 accept_to_vpn 2>/dev/null
|
||||||
iptables -F zone_vpn_ACCEPT 2>/dev/null
|
nft flush chain ip fw4 reject_to_vpn 2>/dev/null
|
||||||
iptables -F zone_vpn_REJECT 2>/dev/null
|
nft delete chain ip fw4 forwarding_vpn_rule 2>/dev/null
|
||||||
iptables -F zone_vpn_forward 2>/dev/null
|
nft delete chain ip fw4 input_vpn 2>/dev/null
|
||||||
iptables -F zone_vpn_dest_ACCEPT 2>/dev/null
|
nft delete chain ip fw4 accept_vpn 2>/dev/null
|
||||||
iptables -F zone_vpn_dest_REJECT 2>/dev/null
|
nft delete chain ip fw4 reject_vpn 2>/dev/null
|
||||||
iptables -X forwarding_vpn_rule 2>/dev/null
|
nft delete chain ip fw4 forward_vpn 2>/dev/null
|
||||||
iptables -X zone_vpn_input 2>/dev/null
|
nft delete chain ip fw4 accept_to_vpn 2>/dev/null
|
||||||
iptables -X zone_vpn_ACCEPT 2>/dev/null
|
nft delete chain ip fw4 reject_to_vpn 2>/dev/null
|
||||||
iptables -X zone_vpn_REJECT 2>/dev/null
|
|
||||||
iptables -X zone_vpn_forward 2>/dev/null
|
|
||||||
iptables -X zone_vpn_dest_ACCEPT 2>/dev/null
|
|
||||||
iptables -X zone_vpn_dest_REJECT 2>/dev/null
|
|
||||||
|
|
||||||
echo " * Adding vtun firewall rules..."
|
echo " * Adding vtun firewall rules..."
|
||||||
iptables -N forwarding_vpn_rule
|
nft add chain ip fw4 forwarding_vpn_rule
|
||||||
iptables -N zone_vpn_input
|
nft add chain ip fw4 input_vpn
|
||||||
iptables -N zone_vpn_ACCEPT
|
nft add chain ip fw4 accept_vpn
|
||||||
iptables -N zone_vpn_REJECT
|
nft add chain ip fw4 reject_vpn
|
||||||
iptables -N zone_vpn_forward
|
nft add chain ip fw4 forward_vpn
|
||||||
iptables -N zone_vpn_dest_ACCEPT
|
nft add chain ip fw4 accept_to_vpn
|
||||||
iptables -N zone_vpn_dest_REJECT
|
nft add chain ip fw4 reject_to_vpn
|
||||||
iptables -I FORWARD 3 -i tun+ -j zone_vpn_forward
|
|
||||||
iptables -I INPUT 5 -i tun+ -j zone_vpn_input
|
nft insert rule ip fw4 forward iifname "tun*" counter jump forward_vpn
|
||||||
iptables -I OUTPUT 4 -o tun+ -j zone_vpn_ACCEPT # instead of creating a zone_vpn_output chain
|
nft insert rule ip fw4 input iifname "tun*" counter jump input_vpn
|
||||||
iptables -A zone_vpn_input -p icmp -m icmp --icmp-type 8 -j ACCEPT
|
nft insert rule ip fw4 output oifname "tun*" counter jump accept_vpn # instead of creating a output_vpn chain
|
||||||
iptables -A zone_vpn_input -p tcp -m tcp --dport 2222 -j ACCEPT
|
nft add rule ip fw4 input_vpn icmp type echo-request counter accept
|
||||||
iptables -A zone_vpn_input -p tcp -m tcp --dport 8080 -j ACCEPT
|
nft add rule ip fw4 input_vpn tcp dport 2222 counter accept
|
||||||
iptables -A zone_vpn_input -p tcp -m tcp --dport 80 -j ACCEPT
|
nft add rule ip fw4 input_vpn tcp dport 8080 counter accept
|
||||||
iptables -A zone_vpn_input -p udp -m udp --dport 698 -j ACCEPT
|
nft add rule ip fw4 input_vpn tcp dport 80 counter accept
|
||||||
iptables -A zone_vpn_input -p tcp -m tcp --dport 23 -j ACCEPT
|
nft add rule ip fw4 input_vpn udp dport 698 counter accept
|
||||||
iptables -A zone_vpn_input -p tcp -m tcp --dport 9090 -j ACCEPT
|
nft add rule ip fw4 input_vpn tcp dport 23 counter accept
|
||||||
iptables -A zone_vpn_input -p udp -m udp --dport 161 -j ACCEPT
|
nft add rule ip fw4 input_vpn tcp dport 9090 counter accept
|
||||||
iptables -A zone_vpn_input -m conntrack --ctstate DNAT -m comment --comment "!vtun: Accept port redirections" -j ACCEPT
|
nft add rule ip fw4 input_vpn udp dport 161 counter accept
|
||||||
iptables -A zone_vpn_input -j zone_vpn_REJECT
|
nft add rule ip fw4 input_vpn ct status dnat counter accept comment \"!vtun: Accept port redirections\"
|
||||||
iptables -I zone_vpn_forward -j forwarding_vpn_rule
|
nft add rule ip fw4 input_vpn counter jump reject_vpn
|
||||||
iptables -A zone_vpn_forward -j zone_vpn_dest_ACCEPT
|
nft insert rule ip fw4 forward_vpn counter jump forwarding_vpn_rule
|
||||||
if [ "$MESHFW_MESHGW" -eq 1 ] ; then
|
nft add rule ip fw4 forward_vpn counter jump accept_to_vpn
|
||||||
iptables -I zone_vpn_forward -j zone_wan_dest_ACCEPT
|
if [ "$MESHFW_MESHGW" = "1" ] ; then
|
||||||
|
nft insert rule ip fw4 forward_vpn counter jump accept_to_wan
|
||||||
fi
|
fi
|
||||||
iptables -A zone_vpn_forward -m conntrack --ctstate DNAT -m comment --comment "!vtun: Accept port forwards" -j ACCEPT
|
nft add rule ip fw4 forward_vpn ct status dnat counter accept comment \"!vtun: Accept port forwards\"
|
||||||
iptables -A zone_vpn_forward -j zone_dtdlink_dest_ACCEPT
|
nft add rule ip fw4 forward_vpn counter jump accept_to_dtdlink
|
||||||
iptables -A zone_vpn_forward -j zone_lan_dest_ACCEPT
|
nft add rule ip fw4 forward_vpn counter jump accept_to_lan
|
||||||
iptables -A zone_vpn_forward -j zone_wifi_dest_ACCEPT
|
nft add rule ip fw4 forward_vpn counter jump accept_to_wifi
|
||||||
iptables -A zone_vpn_forward -j zone_vpn_dest_REJECT
|
nft add rule ip fw4 forward_vpn counter jump reject_to_vpn
|
||||||
iptables -A zone_vpn_ACCEPT -o tun+ -j ACCEPT
|
nft add rule ip fw4 accept_vpn oifname "tun*" counter accept
|
||||||
iptables -A zone_vpn_ACCEPT -i tun+ -j ACCEPT
|
nft add rule ip fw4 accept_vpn iifname "tun*" counter accept
|
||||||
iptables -A zone_vpn_REJECT -o tun+ -j reject
|
nft add rule ip fw4 reject_vpn oifname "tun*" counter reject
|
||||||
iptables -A zone_vpn_REJECT -i tun+ -j reject
|
nft add rule ip fw4 reject_vpn iifname "tun*" counter reject
|
||||||
iptables -A zone_vpn_dest_ACCEPT -o tun+ -j ACCEPT
|
nft add rule ip fw4 accept_to_vpn oifname "tun*" counter accept
|
||||||
iptables -A zone_vpn_dest_REJECT -o tun+ -j reject
|
nft add rule ip fw4 reject_to_vpn oifname "tun*" counter reject
|
||||||
iptables -I zone_dtdlink_forward 5 -j zone_vpn_dest_ACCEPT
|
nft insert rule ip fw4 forward_dtdlink counter jump accept_to_vpn
|
||||||
iptables -I zone_wifi_forward 6 -j zone_vpn_dest_ACCEPT
|
nft insert rule ip fw4 forward_wifi counter jump accept_to_vpn
|
||||||
iptables -I zone_lan_forward 5 -j zone_vpn_dest_ACCEPT
|
nft insert rule ip fw4 forward_lan counter jump accept_to_vpn
|
||||||
|
|
|
@ -39,32 +39,42 @@ require("nixio")
|
||||||
require("uci")
|
require("uci")
|
||||||
|
|
||||||
if nixio.fs.stat("/etc/config.mesh/xlink") then
|
if nixio.fs.stat("/etc/config.mesh/xlink") then
|
||||||
|
function nft_delete(list, query)
|
||||||
|
for line in io.popen("/usr/sbin/nft -a list chain ip fw4 " .. list):lines()
|
||||||
|
do
|
||||||
|
local handle = line:match(query .. "%s*# handle (%d+)")
|
||||||
|
if handle then
|
||||||
|
os.execute("/usr/sbin/nft delete rule ip fw4 " .. list .. " handle " .. handle)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
uci.cursor("/etc/config.mesh"):foreach("xlink", "interface",
|
uci.cursor("/etc/config.mesh"):foreach("xlink", "interface",
|
||||||
function(section)
|
function(section)
|
||||||
local ifname = section.ifname
|
local ifname = section.ifname
|
||||||
os.execute("/usr/sbin/iptables -D FORWARD -i " .. ifname .. " -j zone_dtdlink_forward")
|
nft_delete("forward", "iifname \"" .. ifname .. "\".*jump forward_dtdlink")
|
||||||
os.execute("/usr/sbin/iptables -D INPUT -i " .. ifname .. " -j zone_dtdlink_input")
|
nft_delete("input", "iifname \"" .. ifname .. "\".*jump input_dtdlink")
|
||||||
os.execute("/usr/sbin/iptables -D OUTPUT -o " .. ifname .. " -j zone_dtdlink_output")
|
nft_delete("output", "oifname \"" .. ifname .. "\".*jump accept_dtdlink")
|
||||||
os.execute("/usr/sbin/iptables -D zone_dtdlink_dest_ACCEPT -o " .. ifname .. " -j ACCEPT")
|
nft_delete("accept_to_dtdlink", "oifname \"" .. ifname .. "\".*accept")
|
||||||
os.execute("/usr/sbin/iptables -D zone_dtdlink_dest_REJECT -o " .. ifname .. " -j reject")
|
nft_delete("reject_to_dtdlink", "oifname \"" .. ifname .. "\".*reject")
|
||||||
os.execute("/usr/sbin/iptables -D zone_dtdlink_src_REJECT -i " .. ifname .. " -j reject")
|
nft_delete("reject_from_dtdlink", "iifname \"" .. ifname .. "\".*reject")
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
os.execute("/usr/sbin/iptables -D zone_dtdlink_forward -j zone_dtdlink_dest_ACCEPT")
|
nft_delete("forward_dtdlink", "jump accept_to_dtdlink")
|
||||||
local addrule = false
|
local addrule = false
|
||||||
uci.cursor("/etc/config.mesh"):foreach("xlink", "interface",
|
uci.cursor("/etc/config.mesh"):foreach("xlink", "interface",
|
||||||
function(section)
|
function(section)
|
||||||
local ifname = section.ifname
|
local ifname = section.ifname
|
||||||
os.execute("/usr/sbin/iptables -I FORWARD -i " .. ifname .. " -j zone_dtdlink_forward")
|
os.execute("/usr/sbin/nft insert rule ip fw4 forward iifname \"" .. ifname .. "\" counter jump forward_dtdlink")
|
||||||
os.execute("/usr/sbin/iptables -A INPUT -i " .. ifname .. " -j zone_dtdlink_input")
|
os.execute("/usr/sbin/nft insert rule ip fw4 input iifname \"" .. ifname .. "\" counter jump input_dtdlink")
|
||||||
os.execute("/usr/sbin/iptables -A OUTPUT -o " .. ifname .. " -j zone_dtdlink_output")
|
os.execute("/usr/sbin/nft insert rule ip fw4 output oifname \"" .. ifname .. "\" counter jump accept_dtdlink")
|
||||||
os.execute("/usr/sbin/iptables -A zone_dtdlink_dest_ACCEPT -o " .. ifname .. " -j ACCEPT")
|
os.execute("/usr/sbin/nft add rule ip fw4 accept_to_dtdlink oifname \"" .. ifname .. "\" counter accept")
|
||||||
os.execute("/usr/sbin/iptables -A zone_dtdlink_dest_REJECT -o " .. ifname .. " -j reject")
|
os.execute("/usr/sbin/nft add rule ip fw4 reject_to_dtdlink oifname \"" .. ifname .. "\" counter reject")
|
||||||
os.execute("/usr/sbin/iptables -A zone_dtdlink_src_REJECT -i " .. ifname .. " -j reject")
|
os.execute("/usr/sbin/nft add rule ip fw4 reject_from_dtdlink iifname \"" .. ifname .. "\" counter reject")
|
||||||
addrule = true
|
addrule = true
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
if addrule then
|
if addrule then
|
||||||
os.execute("/usr/sbin/iptables -I zone_dtdlink_forward -j zone_dtdlink_dest_ACCEPT")
|
os.execute("/usr/sbin/nft add rule ip fw4 forward_dtdlink counter jump accept_to_dtdlink")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -43,10 +43,10 @@ case "${lan_dhcp_route}" in
|
||||||
# Block traffic forwarding between LAN and local WAN (need this rule if WAN happens to be 10.X or 172.16.X)
|
# Block traffic forwarding between LAN and local WAN (need this rule if WAN happens to be 10.X or 172.16.X)
|
||||||
# Allow traffic for mesh-IPs and tun-IPs
|
# Allow traffic for mesh-IPs and tun-IPs
|
||||||
# Block traffic to all other IPs
|
# Block traffic to all other IPs
|
||||||
iptables -I zone_lan_forward -j REJECT
|
nft insert rule ip fw4 forward_lan counter reject
|
||||||
iptables -I zone_lan_forward -d 172.16.0.0/12 -j ACCEPT
|
nft insert rule ip fw4 forward_lan ip daddr 172.16.0.0/12 counter accept
|
||||||
iptables -I zone_lan_forward -d 10.0.0.0/8 -j ACCEPT
|
nft insert rule ip fw4 forward_lan ip daddr 10.0.0.0/8 counter accept
|
||||||
iptables -I zone_lan_forward -o ${wan} -j REJECT
|
nft insert rule ip fw4 forward_lan oifname "${wan}" counter reject
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# LAN to WAN okay
|
# LAN to WAN okay
|
||||||
|
|
|
@ -33,8 +33,11 @@
|
||||||
|
|
||||||
LICENSE
|
LICENSE
|
||||||
|
|
||||||
/usr/sbin/iptables -F input_lqm 2> /dev/null
|
nft flush chain ip fw4 input_lqm 2> /dev/null
|
||||||
/usr/sbin/iptables -X input_lqm 2> /dev/null
|
nft delete chain ip fw4 input_lqm 2> /dev/null
|
||||||
/usr/sbin/iptables -N input_lqm 2> /dev/null
|
nft add chain ip fw4 input_lqm 2> /dev/null
|
||||||
/usr/sbin/iptables -D INPUT -j input_lqm -m comment --comment 'block low quality links' 2> /dev/null
|
handle=$(nft -n -a list chain ip fw4 input | grep "jump input_lqm" | sed "s/^.* handle //")
|
||||||
/usr/sbin/iptables -I INPUT -j input_lqm -m comment --comment 'block low quality links' 2> /dev/null
|
if [ "$handle" != "" ]; then
|
||||||
|
nft delete rule ip fw4 input handle $handle 2> /dev/null
|
||||||
|
fi
|
||||||
|
nft insert rule ip fw4 input counter jump input_lqm comment \"block low quality links\" 2> /dev/null
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
# on home network use the IP address of the WAN assigned to the mesh node
|
# on home network use the IP address of the WAN assigned to the mesh node
|
||||||
# to access the ipcam, e.g. http://192.168.1.59:8082
|
# to access the ipcam, e.g. http://192.168.1.59:8082
|
||||||
|
|
||||||
#iptables -t nat -A zone_wan_prerouting -p tcp -m tcp --dport 8082 -j DNAT --to <IP address of ipcam> -m comment --comment "my mesh ipCam"
|
#nft add rule ip fw4 prerouting_wan tcp dport 8082 counter dnat to <IP address of ipcam>
|
||||||
#iptables -t nat -A zone_wifi_postrouting -p tcp -m tcp -d <IP address of ipcam> -j SNAT --dport 80 --to-source <IP wifi on this node> -m comment --comment "my mesh ipCam"
|
#nft add rule ip fw4 postrouting_wan ip daddr <IP address of ipcam> tcp dport 80 counter snat to <IP wifi on this node> comment \"my mesh ipCam\"
|
||||||
#iptables -t nat -A zone_dtdlink_postrouting -p tcp -m tcp -d <IP address of ipcam> -j SNAT --dport 80 --to-source <IP dtdlink on this node> -m comment --comment "my mesh ipCam"
|
#nft add rule ip fw4 postrouting_dtdlink ip daddr <IP address of ipcam> tcp dport 80 counter snat to <IP dtdlink on this node> comment \"my mesh ipCam\"
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
3.1.1TUNNEL
|
KN6PLV-openwrt-22.3.0-lua-1461feb
|
||||||
|
|
|
@ -7,8 +7,7 @@ firewall
|
||||||
hotplug2
|
hotplug2
|
||||||
ip
|
ip
|
||||||
iperf3
|
iperf3
|
||||||
iptables
|
nftables
|
||||||
iptables-mod-ipopt
|
|
||||||
iw
|
iw
|
||||||
iwinfo
|
iwinfo
|
||||||
jshn
|
jshn
|
||||||
|
|
|
@ -26,6 +26,15 @@
|
||||||
"usechains" : true,
|
"usechains" : true,
|
||||||
"rfband" : "2400"
|
"rfband" : "2400"
|
||||||
},
|
},
|
||||||
|
"GL.iNet GL-AR300M16" : {
|
||||||
|
"name" : "GL.iNet GL-AR300M16",
|
||||||
|
"comment" : "",
|
||||||
|
"supported" : "1",
|
||||||
|
"maxpower" : "23",
|
||||||
|
"pwroffset" : "0",
|
||||||
|
"usechains" : true,
|
||||||
|
"rfband" : "2400"
|
||||||
|
},
|
||||||
"GL.iNet GL-USB150" : {
|
"GL.iNet GL-USB150" : {
|
||||||
"name" : "GL.iNet GL-USB150",
|
"name" : "GL.iNet GL-USB150",
|
||||||
"comment" : "",
|
"comment" : "",
|
||||||
|
@ -64,6 +73,16 @@
|
||||||
"rfband" : "2400",
|
"rfband" : "2400",
|
||||||
"chanpower" : { "1" : "27", "2" : "28", "9" : "29", "14" : "27" }
|
"chanpower" : { "1" : "27", "2" : "28", "9" : "29", "14" : "27" }
|
||||||
},
|
},
|
||||||
|
"TP-Link CPE210 v2" : {
|
||||||
|
"name" : "TP-Link CPE210 v2",
|
||||||
|
"comment" : "",
|
||||||
|
"supported" : "1",
|
||||||
|
"maxpower" : "29",
|
||||||
|
"pwroffset" : "0",
|
||||||
|
"usechains" : true,
|
||||||
|
"rfband" : "2400",
|
||||||
|
"chanpower" : { "1" : "27", "2" : "28", "9" : "29", "14" : "27" }
|
||||||
|
},
|
||||||
"TP-LINK CPE210 v3" : {
|
"TP-LINK CPE210 v3" : {
|
||||||
"name" : "TP-LINK CPE210 v3",
|
"name" : "TP-LINK CPE210 v3",
|
||||||
"comment" : "",
|
"comment" : "",
|
||||||
|
@ -124,6 +143,16 @@
|
||||||
"rfband" : "5800ubntus",
|
"rfband" : "5800ubntus",
|
||||||
"chanpower" : { "140" : "17", "184" : "26" }
|
"chanpower" : { "140" : "17", "184" : "26" }
|
||||||
},
|
},
|
||||||
|
"TP-Link CPE605 v1" : {
|
||||||
|
"name" : "TP-Link CPE605 v1",
|
||||||
|
"comment" : "",
|
||||||
|
"supported" : "1",
|
||||||
|
"maxpower" : "30",
|
||||||
|
"pwroffset" : "0",
|
||||||
|
"usechains" : true,
|
||||||
|
"rfband" : "5800ubntus",
|
||||||
|
"chanpower" : { "133" : "30", "141" : "30", "143" : "30" , "149" : "30" , "165" : "30", "166" : "30" }
|
||||||
|
},
|
||||||
"TP-Link CPE610 v1" : {
|
"TP-Link CPE610 v1" : {
|
||||||
"name" : "TP-Link CPE610 v1",
|
"name" : "TP-Link CPE610 v1",
|
||||||
"comment" : "",
|
"comment" : "",
|
||||||
|
@ -144,6 +173,16 @@
|
||||||
"rfband" : "5800ubntus",
|
"rfband" : "5800ubntus",
|
||||||
"chanpower" : { "133" : "15", "141" : "26", "143" : "25" , "149" : "15" , "165" : "14", "166" : "25" }
|
"chanpower" : { "133" : "15", "141" : "26", "143" : "25" , "149" : "15" , "165" : "14", "166" : "25" }
|
||||||
},
|
},
|
||||||
|
"TP-Link CPE710 v1" : {
|
||||||
|
"name" : "TP-Link CPE710 v1",
|
||||||
|
"comment" : "",
|
||||||
|
"supported" : "1",
|
||||||
|
"maxpower" : "30",
|
||||||
|
"pwroffset" : "0",
|
||||||
|
"usechains" : true,
|
||||||
|
"rfband" : "5800ubntus",
|
||||||
|
"chanpower" : { "133" : "30", "141" : "30", "143" : "30" , "149" : "30" , "165" : "30", "166" : "30" }
|
||||||
|
},
|
||||||
"TP-Link WBS210 v1" : {
|
"TP-Link WBS210 v1" : {
|
||||||
"name" : "TP-Link WBS210 v1",
|
"name" : "TP-Link WBS210 v1",
|
||||||
"comment" : "",
|
"comment" : "",
|
||||||
|
@ -220,6 +259,24 @@
|
||||||
"usechains" : true,
|
"usechains" : true,
|
||||||
"rfband" : "5800ubntus"
|
"rfband" : "5800ubntus"
|
||||||
},
|
},
|
||||||
|
"MikroTik RouterBOARD 921GS-5HPacD-15s" : {
|
||||||
|
"name" : "MikroTik RouterBOARD 921GS-5HPacD-15s",
|
||||||
|
"comment" : "",
|
||||||
|
"supported" : "1",
|
||||||
|
"maxpower" : "31",
|
||||||
|
"pwroffset" : "0",
|
||||||
|
"usechains" : true,
|
||||||
|
"rfband" : "5800ubntus"
|
||||||
|
},
|
||||||
|
"MikroTik RouterBOARD 921GS-5HPacD-19s" : {
|
||||||
|
"name" : "MikroTik RouterBOARD 921GS-5HPacD-19s",
|
||||||
|
"comment" : "",
|
||||||
|
"supported" : "1",
|
||||||
|
"maxpower" : "31",
|
||||||
|
"pwroffset" : "0",
|
||||||
|
"usechains" : true,
|
||||||
|
"rfband" : "5800ubntus"
|
||||||
|
},
|
||||||
"MikroTik RouterBOARD 952Ui-5ac2nD" : {
|
"MikroTik RouterBOARD 952Ui-5ac2nD" : {
|
||||||
"name" : "MikroTik RouterBOARD 952Ui-5ac2nD",
|
"name" : "MikroTik RouterBOARD 952Ui-5ac2nD",
|
||||||
"comment" : "",
|
"comment" : "",
|
||||||
|
@ -238,6 +295,15 @@
|
||||||
"usechains" : true,
|
"usechains" : true,
|
||||||
"rfband" : "2400"
|
"rfband" : "2400"
|
||||||
},
|
},
|
||||||
|
"MikroTik RouterBOARD 952Ui-5ac2nD (hAP ac lite)" : {
|
||||||
|
"name" : "MikroTik RouterBOARD 952Ui-5ac2nD (hAP ac lite)",
|
||||||
|
"comment" : "",
|
||||||
|
"supported" : "1",
|
||||||
|
"maxpower" : "22",
|
||||||
|
"pwroffset" : "0",
|
||||||
|
"usechains" : true,
|
||||||
|
"rfband" : "2400"
|
||||||
|
},
|
||||||
"Mikrotik RouterBOARD 912UAG-2HPnD" : {
|
"Mikrotik RouterBOARD 912UAG-2HPnD" : {
|
||||||
"name" : "Mikrotik RouterBOARD 912UAG-2HPnD",
|
"name" : "Mikrotik RouterBOARD 912UAG-2HPnD",
|
||||||
"comment" : "",
|
"comment" : "",
|
||||||
|
@ -409,6 +475,15 @@
|
||||||
"usechains" : true,
|
"usechains" : true,
|
||||||
"rfband" : "5800ubntus"
|
"rfband" : "5800ubntus"
|
||||||
},
|
},
|
||||||
|
"MikroTik LHG 5 ac (RBLHGG-5acD)": {
|
||||||
|
"name" : "MikroTik LHG 5 ac (RBLHGG-5acD)",
|
||||||
|
"comment" : "",
|
||||||
|
"supported" : "1",
|
||||||
|
"maxpower" : "25",
|
||||||
|
"pwroffset" : "0",
|
||||||
|
"usechains" : true,
|
||||||
|
"rfband" : "5800ubntus"
|
||||||
|
},
|
||||||
"MikroTik RouterBOARD SXTsq 5nD" : {
|
"MikroTik RouterBOARD SXTsq 5nD" : {
|
||||||
"name" : "MikroTik RouterBOARD SXTsq 5nD",
|
"name" : "MikroTik RouterBOARD SXTsq 5nD",
|
||||||
"comment" : "",
|
"comment" : "",
|
||||||
|
@ -463,6 +538,46 @@
|
||||||
"usechains" : true,
|
"usechains" : true,
|
||||||
"rfband" : "5800ubntus"
|
"rfband" : "5800ubntus"
|
||||||
},
|
},
|
||||||
|
"MikroTik RouterBOARD SXT 5nD (SXT Lite5)": {
|
||||||
|
"name" : "MikroTik RouterBOARD SXT 5nD (SXT Lite5)",
|
||||||
|
"comment" : "",
|
||||||
|
"supported" : "1",
|
||||||
|
"maxpower" : "28",
|
||||||
|
"pwroffset" : "0",
|
||||||
|
"usechains" : true,
|
||||||
|
"rfband" : "5800ubntus"
|
||||||
|
},
|
||||||
|
"MikroTik SXTsq 5 ac (RBSXTsqG-5acD)": {
|
||||||
|
"name" : "MikroTik SXTsq 5 ac (RBSXTsqG-5acD)",
|
||||||
|
"comment" : "",
|
||||||
|
"supported" : "1",
|
||||||
|
"maxpower" : "25",
|
||||||
|
"pwroffset" : "0",
|
||||||
|
"usechains" : true,
|
||||||
|
"rfband" : "5800ubntus"
|
||||||
|
},
|
||||||
|
"MikroTik hAP ac2" : {
|
||||||
|
"name" : "MikroTik RouterBOARD RBD52G-5HacD2HnD",
|
||||||
|
"comment" : "",
|
||||||
|
"supported" : "1",
|
||||||
|
"maxpower" : "27",
|
||||||
|
"pwroffset" : "0",
|
||||||
|
"usechains" : true,
|
||||||
|
"rfband" : "2400",
|
||||||
|
"rfbandwidths" : [ 10, 20 ],
|
||||||
|
"rfblocked" : [ -4, -3, -2, -1 ]
|
||||||
|
},
|
||||||
|
"MikroTik hAP ac3" : {
|
||||||
|
"name" : "MikroTik RouterBOARD RBD53iG-5HacD2HnD",
|
||||||
|
"comment" : "",
|
||||||
|
"supported" : "1",
|
||||||
|
"maxpower" : "27",
|
||||||
|
"pwroffset" : "0",
|
||||||
|
"usechains" : true,
|
||||||
|
"rfband" : "2400",
|
||||||
|
"rfbandwidths" : [ 10, 20 ],
|
||||||
|
"rfblocked" : [ -4, -3, -2, -1 ]
|
||||||
|
},
|
||||||
"0xe005" : {
|
"0xe005" : {
|
||||||
"name" : "Ubiquiti NanoStation M5",
|
"name" : "Ubiquiti NanoStation M5",
|
||||||
"comment" : "",
|
"comment" : "",
|
||||||
|
@ -598,6 +713,15 @@
|
||||||
"usechains" : true,
|
"usechains" : true,
|
||||||
"rfband" : "5800ubntus"
|
"rfband" : "5800ubntus"
|
||||||
},
|
},
|
||||||
|
"0xe1f5" : {
|
||||||
|
"name" : "Ubiquiti Rocket 5AC Lite",
|
||||||
|
"comment" : "",
|
||||||
|
"supported" : "1",
|
||||||
|
"maxpower" : "27",
|
||||||
|
"pwroffset" : "0",
|
||||||
|
"usechains" : true,
|
||||||
|
"rfband" : "5800ubntus"
|
||||||
|
},
|
||||||
"0xe202" : {
|
"0xe202" : {
|
||||||
"name" : "Ubiquiti Bullet M2 HP",
|
"name" : "Ubiquiti Bullet M2 HP",
|
||||||
"comment" : "",
|
"comment" : "",
|
||||||
|
@ -760,6 +884,15 @@
|
||||||
"usechains" : false,
|
"usechains" : false,
|
||||||
"rfband" : "2400"
|
"rfband" : "2400"
|
||||||
},
|
},
|
||||||
|
"0xe3d5": {
|
||||||
|
"name" : "Ubiquiti PowerBeam 5AC 500",
|
||||||
|
"comment" : "",
|
||||||
|
"supported" : "1",
|
||||||
|
"maxpower" : "24",
|
||||||
|
"pwroffset" : "0",
|
||||||
|
"usechains" : true,
|
||||||
|
"rfband" : "5800ubntus"
|
||||||
|
},
|
||||||
"0xe3e5" : {
|
"0xe3e5" : {
|
||||||
"name" : "Ubiquiti PowerBeam M5 XW 300",
|
"name" : "Ubiquiti PowerBeam M5 XW 300",
|
||||||
"comment" : "",
|
"comment" : "",
|
||||||
|
@ -823,6 +956,33 @@
|
||||||
"usechains" : true,
|
"usechains" : true,
|
||||||
"rfband" : "5800ubntus"
|
"rfband" : "5800ubntus"
|
||||||
},
|
},
|
||||||
|
"0xe7fb": {
|
||||||
|
"name" : "Ubiquiti NanoStation AC (WA)",
|
||||||
|
"comment" : "",
|
||||||
|
"supported" : "1",
|
||||||
|
"maxpower" : "27",
|
||||||
|
"pwroffset" : "0",
|
||||||
|
"usechains" : true,
|
||||||
|
"rfband" : "5800ubntus"
|
||||||
|
},
|
||||||
|
"0xe7fc": {
|
||||||
|
"name" : "Ubiquiti NanoBeam AC Gen2 (WA)",
|
||||||
|
"comment" : "",
|
||||||
|
"supported" : "1",
|
||||||
|
"maxpower" : "27",
|
||||||
|
"pwroffset" : "0",
|
||||||
|
"usechains" : true,
|
||||||
|
"rfband" : "5800ubntus"
|
||||||
|
},
|
||||||
|
"0xe7f9": {
|
||||||
|
"name" : "Ubiquiti LiteBeam 5AC Gen2",
|
||||||
|
"comment" : "",
|
||||||
|
"supported" : "1",
|
||||||
|
"maxpower" : "25",
|
||||||
|
"pwroffset" : "0",
|
||||||
|
"usechains" : true,
|
||||||
|
"rfband" : "5800ubntus"
|
||||||
|
},
|
||||||
"0xe805" : {
|
"0xe805" : {
|
||||||
"name" : "Ubiquiti NanoStation M5",
|
"name" : "Ubiquiti NanoStation M5",
|
||||||
"comment" : "",
|
"comment" : "",
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
#! /bin/sh
|
||||||
|
case "$(/usr/local/bin/get_boardid)" in
|
||||||
|
MikroTik\ hAP\ ac2|\
|
||||||
|
MikroTik\ hAP\ ac3|\
|
||||||
|
MikroTik\ SXTsq\ 5\ ac*|\
|
||||||
|
MikroTik\ LHG\ 5\ ac*)
|
||||||
|
sed -i "s/^compat_version = 1.0/compat_version = 1.1/" /etc/config.mesh/_setup
|
||||||
|
sed -i "s/^compat_version = 1.0/compat_version = 1.1/" /etc/config.mesh/_setup.default
|
||||||
|
/sbin/uci -q set system.@system[0].compat_version=1.1
|
||||||
|
/sbin/uci -q commit system
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
|
@ -0,0 +1,41 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# Fix mac addresses as necessary
|
||||||
|
|
||||||
|
fix=""
|
||||||
|
|
||||||
|
eth0=$(ifconfig eth0 2> /dev/null | grep HWaddr | sed s/^.*HWaddr\ // | sed s/\ //g)
|
||||||
|
wlan0=$(ifconfig wlan0 2> /dev/null | grep HWaddr | sed s/^.*HWaddr\ // | sed s/\ //g)
|
||||||
|
brlan=$(ifconfig br-lan 2> /dev/null | grep HWaddr | sed s/^.*HWaddr\ // | sed s/\ //g)
|
||||||
|
boardid=$(/usr/local/bin/get_boardid)
|
||||||
|
mfg=$(/usr/local/bin/get_hardware_mfg)
|
||||||
|
|
||||||
|
if [ "$eth0" = "$wlan0" -a "$eth0" != "" ]; then
|
||||||
|
fix="lan wan dtdlink"
|
||||||
|
elif [ "$wlan0" = "" ]; then
|
||||||
|
fix="lan"
|
||||||
|
elif [ "$brlan" = "00:03:7F:11:23:C6" ]; then # Fix AR300M
|
||||||
|
fix="lan"
|
||||||
|
elif [ "$mfg" = "MikroTik" ]; then # Fix all MikroTiks
|
||||||
|
fix="lan wan dtdlink"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p /etc/aredn_include
|
||||||
|
|
||||||
|
list=""
|
||||||
|
for i in $fix
|
||||||
|
do
|
||||||
|
if [ ! -s /etc/aredn_include/fixedmac.$i ]; then
|
||||||
|
# Some mac addresses are stored in /etc/board.json
|
||||||
|
mac=$(jsonfilter -i /etc/board.json -e @.network.$i.macaddr 2> /dev/null | awk '{print toupper($0)}')
|
||||||
|
if [[ "$list" =~ "#$mac#" ]]; then
|
||||||
|
# Dont allow reuse
|
||||||
|
mac=""
|
||||||
|
fi
|
||||||
|
if [ "$mac" = "" ]; then
|
||||||
|
# Generate a safe mac address
|
||||||
|
mac=$(hexdump -n5 -e'/5 "02" 5/1 ":%02X"' /dev/random)
|
||||||
|
fi
|
||||||
|
echo -e "\toption\tmacaddr\t$mac" > /etc/aredn_include/fixedmac.$i
|
||||||
|
list="$list#$mac#"
|
||||||
|
fi
|
||||||
|
done
|
|
@ -1,14 +1,16 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# extract auto-generated first boot switch config settings
|
# extract auto-generated first boot switch config settings
|
||||||
# and store them for future use. Support advanced user overrides.
|
# and store them for future use. Support advanced user overrides.
|
||||||
|
ainclude="/etc/aredn_include"
|
||||||
|
mkdir -p $ainclude
|
||||||
|
|
||||||
if [ -f /etc/aredn_include/swconfig.user ]
|
if [ -f /etc/aredn_include/swconfig.user ]
|
||||||
then
|
then
|
||||||
cp /etc/aredn_include/swconfig.user /etc/aredn_include/swconfig
|
cp /etc/aredn_include/swconfig.user /etc/aredn_include/swconfig
|
||||||
fi
|
fi
|
||||||
if [ ! -f /etc/aredn_include/swconfig ]
|
if [ ! -f /etc/aredn_include/swconfig ]
|
||||||
then
|
then
|
||||||
mkdir -p /etc/aredn_include
|
touch $ainclude/swconfig
|
||||||
touch /etc/aredn_include/swconfig
|
|
||||||
i=0
|
i=0
|
||||||
while true; do
|
while true; do
|
||||||
uci -q get network.\@switch\[$i\] > /dev/null
|
uci -q get network.\@switch\[$i\] > /dev/null
|
||||||
|
@ -17,11 +19,11 @@ then
|
||||||
then
|
then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
echo "config switch" >> /etc/aredn_include/swconfig
|
echo "config switch" >> $ainclude/swconfig
|
||||||
echo " option name '`uci -q get network.\@switch\[$i\].name`'" >> /etc/aredn_include/swconfig
|
echo " option name '`uci -q get network.\@switch\[$i\].name`'" >> $ainclude/swconfig
|
||||||
echo " option reset '`uci -q get network.\@switch\[$i\].reset`'" >> /etc/aredn_include/swconfig
|
echo " option reset '`uci -q get network.\@switch\[$i\].reset`'" >> $ainclude/swconfig
|
||||||
echo " option enable_vlan '`uci -q get network.\@switch\[$i\].enable_vlan`'" >> /etc/aredn_include/swconfig
|
echo " option enable_vlan '`uci -q get network.\@switch\[$i\].enable_vlan`'" >> $ainclude/swconfig
|
||||||
echo "" >> /etc/aredn_include/swconfig
|
echo "" >> $ainclude/swconfig
|
||||||
let i++
|
let i++
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -33,11 +35,11 @@ then
|
||||||
then
|
then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
echo "config switch_vlan" >> /etc/aredn_include/swconfig
|
echo "config switch_vlan" >> $ainclude/swconfig
|
||||||
echo " option device '`uci -q get network.\@switch_vlan\[$i\].device`'" >> /etc/aredn_include/swconfig
|
echo " option device '`uci -q get network.\@switch_vlan\[$i\].device`'" >> $ainclude/swconfig
|
||||||
echo " option vlan '`uci -q get network.\@switch_vlan\[$i\].vlan`'" >> /etc/aredn_include/swconfig
|
echo " option vlan '`uci -q get network.\@switch_vlan\[$i\].vlan`'" >> $ainclude/swconfig
|
||||||
echo " option ports '`uci -q get network.\@switch_vlan\[$i\].ports`'" >> /etc/aredn_include/swconfig
|
echo " option ports '`uci -q get network.\@switch_vlan\[$i\].ports`'" >> $ainclude/swconfig
|
||||||
echo "" >> /etc/aredn_include/swconfig
|
echo "" >> $ainclude/swconfig
|
||||||
let i++
|
let i++
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -49,29 +51,68 @@ then
|
||||||
then
|
then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
echo "config switch_port" >> /etc/aredn_include/swconfig
|
echo "config switch_port" >> $ainclude/swconfig
|
||||||
echo " option device '`uci -q get network.\@switch_port\[$i\].device`'" >> /etc/aredn_include/swconfig
|
echo " option device '`uci -q get network.\@switch_port\[$i\].device`'" >> $ainclude/swconfig
|
||||||
echo " option port '`uci -q get network.\@switch_port\[$i\].port`'" >> /etc/aredn_include/swconfig
|
echo " option port '`uci -q get network.\@switch_port\[$i\].port`'" >> $ainclude/swconfig
|
||||||
echo " option pvid '`uci -q get network.\@switch_port\[$i\].pvid`'" >> /etc/aredn_include/swconfig
|
echo " option pvid '`uci -q get network.\@switch_port\[$i\].pvid`'" >> $ainclude/swconfig
|
||||||
echo "" >> /etc/aredn_include/swconfig
|
echo "" >> $ainclude/swconfig
|
||||||
let i++
|
let i++
|
||||||
done
|
done
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# extract and store lan, wan, and dtdlink interfaces
|
||||||
|
rm -f $ainclude/*.network.config
|
||||||
|
for i in lan wan dtdlink
|
||||||
|
do
|
||||||
|
#is 1 or 2+ devices (1 device has 'option device', multiple has 'list ports' in board.json)?
|
||||||
|
device=`jsonfilter -i /etc/board.json -e @.network.$i.device 2>/dev/null`
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo " list ports '$device'" > $ainclude/$i.network.config
|
||||||
|
else
|
||||||
|
ports=`jsonfilter -q -i /etc/board.json -e @.network.$i.ports`
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
for j in `echo $ports | grep -o "[a-z0-9\.]\+" 2>/dev/null`
|
||||||
|
do
|
||||||
|
echo " list ports '$j'" >> $ainclude/$i.network.config
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
#apply any user overrides
|
||||||
|
for i in lan wan dtdlink
|
||||||
|
do
|
||||||
|
if [ -f $ainclude/$i.network.user ]; then
|
||||||
|
cp $ainclude/$i.network.user $ainclude/$i.network.config
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
#if unable to create *.network.config includes, put in a default in hopes the device ports
|
||||||
|
#will function. The correction to board.json is made in the image, in 02_networks
|
||||||
|
#
|
||||||
|
if [ ! -f $ainclude/lan.network.config ]; then
|
||||||
|
echo " list ports 'eth0'" > $ainclude/lan.network.config
|
||||||
|
fi
|
||||||
|
if [ ! -f $ainclude/wan.network.config ]; then
|
||||||
|
echo " list ports 'eth0.1'" > $ainclude/wan.network.config
|
||||||
|
fi
|
||||||
|
if [ ! -f $ainclude/dtdlink.network.config ]; then
|
||||||
|
echo " list ports 'eth0.2'" > $ainclude/dtdlink.network.config
|
||||||
|
fi
|
||||||
|
|
||||||
# Save system NET LED settings
|
# Save system NET LED settings
|
||||||
if [ ! -f /etc/aredn_include/system_netled ]
|
if [ ! -f $ainclude/system_netled ]
|
||||||
then
|
then
|
||||||
mkdir -p /etc/aredn_include
|
touch $ainclude/system_netled
|
||||||
touch /etc/aredn_include/system_netled
|
|
||||||
|
|
||||||
CFG=/etc/board.json
|
CFG=/etc/board.json
|
||||||
|
|
||||||
. /usr/share/libubox/jshn.sh
|
. /usr/share/libubox/jshn.sh
|
||||||
|
|
||||||
[ -s $CFG ] || /bin/board_detect || exit 1
|
[ -s $CFG ] || /bin/board_detect || exit 1
|
||||||
|
|
||||||
generate_led() {
|
generate_led() {
|
||||||
local key="$1"
|
local key="$1"
|
||||||
local cfg="led_$key"
|
local cfg="led_$key"
|
||||||
|
|
||||||
|
@ -89,13 +130,13 @@ generate_led() {
|
||||||
netdev)
|
netdev)
|
||||||
local device mode
|
local device mode
|
||||||
json_get_vars device mode
|
json_get_vars device mode
|
||||||
echo "config led 'led_$1'" >> /etc/aredn_include/system_netled
|
echo "config led 'led_$1'" >> $ainclude/system_netled
|
||||||
echo " option name '$name'" >> /etc/aredn_include/system_netled
|
echo " option name '$name'" >> $ainclude/system_netled
|
||||||
echo " option sysfs '$sysfs'" >> /etc/aredn_include/system_netled
|
echo " option sysfs '$sysfs'" >> $ainclude/system_netled
|
||||||
echo " option trigger 'netdev'" >> /etc/aredn_include/system_netled
|
echo " option trigger 'netdev'" >> $ainclude/system_netled
|
||||||
echo " option mode '$mode'" >> /etc/aredn_include/system_netled
|
echo " option mode '$mode'" >> $ainclude/system_netled
|
||||||
echo " option dev '$device'" >> /etc/aredn_include/system_netled
|
echo " option dev '$device'" >> $ainclude/system_netled
|
||||||
echo "" >> /etc/aredn_include/system_netled
|
echo "" >> $ainclude/system_netled
|
||||||
;;
|
;;
|
||||||
|
|
||||||
usb)
|
usb)
|
||||||
|
@ -116,12 +157,12 @@ generate_led() {
|
||||||
switch)
|
switch)
|
||||||
local port_mask speed_mask
|
local port_mask speed_mask
|
||||||
json_get_vars port_mask speed_mask
|
json_get_vars port_mask speed_mask
|
||||||
echo "config led 'led_$1'" >> /etc/aredn_include/system_netled
|
echo "config led 'led_$1'" >> $ainclude/system_netled
|
||||||
echo " option name '$name'" >> /etc/aredn_include/system_netled
|
echo " option name '$name'" >> $ainclude/system_netled
|
||||||
echo " option sysfs '$sysfs'" >> /etc/aredn_include/system_netled
|
echo " option sysfs '$sysfs'" >> $ainclude/system_netled
|
||||||
echo " option trigger '$trigger'" >> /etc/aredn_include/system_netled
|
echo " option trigger '$trigger'" >> $ainclude/system_netled
|
||||||
echo " option port_mask '$port_mask'" >> /etc/aredn_include/system_netled
|
echo " option port_mask '$port_mask'" >> $ainclude/system_netled
|
||||||
echo "" >> /etc/aredn_include/system_netled
|
echo "" >> $ainclude/system_netled
|
||||||
;;
|
;;
|
||||||
|
|
||||||
portstate)
|
portstate)
|
||||||
|
@ -137,25 +178,19 @@ generate_led() {
|
||||||
|
|
||||||
json_select ..
|
json_select ..
|
||||||
json_select ..
|
json_select ..
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
json_init
|
json_init
|
||||||
json_load "$(cat ${CFG})"
|
json_load "$(cat ${CFG})"
|
||||||
|
|
||||||
|
|
||||||
if [ ! -s /etc/aredn_include/system_netled ]; then
|
if [ ! -s $ainclude/system_netled ]; then
|
||||||
touch /etc/aredn_include/system_netled
|
touch $ainclude/system_netled
|
||||||
|
|
||||||
json_get_keys keys led
|
json_get_keys keys led
|
||||||
for key in $keys; do generate_led $key; done
|
for key in $keys; do generate_led $key; done
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
hwtype="$('/usr/local/bin/get_hardwaretype')"
|
|
||||||
touch /etc/aredn_include/bridge_ports
|
|
||||||
if [ "$hwtype" = "nanostation-m" -o "$hwtype" = "cpe220-v2" -o "$hwtype" = "cpe220-v3" -o "$hwtype" = "cpe210-v1" -o "$hwtype" = "cpe510-v1" -o "$hwtype" = "wbs210-v1" -o "$hwtype" = "wbs210-v2" -o "$hwtype" = "wbs510-v1" -o "$hwtype" = "wbs510-v2" ]; then
|
|
||||||
echo " option type 'bridge'" > /etc/aredn_include/bridge_ports
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -42,6 +42,8 @@ local hardware = {}
|
||||||
local radio_json = nil
|
local radio_json = nil
|
||||||
local board_json = nil
|
local board_json = nil
|
||||||
|
|
||||||
|
local rf_channel_map = nil
|
||||||
|
|
||||||
function hardware.get_board()
|
function hardware.get_board()
|
||||||
if not board_json then
|
if not board_json then
|
||||||
local f = io.open("/etc/board.json")
|
local f = io.open("/etc/board.json")
|
||||||
|
@ -123,6 +125,22 @@ function hardware.get_board_type()
|
||||||
return hardware.get_board().model.id
|
return hardware.get_board().model.id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function hardware.get_board_network_ifname(type)
|
||||||
|
local network = hardware.get_board().network[type]
|
||||||
|
if network then
|
||||||
|
if network.ifname then
|
||||||
|
return network.ifname
|
||||||
|
end
|
||||||
|
if network.device then
|
||||||
|
return network.device
|
||||||
|
end
|
||||||
|
if network.ports then
|
||||||
|
return table.concat(network.ports, " ")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
|
||||||
function hardware.get_type()
|
function hardware.get_type()
|
||||||
local id = hardware.get_board().model.id
|
local id = hardware.get_board().model.id
|
||||||
local type = id:match(",(.*)")
|
local type = id:match(",(.*)")
|
||||||
|
@ -151,6 +169,10 @@ function hardware.get_iface_name(name)
|
||||||
if intfname then
|
if intfname then
|
||||||
return intfname:match("^(%S+)")
|
return intfname:match("^(%S+)")
|
||||||
end
|
end
|
||||||
|
local device = cursor:get("network", name, "device")
|
||||||
|
if device then
|
||||||
|
return device
|
||||||
|
end
|
||||||
-- Now we guess
|
-- Now we guess
|
||||||
if name == "lan" then
|
if name == "lan" then
|
||||||
return "eth0"
|
return "eth0"
|
||||||
|
@ -213,19 +235,31 @@ function hardware.get_link_led()
|
||||||
end
|
end
|
||||||
|
|
||||||
function hardware.has_poe()
|
function hardware.has_poe()
|
||||||
local err, result = xpcall(
|
local board = hardware.get_board()
|
||||||
function() return hardware.get_board().gpioswitch.poe_passthrough.pin or true end,
|
if board and board.gpioswitch and board.gpioswitch.poe_passthrough and board.gpioswitch.poe_passthrough.pin then
|
||||||
function() return false end
|
return true
|
||||||
)
|
end
|
||||||
return result
|
-- Handle typo in various config files
|
||||||
|
if board and board.gpioswitch and board.gpioswitch.poe_passtrough and board.gpioswitch.poe_passtrough.pin then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
local _, count = nixio.fs.glob("/sys/class/gpio/enable-poe:*")
|
||||||
|
if count > 0 then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
function hardware.has_usb()
|
function hardware.has_usb()
|
||||||
local err, result = xpcall(
|
local board = hardware.get_board()
|
||||||
function() return hardware.get_board().gpioswitch.usb_power_switch.pin or true end,
|
if board and board.gpioswitch and board.gpioswitch.usb_power_switch and board.gpioswitch.usb_power_switch.pin then
|
||||||
function() return false end
|
return true
|
||||||
)
|
end
|
||||||
return result
|
local _, count = nixio.fs.glob("/sys/class/gpio/usb-power")
|
||||||
|
if count > 0 then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
function hardware.get_rfband()
|
function hardware.get_rfband()
|
||||||
|
@ -237,21 +271,120 @@ function hardware.get_rfband()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function hardware.get_rfbandwidths()
|
||||||
|
local radio = hardware.get_radio()
|
||||||
|
if radio.rfbandwidths then
|
||||||
|
return radio.rfbandwidths
|
||||||
|
else
|
||||||
|
return { 5, 10, 20 }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function hardware.get_default_channel()
|
function hardware.get_default_channel()
|
||||||
local radio = hardware.get_radio()
|
local radio = hardware.get_radio()
|
||||||
if radio.rfband == "900" then
|
if radio.rfband == "900" then
|
||||||
return { channel = 5, bandwidth = 5 }
|
return { channel = 5, bandwidth = 5 }
|
||||||
elseif radio.rfband == "2400" then
|
end
|
||||||
return { channel = -2, bandwidth = 10 }
|
local w = {}
|
||||||
|
for _, width in ipairs(hardware.get_rfbandwidths())
|
||||||
|
do
|
||||||
|
w[width] = true
|
||||||
|
end
|
||||||
|
local width = w[10] and 10 or w[5] and 5 or 20
|
||||||
|
if radio.rfband == "2400" then
|
||||||
|
local c = {}
|
||||||
|
for _, chan in ipairs(hardware.get_rfchannels())
|
||||||
|
do
|
||||||
|
c[chan.number] = chan
|
||||||
|
end
|
||||||
|
local chan = c[-2] and -2 or 1
|
||||||
|
return { channel = chan, bandwidth = width }
|
||||||
elseif radio.rfband == "3400" then
|
elseif radio.rfband == "3400" then
|
||||||
return { channel = 84, bandwidth = 10 }
|
return { channel = 84, bandwidth = width }
|
||||||
elseif radio.rfband == "5800ubntus" then
|
elseif radio.rfband == "5800ubntus" then
|
||||||
return { channel = 149, bandwidth = 10 }
|
return { channel = 149, bandwidth = width }
|
||||||
else
|
else
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function hardware.get_rfchannels(wifiintf)
|
||||||
|
if not rf_channel_map then
|
||||||
|
rf_channel_map = {
|
||||||
|
["900"] = {},
|
||||||
|
["2400"] = {},
|
||||||
|
["3400"] = {},
|
||||||
|
["5500"] = {},
|
||||||
|
["5800ubntus"] = {}
|
||||||
|
}
|
||||||
|
for i = 4,7
|
||||||
|
do
|
||||||
|
rf_channel_map["900"][i - 3] = { label = i .. " (" .. (887 + i * 5) .. ")", number = i, frequency = 887 + i * 5 }
|
||||||
|
end
|
||||||
|
for i = -4,11
|
||||||
|
do
|
||||||
|
rf_channel_map["2400"][i + (i <= 0 and 5 or 4)] = { label = i .. " (" .. (2407 + i * 5) .. ")", number = i, frequency = 2407 + i * 5 }
|
||||||
|
end
|
||||||
|
for i = 76,99
|
||||||
|
do
|
||||||
|
rf_channel_map["3400"][i - 75] = { label = i .. " (" .. (3000 + i * 5) .. ")", number = i, frequency = 3000 + i * 5 }
|
||||||
|
end
|
||||||
|
for i = 36,64,4
|
||||||
|
do
|
||||||
|
rf_channel_map["5500"][(i - 32) / 4] = { label = i .. " (" .. (5000 + i * 5) .. ")", number = i, frequency = 5000 + i * 5 }
|
||||||
|
end
|
||||||
|
for i = 100,140,4
|
||||||
|
do
|
||||||
|
rf_channel_map["5500"][(i - 64) / 4] = { label = i .. " (" .. (5000 + i * 5) .. ")", number = i, frequency = 5000 + i * 5 }
|
||||||
|
end
|
||||||
|
for i = 149,165,4
|
||||||
|
do
|
||||||
|
rf_channel_map["5500"][(i - 69) / 4] = { label = i .. " (" .. (5000 + i * 5) .. ")", number = i, frequency = 5000 + i * 5 }
|
||||||
|
end
|
||||||
|
for i = 131,184
|
||||||
|
do
|
||||||
|
rf_channel_map["5800ubntus"][i - 130] = { label = i .. " (" .. (5000 + i * 5) .. ")", number = i, frequency = 5000 + i * 5 }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local channels = {}
|
||||||
|
local rfband = hardware.get_rfband()
|
||||||
|
if rfband and rf_channel_map[rfband] then
|
||||||
|
channels = rf_channel_map[rfband]
|
||||||
|
else
|
||||||
|
local f = io.popen("iwinfo " .. wifiintf .. " freqlist")
|
||||||
|
if f then
|
||||||
|
for line in f:lines()
|
||||||
|
do
|
||||||
|
local freq, num = line:match("(%d+%.%d+) GHz %(Channel (%d+)%)")
|
||||||
|
if freq and not line:match("restricted") then
|
||||||
|
freq = freq:gsub("%.", "")
|
||||||
|
num = num:gsub("^0+", "")
|
||||||
|
channels[#channels + 1] = {
|
||||||
|
label = num .. " (" .. freq .. ")",
|
||||||
|
number = tonumber(num),
|
||||||
|
frequency = freq
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
f:close()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local radio = hardware.get_radio()
|
||||||
|
if radio.rfblocked then
|
||||||
|
for _, chan in ipairs(radio.rfblocked)
|
||||||
|
do
|
||||||
|
for idx, channel in ipairs(channels)
|
||||||
|
do
|
||||||
|
if channel.number == chan then
|
||||||
|
table.remove(channels, idx)
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return channels
|
||||||
|
end
|
||||||
|
|
||||||
function hardware.supported()
|
function hardware.supported()
|
||||||
local radio = hardware.get_radio()
|
local radio = hardware.get_radio()
|
||||||
if radio then
|
if radio then
|
||||||
|
|
|
@ -189,6 +189,7 @@ function model.getSSID()
|
||||||
for pos, t in pairs(wif) do
|
for pos, t in pairs(wif) do
|
||||||
if wif[pos]['network']=="wifi" then
|
if wif[pos]['network']=="wifi" then
|
||||||
myssid=wif[pos]['ssid']
|
myssid=wif[pos]['ssid']
|
||||||
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return myssid
|
return myssid
|
||||||
|
@ -205,6 +206,7 @@ function model.getMeshRadioDevice()
|
||||||
for pos,i in pairs(wifiinterfaces) do
|
for pos,i in pairs(wifiinterfaces) do
|
||||||
if wifiinterfaces[pos]['mode']=="adhoc" then
|
if wifiinterfaces[pos]['mode']=="adhoc" then
|
||||||
radio=wifiinterfaces[pos]['device']
|
radio=wifiinterfaces[pos]['device']
|
||||||
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return radio
|
return radio
|
||||||
|
@ -218,6 +220,7 @@ function model.isMeshRadioEnabled(radio)
|
||||||
for pos,i in pairs(wifidevice) do
|
for pos,i in pairs(wifidevice) do
|
||||||
if wifidevice[pos]['.name']==radio then
|
if wifidevice[pos]['.name']==radio then
|
||||||
disabled=wifidevice[pos]['disabled']
|
disabled=wifidevice[pos]['disabled']
|
||||||
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -237,6 +240,7 @@ function model.getMeshRadioDistance(radio)
|
||||||
for pos,i in pairs(wifidevice) do
|
for pos,i in pairs(wifidevice) do
|
||||||
if wifidevice[pos]['.name']==radio then
|
if wifidevice[pos]['.name']==radio then
|
||||||
distance=wifidevice[pos]['distance']
|
distance=wifidevice[pos]['distance']
|
||||||
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return distance
|
return distance
|
||||||
|
|
|
@ -42,6 +42,7 @@ function log.open(name, maxsize)
|
||||||
l.logfile = name
|
l.logfile = name
|
||||||
l.logmax = maxsize
|
l.logmax = maxsize
|
||||||
l.logf = nil
|
l.logf = nil
|
||||||
|
l.prefix = nil
|
||||||
return l
|
return l
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -49,7 +50,11 @@ function log:write(str)
|
||||||
if not self.logf then
|
if not self.logf then
|
||||||
self.logf = io.open(self.logfile, "a")
|
self.logf = io.open(self.logfile, "a")
|
||||||
end
|
end
|
||||||
self.logf:write(string.format("%s: %s\n", os.date("%m/%d %H:%M:%S", os.time()), str))
|
local pstr = ""
|
||||||
|
if self.prefix then
|
||||||
|
pstr = self.prefix .. ": "
|
||||||
|
end
|
||||||
|
self.logf:write(string.format("%s: %s%s\n", os.date("%m/%d %H:%M:%S", os.time()), pstr, str))
|
||||||
if self.logf:seek() > self.logmax then
|
if self.logf:seek() > self.logmax then
|
||||||
self:flush(true)
|
self:flush(true)
|
||||||
end
|
end
|
||||||
|
|
|
@ -35,7 +35,6 @@
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
require("aredn.utils")
|
require("aredn.utils")
|
||||||
require("luci.sys")
|
|
||||||
|
|
||||||
local tools = {}
|
local tools = {}
|
||||||
|
|
||||||
|
@ -125,7 +124,7 @@ function tools.getIperf3(target, protocol)
|
||||||
local summary = { protocol = protocol, client = {}, server = {}, sender = {}, receiver = {} }
|
local summary = { protocol = protocol, client = {}, server = {}, sender = {}, receiver = {} }
|
||||||
local trace = {}
|
local trace = {}
|
||||||
-- start remote server
|
-- start remote server
|
||||||
luci.sys.httpget("http://" .. target .. ":8080/cgi-bin/iperf?server=")
|
os.execute("wget -q 'http://" .. target .. ":8080/cgi-bin/iperf?server=' > /dev/null 2>&1")
|
||||||
local output = capture("/usr/bin/iperf3 -b 0 -c " .. target .. (protocol == "udp" and " -u" or "") .. " 2>&1")
|
local output = capture("/usr/bin/iperf3 -b 0 -c " .. target .. (protocol == "udp" and " -u" or "") .. " 2>&1")
|
||||||
for _, line in ipairs(output:splitNewLine())
|
for _, line in ipairs(output:splitNewLine())
|
||||||
do
|
do
|
||||||
|
|
|
@ -156,6 +156,9 @@ end
|
||||||
function get_ifname(ifn)
|
function get_ifname(ifn)
|
||||||
local u=uci.cursor()
|
local u=uci.cursor()
|
||||||
local iface=u:get("network",ifn,"ifname")
|
local iface=u:get("network",ifn,"ifname")
|
||||||
|
if not iface then
|
||||||
|
iface=u:get("network",ifn,"device")
|
||||||
|
end
|
||||||
return iface
|
return iface
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -260,6 +263,9 @@ function iplookup(host)
|
||||||
end
|
end
|
||||||
local nso=capture("nslookup "..host)
|
local nso=capture("nslookup "..host)
|
||||||
local ip=nso:match("Address 1: (.*)%c")
|
local ip=nso:match("Address 1: (.*)%c")
|
||||||
|
if not ip then
|
||||||
|
ip=nso:match("Address: ([%d%.]+)")
|
||||||
|
end
|
||||||
return ip
|
return ip
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
-- Fake
|
|
@ -41,7 +41,7 @@ ping -q -W10 -c1 downloads.arednmesh.org > /dev/null &&
|
||||||
|
|
||||||
nodename=$(echo "$HOSTNAME" | tr 'A-Z' 'a-z')
|
nodename=$(echo "$HOSTNAME" | tr 'A-Z' 'a-z')
|
||||||
|
|
||||||
if [ $online = "true" ]
|
if [ "$online" = "true" ]
|
||||||
then
|
then
|
||||||
# fetch node specific message file
|
# fetch node specific message file
|
||||||
wget -q -O aredn_message -P /tmp http://downloads.arednmesh.org/messages/"${nodename}".txt &&
|
wget -q -O aredn_message -P /tmp http://downloads.arednmesh.org/messages/"${nodename}".txt &&
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
require("aredn.utils")
|
require("aredn.utils")
|
||||||
local aredn_info = require("aredn.info")
|
local aredn_info = require("aredn.info")
|
||||||
require("aredn.hardware")
|
require("aredn.hardware")
|
||||||
require("luci.sys")
|
|
||||||
require("uci")
|
require("uci")
|
||||||
|
|
||||||
local needsrun = aredn_info.get_nvram("nodeupgraded")
|
local needsrun = aredn_info.get_nvram("nodeupgraded")
|
||||||
|
@ -127,4 +126,4 @@ os.execute("/usr/local/bin/node-setup -a mesh")
|
||||||
|
|
||||||
aredn_info.set_nvram("nodeupgraded", "0")
|
aredn_info.set_nvram("nodeupgraded", "0")
|
||||||
print "Rebooting node"
|
print "Rebooting node"
|
||||||
luci.sys.reboot()
|
os.execute("reboot >/dev/null 2>&1")
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
#!/bin/sh
|
true <<'LICENSE'
|
||||||
<<'LICENSE'
|
|
||||||
Part of AREDN -- Used for creating Amateur Radio Emergency Data Networks
|
Part of AREDN -- Used for creating Amateur Radio Emergency Data Networks
|
||||||
Copyright (C) 2015 Conrad Lara
|
Copyright (C) 2022 Tim Wilkinson
|
||||||
See Contributors file for additional contributors
|
See Contributors file for additional contributors
|
||||||
|
|
||||||
Copyright (c) 2013 David Rivenburg et al. BroadBand-HamNet
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -35,12 +32,21 @@
|
||||||
|
|
||||||
LICENSE
|
LICENSE
|
||||||
|
|
||||||
[ -f /etc/config/run-fccid ] || exit
|
#
|
||||||
|
# Pre-upgrade special cases
|
||||||
|
#
|
||||||
|
case "$(/usr/local/bin/get_boardid)" in
|
||||||
|
MikroTik\ hAP\ ac3)
|
||||||
|
# If we're running from RAM we must now format the flash otherwise
|
||||||
|
# the install will fail
|
||||||
|
if [ "$(cat /proc/mounts | grep overlay)" = "" ]; then
|
||||||
|
ubidetach -m 1
|
||||||
|
ubiformat /dev/mtd1 -y
|
||||||
|
ubiattach -m 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
wifiif=$(uci -q get 'network.wifi.ifname')
|
/sbin/sysupgrade $*
|
||||||
|
|
||||||
# stagger the beacons between nodes
|
|
||||||
N=$(ifconfig "$wifiif" | grep "inet addr" | cut -f4 -d. | cut -c1-3)
|
|
||||||
sleep "$N"
|
|
||||||
|
|
||||||
echo "ID: $(uname -n)" | socat - udp4:10.255.255.255:4919,broadcast,so-bindtodevice="$wifiif"
|
|
|
@ -1,84 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
true <<'LICENSE'
|
|
||||||
Part of AREDN -- Used for creating Amateur Radio Emergency Data Networks
|
|
||||||
Copyright (C) 2018 Joe Ayers AE6XE
|
|
||||||
See Contributors file for additional contributors
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation version 3 of the License.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Additional Terms:
|
|
||||||
|
|
||||||
Additional use restrictions exist on the AREDN(TM) trademark and logo.
|
|
||||||
See AREDNLicense.txt for more info.
|
|
||||||
|
|
||||||
Attributions to the AREDN Project must be retained in the source code.
|
|
||||||
If importing this code into a new or existing project attribution
|
|
||||||
to the AREDN project must be added to the source code.
|
|
||||||
|
|
||||||
You must not misrepresent the origin of the material contained within.
|
|
||||||
|
|
||||||
Modified versions must be modified to attribute to the original source
|
|
||||||
and be marked in reasonable ways as differentiate it from the original
|
|
||||||
version.
|
|
||||||
|
|
||||||
LICENSE
|
|
||||||
|
|
||||||
# Look for hung 'iw' zombie processes prone to hang
|
|
||||||
# when available memory is low.
|
|
||||||
|
|
||||||
# if Mesh RF is disabled, then nothing to do
|
|
||||||
iface=$(uci -q get 'network.wifi.ifname')
|
|
||||||
if [ "$iface" = "${iface##wlan*}" ]; then
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
zombiepid="/tmp/clean_zombie.pid"
|
|
||||||
|
|
||||||
[ -e $zombiepid ] && [ -d "/proc/$(cat $zombiepid)" ] && exit
|
|
||||||
|
|
||||||
echo "$$" > $zombiepid
|
|
||||||
|
|
||||||
# wait for rssi_monitor and snrlog to run
|
|
||||||
sleep 20;
|
|
||||||
|
|
||||||
for pid in $(ps | grep -E "^\s*\d+\s+root\s+\d+\s+Z\s+\[iw\]"| sed -e "s/^\s*//"| cut -f1 -d\ )
|
|
||||||
do
|
|
||||||
|
|
||||||
# found an "iw" zombie
|
|
||||||
sleep 10 # in case process is naturally closing and needs more time
|
|
||||||
if [ -d "/proc/$pid" ] ; then
|
|
||||||
date >> /tmp/zombie.log
|
|
||||||
ps | grep -E "^\s*${pid}\s+" | grep -v grep | tail -1 >> /tmp/zombie.log
|
|
||||||
ppid="$(grep -i ppid < /proc/"$pid"/status | cut -f2)"
|
|
||||||
if [ -d "/proc/$ppid" ] ; then
|
|
||||||
ps | grep -E "^\s*${ppid}\s+" | grep -v grep | tail -1 >> /tmp/zombie.log
|
|
||||||
grep crond /proc/"$ppid"/status 2>&1 > /dev/null
|
|
||||||
if [ $? -ne 0 -a "$ppid" -gt 1 ]; then
|
|
||||||
|
|
||||||
# kill the zombie's parent process to free up resources
|
|
||||||
kill -9 "$ppid" 2>&1 >> /tmp/zombie.log
|
|
||||||
echo "Killed $ppid" >> /tmp/zombie.log
|
|
||||||
if [ "$(wc -l /tmp/zombie.log | cut -f1 -d\ )" -gt 300 ] ; then
|
|
||||||
|
|
||||||
# keep file size in check
|
|
||||||
cp /tmp/zombie.log /tmp/zombie.tmp
|
|
||||||
tail -275 /tmp/zombie.tmp > /tmp/zombie.log
|
|
||||||
rm -f /tmp/zombie.tmp
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
echo "" >> /tmp/zombie.log
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
rm $zombiepid
|
|
|
@ -57,18 +57,18 @@ function exit_app()
|
||||||
coroutine.yield('exit')
|
coroutine.yield('exit')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
mainlog = aredn.log.open("/tmp/manager.log", 8000)
|
||||||
|
|
||||||
-- Load management tasks
|
-- Load management tasks
|
||||||
local tasks = {}
|
local tasks = {}
|
||||||
for name in nixio.fs.dir("/usr/local/bin/mgr")
|
for name in nixio.fs.dir("/usr/local/bin/mgr")
|
||||||
do
|
do
|
||||||
local task = name:match("^(.+)%.lua$")
|
local task = name:match("^(.+)%.lua$")
|
||||||
if task then
|
if task then
|
||||||
tasks[#tasks + 1] = { app = require("mgr." .. task) }
|
tasks[#tasks + 1] = { name = task, app = require("mgr." .. task) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local log = aredn.log.open("/tmp/manager.log", 8000)
|
|
||||||
|
|
||||||
for i, task in ipairs(tasks)
|
for i, task in ipairs(tasks)
|
||||||
do
|
do
|
||||||
task.routine = coroutine.create(task.app)
|
task.routine = coroutine.create(task.app)
|
||||||
|
@ -80,10 +80,11 @@ do
|
||||||
for i, task in ipairs(tasks)
|
for i, task in ipairs(tasks)
|
||||||
do
|
do
|
||||||
if task.time <= os.time() then
|
if task.time <= os.time() then
|
||||||
|
mainlog.prefix = task.name
|
||||||
local status, newdelay = coroutine.resume(task.routine)
|
local status, newdelay = coroutine.resume(task.routine)
|
||||||
if not status then
|
if not status then
|
||||||
log:write(newdelay) -- error message
|
mainlog:write(newdelay) -- error message
|
||||||
log:flush()
|
mainlog:flush()
|
||||||
task.routine = coroutine.create(task.app)
|
task.routine = coroutine.create(task.app)
|
||||||
task.time = 120 + os.time() -- 2 minute restart delay
|
task.time = 120 + os.time() -- 2 minute restart delay
|
||||||
elseif not newdelay then
|
elseif not newdelay then
|
||||||
|
@ -91,9 +92,12 @@ do
|
||||||
elseif newdelay == "exit" then
|
elseif newdelay == "exit" then
|
||||||
task.routine = null
|
task.routine = null
|
||||||
task.time = math.huge
|
task.time = math.huge
|
||||||
|
mainlog:write("Terminating manager task: " .. task.name)
|
||||||
|
mainlog:flush()
|
||||||
else
|
else
|
||||||
task.time = newdelay + os.time()
|
task.time = newdelay + os.time()
|
||||||
end
|
end
|
||||||
|
mainlog.prefix = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
table.sort(tasks, function(a,b) return a.time < b.time end)
|
table.sort(tasks, function(a,b) return a.time < b.time end)
|
||||||
|
|
|
@ -37,7 +37,8 @@ function aredn_message()
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
os.execute("/usr/local/bin/aredn_message.sh")
|
os.execute("/usr/local/bin/aredn_message.sh")
|
||||||
local pollrate = tonumber(uci.cursor():get("aredn", "@alerts[0]", "pollrate"))
|
local pollrate = uci.cursor():get("aredn", "@alerts[0]", "pollrate")
|
||||||
|
pollrate = tonumber(pollrate)
|
||||||
if not pollrate or pollrate <= 0 then
|
if not pollrate or pollrate <= 0 then
|
||||||
pollrate = 12 -- 12 hour default
|
pollrate = 12 -- 12 hour default
|
||||||
end
|
end
|
||||||
|
|
|
@ -42,11 +42,11 @@ function fccid()
|
||||||
local udp = socket.udp()
|
local udp = socket.udp()
|
||||||
udp:setoption("broadcast", true)
|
udp:setoption("broadcast", true)
|
||||||
udp:setsockname(ip, 4919)
|
udp:setsockname(ip, 4919)
|
||||||
udp:setpeername("10.255.255.255", 4919)
|
--udp:setpeername("10.255.255.255", 4919)
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
if nixio.fs.stat("/etc/config/run-fccid") then
|
if nixio.fs.stat("/etc/config/run-fccid") then
|
||||||
udp:send(id)
|
udp:sendto(id, "10.255.255.255", 4919)
|
||||||
end
|
end
|
||||||
wait_for_ticks(5 * 60) -- 5 minutes
|
wait_for_ticks(5 * 60) -- 5 minutes
|
||||||
end
|
end
|
||||||
|
|
|
@ -46,7 +46,7 @@ local tx_quality_run_avg = 0.8 -- tx quality running average
|
||||||
local ping_timeout = 1.0 -- timeout before ping gives a qualtiy penalty
|
local ping_timeout = 1.0 -- timeout before ping gives a qualtiy penalty
|
||||||
local dtd_distance = 50 -- distance (meters) after which nodes connected with DtD links are considered different sites
|
local dtd_distance = 50 -- distance (meters) after which nodes connected with DtD links are considered different sites
|
||||||
|
|
||||||
local IPTABLES = "/usr/sbin/iptables"
|
local NFT = "/usr/sbin/nft"
|
||||||
local IW = "/usr/sbin/iw"
|
local IW = "/usr/sbin/iw"
|
||||||
local ARPING = "/usr/sbin/arping"
|
local ARPING = "/usr/sbin/arping"
|
||||||
|
|
||||||
|
@ -115,30 +115,43 @@ function should_ping(track)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function nft_handle(list, query)
|
||||||
|
for line in io.popen(NFT .. " -a list chain ip fw4 " .. list):lines()
|
||||||
|
do
|
||||||
|
local handle = line:match(query .. "%s*# handle (%d+)")
|
||||||
|
if handle then
|
||||||
|
return handle
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
function update_block(track)
|
function update_block(track)
|
||||||
if should_block(track) then
|
if should_block(track) then
|
||||||
track.blocked = true
|
track.blocked = true
|
||||||
if track.type == "Tunnel" then
|
if track.type == "Tunnel" then
|
||||||
if os.execute(IPTABLES .. " -C input_lqm -p udp --destination-port 698 --in-interface " .. track.device .. " -j DROP 2> /dev/null") ~= 0 then
|
if not nft_handle("input_lqm", "iifname \\\"" .. trace.device .. "\\\" udp dport 698 .* drop") then
|
||||||
os.execute(IPTABLES .. " -I input_lqm -p udp --destination-port 698 --in-interface " .. track.device .. " -j DROP 2> /dev/null")
|
os.execute(NFT .. " insert rule ip fw4 input_lqm iifname \\\"" .. track.device .. "\\\" udp dport 698 counter drop 2> /dev/null")
|
||||||
return "blocked"
|
return "blocked"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if os.execute(IPTABLES .. " -C input_lqm -p udp --destination-port 698 -m mac --mac-source " .. track.mac .. " -j DROP 2> /dev/null") ~= 0 then
|
if not nft_handle("input_lqm", "udp dport 698 ether saddr " .. track.mac:lower() .. " .* drop") then
|
||||||
os.execute(IPTABLES .. " -I input_lqm -p udp --destination-port 698 -m mac --mac-source " .. track.mac .. " -j DROP 2> /dev/null")
|
os.execute(NFT .. " insert rule ip fw4 input_lqm udp dport 698 ether saddr " .. track.mac .. " counter drop 2> /dev/null")
|
||||||
return "blocked"
|
return "blocked"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
track.blocked = false
|
track.blocked = false
|
||||||
if track.type == "Tunnel" then
|
if track.type == "Tunnel" then
|
||||||
if os.execute(IPTABLES .. " -C input_lqm -p udp --destination-port 698 --in-interface " .. track.device .. " -j DROP 2> /dev/null") == 0 then
|
local handle = nft_handle("input_lqm", "iifname \\\"" .. track.device .. "\\\" udp dport 698 .* drop")
|
||||||
os.execute(IPTABLES .. " -D input_lqm -p udp --destination-port 698 --in-interface " .. track.device .. " -j DROP 2> /dev/null")
|
if handle then
|
||||||
return "blocked"
|
os.execute(NFT .. " delete rule ip fw4 input_lqm handle " .. handle)
|
||||||
|
return "unblocked"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if os.execute(IPTABLES .. " -C input_lqm -p udp --destination-port 698 -m mac --mac-source " .. track.mac .. " -j DROP 2> /dev/null") == 0 then
|
local handle = nft_handle("input_lqm", "udp dport 698 ether saddr " .. track.mac:lower() .. " .* drop")
|
||||||
os.execute(IPTABLES .. " -D input_lqm -p udp --destination-port 698 -m mac --mac-source " .. track.mac .. " -j DROP 2> /dev/null")
|
if handle then
|
||||||
|
os.execute(NFT .. " delete rule ip fw4 input_lqm handle " .. handle)
|
||||||
return "unblocked"
|
return "unblocked"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -148,8 +161,14 @@ end
|
||||||
|
|
||||||
function force_remove_block(track)
|
function force_remove_block(track)
|
||||||
track.blocked = false
|
track.blocked = false
|
||||||
os.execute(IPTABLES .. " -D input_lqm -p udp --destination-port 698 -m mac --mac-source " .. track.mac .. " -j DROP 2> /dev/null")
|
local handle = nft_handle("input_lqm", "udp dport 698 ether saddr " .. track.mac:lower() .. " .* drop")
|
||||||
os.execute(IPTABLES .. " -D input_lqm -p udp --destination-port 698 --in-interface " .. track.device .. " -j DROP 2> /dev/null")
|
if handle then
|
||||||
|
os.execute(NFT .. " delete rule ip fw4 input_lqm handle " .. handle)
|
||||||
|
end
|
||||||
|
handle = nft_handle("input_lqm", "iifname \\\"" .. track.device .. "\\\" udp dport 698 .* drop")
|
||||||
|
if handle then
|
||||||
|
os.execute(NFT .. " delete rule ip fw4 input_lqm handle " .. handle)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Distance in meters between two points
|
-- Distance in meters between two points
|
||||||
|
@ -179,7 +198,7 @@ do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local phy = "phy" .. radioname:match("radio(%d+)")
|
local phy = "phy" .. radioname:match("radio(%d+)")
|
||||||
local wlan = cursor:get("network", "wifi", "ifname")
|
local wlan = aredn.hardware.get_board_network_ifname("wifi")
|
||||||
|
|
||||||
function lqm()
|
function lqm()
|
||||||
|
|
||||||
|
@ -192,14 +211,17 @@ function lqm()
|
||||||
wait_for_ticks(math.max(1, 30 - nixio.sysinfo().uptime))
|
wait_for_ticks(math.max(1, 30 - nixio.sysinfo().uptime))
|
||||||
|
|
||||||
-- Create filters (cannot create during install as they disappear on reboot)
|
-- Create filters (cannot create during install as they disappear on reboot)
|
||||||
os.execute(IPTABLES .. " -F input_lqm 2> /dev/null")
|
os.execute(NFT .. " flush chain ip fw4 input_lqm 2> /dev/null")
|
||||||
os.execute(IPTABLES .. " -X input_lqm 2> /dev/null")
|
os.execute(NFT .. " delete chain ip fw4 input_lqm 2> /dev/null")
|
||||||
os.execute(IPTABLES .. " -N input_lqm 2> /dev/null")
|
os.execute(NFT .. " add chain ip fw4 input_lqm 2> /dev/null")
|
||||||
os.execute(IPTABLES .. " -D INPUT -j input_lqm -m comment --comment 'block low quality links' 2> /dev/null")
|
local handle = nft_handle("input", "jump input_lqm comment")
|
||||||
os.execute(IPTABLES .. " -I INPUT -j input_lqm -m comment --comment 'block low quality links' 2> /dev/null")
|
if handle then
|
||||||
|
os.execute(NFT .. " delete rule ip fw4 input handle " .. handle)
|
||||||
|
end
|
||||||
|
os.execute(NFT .. " insert rule ip fw4 input counter jump input_lqm comment \\\"block low quality links\\\"")
|
||||||
|
|
||||||
-- We dont know any distances yet
|
-- We dont know any distances yet
|
||||||
os.execute(IW .. " " .. phy .. " set distance auto")
|
os.execute(IW .. " " .. phy .. " set distance auto > /dev/null 2>&1")
|
||||||
|
|
||||||
-- Setup a first_run timeout if this is our first every run
|
-- Setup a first_run timeout if this is our first every run
|
||||||
if cursor:get("aredn", "@lqm[0]", "first_run") == "0" then
|
if cursor:get("aredn", "@lqm[0]", "first_run") == "0" then
|
||||||
|
@ -208,6 +230,7 @@ function lqm()
|
||||||
first_run_timeout = first_run_timeout + nixio.sysinfo().uptime
|
first_run_timeout = first_run_timeout + nixio.sysinfo().uptime
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local noise = -95
|
||||||
local tracker = {}
|
local tracker = {}
|
||||||
local dtdlinks = {}
|
local dtdlinks = {}
|
||||||
while true
|
while true
|
||||||
|
@ -216,8 +239,10 @@ function lqm()
|
||||||
|
|
||||||
local config = get_config()
|
local config = get_config()
|
||||||
|
|
||||||
local lat = tonumber(cursor:get("aredn", "@location[0]", "lat"))
|
local lat = cursor:get("aredn", "@location[0]", "lat")
|
||||||
local lon = tonumber(cursor:get("aredn", "@location[0]", "lon"))
|
local lon = cursor:get("aredn", "@location[0]", "lon")
|
||||||
|
lat = tonumber(lat)
|
||||||
|
lon = tonumber(lon)
|
||||||
|
|
||||||
local arps = {}
|
local arps = {}
|
||||||
arptable(
|
arptable(
|
||||||
|
@ -247,7 +272,10 @@ function lqm()
|
||||||
["tx failed:"] = "tx_fail"
|
["tx failed:"] = "tx_fail"
|
||||||
}
|
}
|
||||||
local station = {}
|
local station = {}
|
||||||
local noise = iwinfo.nl80211.noise(wlan) or -95
|
local cnoise = iwinfo.nl80211.noise(wlan)
|
||||||
|
if cnoise and cnoise < -70 then
|
||||||
|
noise = math.ceil(noise * 0.9 + cnoise * 0.1)
|
||||||
|
end
|
||||||
for line in io.popen(IW .. " " .. wlan .. " station dump"):lines()
|
for line in io.popen(IW .. " " .. wlan .. " station dump"):lines()
|
||||||
do
|
do
|
||||||
local mac = line:match("^Station ([0-9a-f:]+) ")
|
local mac = line:match("^Station ([0-9a-f:]+) ")
|
||||||
|
@ -463,7 +491,7 @@ function lqm()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if track.type == "RF" then
|
if track.type == "RF" then
|
||||||
if info.lqm and info.lqm.enabled then
|
if info.lqm and info.lqm.enabled and info.lqm.info.trackers then
|
||||||
for _, rtrack in pairs(info.lqm.info.trackers)
|
for _, rtrack in pairs(info.lqm.info.trackers)
|
||||||
do
|
do
|
||||||
if myhostname == rtrack.hostname and (not rtrack.type or rtrack.type == "RF") then
|
if myhostname == rtrack.hostname and (not rtrack.type or rtrack.type == "RF") then
|
||||||
|
@ -776,14 +804,14 @@ function lqm()
|
||||||
-- Update the wifi distance
|
-- Update the wifi distance
|
||||||
if distance > 0 then
|
if distance > 0 then
|
||||||
coverage = math.min(255, math.floor((distance * 2 * 0.0033) / 3)) -- airtime
|
coverage = math.min(255, math.floor((distance * 2 * 0.0033) / 3)) -- airtime
|
||||||
os.execute(IW .. " " .. phy .. " set coverage " .. coverage)
|
os.execute(IW .. " " .. phy .. " set coverage " .. coverage .. " > /dev/null 2>&1")
|
||||||
elseif alt_distance > 1 then
|
elseif alt_distance > 1 then
|
||||||
coverage = math.min(255, math.floor((alt_distance * 2 * 0.0033) / 3))
|
coverage = math.min(255, math.floor((alt_distance * 2 * 0.0033) / 3))
|
||||||
os.execute(IW .. " " .. phy .. " set coverage " .. coverage)
|
os.execute(IW .. " " .. phy .. " set coverage " .. coverage .. " > /dev/null 2>&1")
|
||||||
elseif config.auto_distance > 0 then
|
elseif config.auto_distance > 0 then
|
||||||
os.execute(IW .. " " .. phy .. " set distance " .. config.auto_distance)
|
os.execute(IW .. " " .. phy .. " set distance " .. config.auto_distance .. " > /dev/null 2>&1")
|
||||||
else
|
else
|
||||||
os.execute(IW .. " " .. phy .. " set distance auto")
|
os.execute(IW .. " " .. phy .. " set distance auto > /dev/null 2>&1")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Save this for the UI
|
-- Save this for the UI
|
||||||
|
|
|
@ -0,0 +1,89 @@
|
||||||
|
--[[
|
||||||
|
|
||||||
|
Part of AREDN -- Used for creating Amateur Radio Emergency Data Networks
|
||||||
|
Copyright (C) 2022 Tim Wilkinson
|
||||||
|
See Contributors file for additional contributors
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation version 3 of the License.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Additional Terms:
|
||||||
|
|
||||||
|
Additional use restrictions exist on the AREDN(TM) trademark and logo.
|
||||||
|
See AREDNLicense.txt for more info.
|
||||||
|
|
||||||
|
Attributions to the AREDN Project must be retained in the source code.
|
||||||
|
If importing this code into a new or existing project attribution
|
||||||
|
to the AREDN project must be added to the source code.
|
||||||
|
|
||||||
|
You must not misrepresent the origin of the material contained within.
|
||||||
|
|
||||||
|
Modified versions must be modified to attribute to the original source
|
||||||
|
and be marked in reasonable ways as differentiate it from the original
|
||||||
|
version
|
||||||
|
|
||||||
|
--]]
|
||||||
|
|
||||||
|
local wifiiface
|
||||||
|
|
||||||
|
function rssi_monitor_10k()
|
||||||
|
if string.match(get_ifname("wifi"), "^eth.") then
|
||||||
|
exit_app()
|
||||||
|
else
|
||||||
|
wait_for_ticks(math.max(1, 120 - nixio.sysinfo().uptime))
|
||||||
|
|
||||||
|
wifiiface = get_ifname("wifi")
|
||||||
|
|
||||||
|
-- ath10k only
|
||||||
|
local phy = iwinfo.nl80211.phyname(wifiiface)
|
||||||
|
if not nixio.fs.stat("/sys/kernel/debug/ieee80211/" .. phy .. "/ath10k") then
|
||||||
|
exit_app()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
while true
|
||||||
|
do
|
||||||
|
run_monitor_10k()
|
||||||
|
wait_for_ticks(60) -- 1 minute
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local logfile = "/tmp/rssi_ath10k.log"
|
||||||
|
|
||||||
|
if not file_exists(logfile) then
|
||||||
|
io.open(logfile, "w+"):close()
|
||||||
|
end
|
||||||
|
|
||||||
|
local last_station_count = 0
|
||||||
|
local log = aredn.log.open(logfile, 16000)
|
||||||
|
|
||||||
|
function run_monitor_10k()
|
||||||
|
|
||||||
|
local station_count = 0
|
||||||
|
local stations = iwinfo.nl80211.assoclist(wifiiface)
|
||||||
|
for mac, station in pairs(stations)
|
||||||
|
do
|
||||||
|
station_count = station_count + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if station_count == 0 and last_station_count ~= 0 then
|
||||||
|
-- reset
|
||||||
|
os.execute("/usr/sbin/iw " .. wifiiface .. " scan > /dev/null 2>&1")
|
||||||
|
wait_for_ticks(5)
|
||||||
|
log:write("No stations detected")
|
||||||
|
log:flush()
|
||||||
|
end
|
||||||
|
last_station_count = station_count
|
||||||
|
end
|
||||||
|
|
||||||
|
return rssi_monitor_10k
|
|
@ -34,14 +34,32 @@
|
||||||
|
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
function rssi_monitor()
|
local wifiiface
|
||||||
|
local phy
|
||||||
|
local multiple_ant = false
|
||||||
|
|
||||||
|
function rssi_monitor_9k()
|
||||||
if string.match(get_ifname("wifi"), "^eth.") then
|
if string.match(get_ifname("wifi"), "^eth.") then
|
||||||
exit_app()
|
exit_app()
|
||||||
else
|
else
|
||||||
wait_for_ticks(math.max(1, 120 - nixio.sysinfo().uptime))
|
wait_for_ticks(math.max(1, 120 - nixio.sysinfo().uptime))
|
||||||
|
|
||||||
|
wifiiface = get_ifname("wifi")
|
||||||
|
phy = iwinfo.nl80211.phyname(wifiiface)
|
||||||
|
|
||||||
|
-- Supports ath9k
|
||||||
|
if not nixio.fs.stat("/sys/kernel/debug/ieee80211/" .. phy .. "/ath9k") then
|
||||||
|
exit_app()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if read_all("/sys/kernel/debug/ieee80211/" .. phy .. "/ath9k/tx_chainmask"):chomp() ~= "1" then
|
||||||
|
multiple_ant = true
|
||||||
|
end
|
||||||
|
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
run_monitor()
|
run_monitor_9k()
|
||||||
wait_for_ticks(60) -- 1 minute
|
wait_for_ticks(60) -- 1 minute
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -57,21 +75,13 @@ if not file_exists(logfile) then
|
||||||
io.open(logfile, "w+"):close()
|
io.open(logfile, "w+"):close()
|
||||||
end
|
end
|
||||||
|
|
||||||
local multiple_ant = false
|
|
||||||
local last_station_count = 0
|
local last_station_count = 0
|
||||||
|
|
||||||
local log = aredn.log.open(logfile, 16000)
|
local log = aredn.log.open(logfile, 16000)
|
||||||
|
|
||||||
function run_monitor()
|
function run_monitor_9k()
|
||||||
|
|
||||||
local now = nixio.sysinfo().uptime
|
local now = nixio.sysinfo().uptime
|
||||||
|
|
||||||
local wifiiface = get_ifname("wifi")
|
|
||||||
|
|
||||||
if read_all("/sys/kernel/debug/ieee80211/" .. iwinfo.nl80211.phyname(wifiiface) .. "/ath9k/tx_chainmask"):chomp() ~= "1" then
|
|
||||||
multiple_ant = true
|
|
||||||
end
|
|
||||||
|
|
||||||
-- load history
|
-- load history
|
||||||
local rssi_hist = {}
|
local rssi_hist = {}
|
||||||
for line in io.lines(datfile) do
|
for line in io.lines(datfile) do
|
||||||
|
@ -87,7 +97,7 @@ function run_monitor()
|
||||||
end
|
end
|
||||||
|
|
||||||
local ofdm_level = 0
|
local ofdm_level = 0
|
||||||
for i, line in ipairs(read_all("/sys/kernel/debug/ieee80211/" .. iwinfo.nl80211.phyname(wifiiface) .. "/ath9k/ani"):splitNewLine())
|
for i, line in ipairs(read_all("/sys/kernel/debug/ieee80211/" .. phy .. "/ath9k/ani"):splitNewLine())
|
||||||
do
|
do
|
||||||
ofdm_level = tonumber(string.match(line, "OFDM LEVEL: (.*)"))
|
ofdm_level = tonumber(string.match(line, "OFDM LEVEL: (.*)"))
|
||||||
if ofdm_level then
|
if ofdm_level then
|
||||||
|
@ -99,7 +109,7 @@ function run_monitor()
|
||||||
-- avoid node going deaf while trying to obtain 'normal' statistics of neighbor strength
|
-- avoid node going deaf while trying to obtain 'normal' statistics of neighbor strength
|
||||||
-- in first few minutes after boot
|
-- in first few minutes after boot
|
||||||
if now > 119 and now < 750 then
|
if now > 119 and now < 750 then
|
||||||
os.execute("/usr/sbin/iw " .. wifiiface .. " scan")
|
os.execute("/usr/sbin/iw " .. wifiiface .. " scan > /dev/null 2>&1")
|
||||||
end
|
end
|
||||||
|
|
||||||
local station_count = 0
|
local station_count = 0
|
||||||
|
@ -157,7 +167,7 @@ function run_monitor()
|
||||||
|
|
||||||
if amac then
|
if amac then
|
||||||
-- reset
|
-- reset
|
||||||
os.execute("/usr/sbin/iw " .. wifiiface .. " scan")
|
os.execute("/usr/sbin/iw " .. wifiiface .. " scan > /dev/null 2>&1")
|
||||||
wait_for_ticks(5)
|
wait_for_ticks(5)
|
||||||
-- update time
|
-- update time
|
||||||
now = nixio.sysinfo().uptime
|
now = nixio.sysinfo().uptime
|
||||||
|
@ -193,7 +203,7 @@ function run_monitor()
|
||||||
end
|
end
|
||||||
elseif station_count == 0 and last_station_count ~= 0 then
|
elseif station_count == 0 and last_station_count ~= 0 then
|
||||||
-- reset
|
-- reset
|
||||||
os.execute("/usr/sbin/iw " .. wifiiface .. " scan")
|
os.execute("/usr/sbin/iw " .. wifiiface .. " scan > /dev/null 2>&1")
|
||||||
wait_for_ticks(5)
|
wait_for_ticks(5)
|
||||||
log:write("No stations detected")
|
log:write("No stations detected")
|
||||||
end
|
end
|
||||||
|
@ -253,4 +263,4 @@ function get_rssi(wifiiface)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return rssi_monitor
|
return rssi_monitor_9k
|
|
@ -69,7 +69,7 @@ function run_snrlog()
|
||||||
|
|
||||||
-- get radio noise floor
|
-- get radio noise floor
|
||||||
local nf = iwinfo.nl80211.noise(wifiiface)
|
local nf = iwinfo.nl80211.noise(wifiiface)
|
||||||
if not nf or nf < -101 or nf > -50 then
|
if not nf or nf < -110 or nf > -50 then
|
||||||
nf = defnoise
|
nf = defnoise
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ if not (config == "mesh" and nixio.fs.access("/etc/config.mesh/_setup", "r")) th
|
||||||
return -1
|
return -1
|
||||||
end
|
end
|
||||||
|
|
||||||
local lanintf = aredn.hardware.get_board().network.lan.ifname
|
local lanintf = aredn.hardware.get_board_network_ifname("lan")
|
||||||
local node = aredn_info.get_nvram("node")
|
local node = aredn_info.get_nvram("node")
|
||||||
local tactical = aredn_info.get_nvram("tactical")
|
local tactical = aredn_info.get_nvram("tactical")
|
||||||
local mac2 = mac_to_ip(aredn.hardware.get_interface_mac(aredn.hardware.get_iface_name("wifi")), 0)
|
local mac2 = mac_to_ip(aredn.hardware.get_interface_mac(aredn.hardware.get_iface_name("wifi")), 0)
|
||||||
|
@ -90,7 +90,7 @@ local dtdmac = mac_to_ip(aredn.hardware.get_interface_mac(lanintf:match("^(%S+)"
|
||||||
local deleteme = {}
|
local deleteme = {}
|
||||||
local cfg = {
|
local cfg = {
|
||||||
lan_intf = lanintf,
|
lan_intf = lanintf,
|
||||||
wan_intf = aredn.hardware.get_board().network.wan.ifname,
|
wan_intf = aredn.hardware.get_board_network_ifname("wan"),
|
||||||
dtdlink_intf = aredn.hardware.get_bridge_iface_names('dtdlink')
|
dtdlink_intf = aredn.hardware.get_bridge_iface_names('dtdlink')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ do
|
||||||
end
|
end
|
||||||
|
|
||||||
if cfg.wifi_enable == "1" then
|
if cfg.wifi_enable == "1" then
|
||||||
cfg.wifi_intf = aredn.hardware.get_board().network.wifi.ifname:match("^(%S+)")
|
cfg.wifi_intf = aredn.hardware.get_board_network_ifname("wifi"):match("^(%S+)")
|
||||||
else
|
else
|
||||||
cfg.wifi_intf = lanintf:match("^([^%.%s]+).*$") .. ".3975"
|
cfg.wifi_intf = lanintf:match("^([^%.%s]+).*$") .. ".3975"
|
||||||
end
|
end
|
||||||
|
@ -206,6 +206,17 @@ end
|
||||||
|
|
||||||
-- basic configuration
|
-- basic configuration
|
||||||
if do_basic then
|
if do_basic then
|
||||||
|
|
||||||
|
-- support wan vlan override
|
||||||
|
if not nixio.fs.stat("/etc/aredn_include/wan.network.user") then
|
||||||
|
local ports = ""
|
||||||
|
for _, port in ipairs(cfg.wan_intf:split(" "))
|
||||||
|
do
|
||||||
|
ports = ports .. " list ports '" .. port .. "'\n"
|
||||||
|
end
|
||||||
|
write_all("/etc/aredn_include/wan.network.config", ports)
|
||||||
|
end
|
||||||
|
|
||||||
remove_all("/tmp/new_config")
|
remove_all("/tmp/new_config")
|
||||||
nixio.fs.mkdir("/tmp/new_config")
|
nixio.fs.mkdir("/tmp/new_config")
|
||||||
|
|
||||||
|
|
|
@ -137,17 +137,19 @@ end
|
||||||
-- add a name for the dtdlink and xlink interfaces
|
-- add a name for the dtdlink and xlink interfaces
|
||||||
if name then
|
if name then
|
||||||
local dtdip = aredn.hardware.get_interface_ip4(aredn.hardware.get_iface_name("dtdlink"))
|
local dtdip = aredn.hardware.get_interface_ip4(aredn.hardware.get_iface_name("dtdlink"))
|
||||||
hosts[#hosts + 1] = { ip = dtdip, host = "dtdlink." .. name .. ".local.mesh" }
|
if dtdip then
|
||||||
if nixio.fs.stat("/etc/config.mesh/xlink") then
|
hosts[#hosts + 1] = { ip = dtdip, host = "dtdlink." .. name .. ".local.mesh" }
|
||||||
local count = 0
|
if nixio.fs.stat("/etc/config.mesh/xlink") then
|
||||||
uci.cursor("/etc/config.mesh"):foreach("xlink", "interface",
|
local count = 0
|
||||||
function(section)
|
uci.cursor("/etc/config.mesh"):foreach("xlink", "interface",
|
||||||
if section.ipaddr then
|
function(section)
|
||||||
hosts[#hosts + 1] = { ip = section.ipaddr, host = "xlink" .. count .. "." .. name .. ".local.mesh" }
|
if section.ipaddr then
|
||||||
count = count + 1
|
hosts[#hosts + 1] = { ip = section.ipaddr, host = "xlink" .. count .. "." .. name .. ".local.mesh" }
|
||||||
|
count = count + 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
)
|
||||||
)
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -273,7 +275,7 @@ print([[{]])
|
||||||
print([[ PlParam "sighup-pid-file" "/var/run/dnsmasq/dnsmasq.pid"]])
|
print([[ PlParam "sighup-pid-file" "/var/run/dnsmasq/dnsmasq.pid"]])
|
||||||
print([[ PlParam "interval" "30"]])
|
print([[ PlParam "interval" "30"]])
|
||||||
print([[ PlParam "timeout" "300"]])
|
print([[ PlParam "timeout" "300"]])
|
||||||
print([[ PlParam "name-change-script" "touch /tmp/namechange; cp /var/run/hosts_olsr /var/run/hosts_olsr.snapshot; mv -f /var/run/hosts_olsr.snapshot /var/run/hosts_olsr.stable"]])
|
print([[ PlParam "name-change-script" "cp /var/run/hosts_olsr /var/run/hosts_olsr.snapshot; mv -f /var/run/hosts_olsr.snapshot /var/run/hosts_olsr.stable; touch /tmp/namechange /var/run/hosts_olsr.stable"]])
|
||||||
for _, name in ipairs(names)
|
for _, name in ipairs(names)
|
||||||
do
|
do
|
||||||
print([[ PlParam "name" "]] .. name .. [["]])
|
print([[ PlParam "name" "]] .. name .. [["]])
|
||||||
|
@ -290,6 +292,7 @@ print([[}]])
|
||||||
|
|
||||||
-- add the ACTIVE tunnel interfaces
|
-- add the ACTIVE tunnel interfaces
|
||||||
if #tunnels > 0 then
|
if #tunnels > 0 then
|
||||||
|
local tun_weight = tonumber(cursor:get("aredn", "@tunnel[0]", "weight"))
|
||||||
local tuns = ""
|
local tuns = ""
|
||||||
for _, tunnel in ipairs(tunnels)
|
for _, tunnel in ipairs(tunnels)
|
||||||
do
|
do
|
||||||
|
@ -299,7 +302,11 @@ if #tunnels > 0 then
|
||||||
print([[Interface]] .. tuns)
|
print([[Interface]] .. tuns)
|
||||||
print([[{]])
|
print([[{]])
|
||||||
print([[ Ip4Broadcast 255.255.255.255]])
|
print([[ Ip4Broadcast 255.255.255.255]])
|
||||||
print([[ Mode "ether"]])
|
if not tun_weight or tun_weight < 1 then
|
||||||
|
print([[ Mode "ether"]])
|
||||||
|
elseif tun_weight > 1 then
|
||||||
|
print([[ LinkQualityMult default ]] .. (1 / tun_weight))
|
||||||
|
end
|
||||||
print([[}]])
|
print([[}]])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -34,24 +34,35 @@
|
||||||
LICENSE
|
LICENSE
|
||||||
|
|
||||||
export newval=$1
|
export newval=$1
|
||||||
if [ -z "$newval" ]; then
|
if [ -z "${newval}" ]; then
|
||||||
echo "Syntax: $0 1 - turns POE on"
|
echo "Syntax: $0 1 - turns POE on"
|
||||||
echo " $0 0 - turns POE off"
|
echo " $0 0 - turns POE off"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
pinnum=$(jsonfilter -e '@.gpioswitch.poe_passthrough.pin' < /etc/board.json)
|
||||||
export pinnum=$(jsonfilter -e '@.gpioswitch.poe_passthrough.pin' < /etc/board.json)
|
if [ "${pinnum}" = "" ]; then
|
||||||
if [ -z "$pinnum" ]; then
|
pinnum=$(jsonfilter -e '@.gpioswitch.poe_passtrough.pin' < /etc/board.json)
|
||||||
echo "There are NO PoE Passthrough ports defined for this device"
|
fi
|
||||||
exit 1
|
if [ "${pinnum}" != "" ]; then
|
||||||
else
|
pin="/sys/class/gpio/gpio${pinnum}"
|
||||||
export pin="gpio${pinnum}"
|
if [ ! -d "${pin}" ]; then
|
||||||
if [ ! -d "/sys/class/gpio/${pin}" ]; then
|
|
||||||
echo "${pinnum}" > /sys/class/gpio/export
|
echo "${pinnum}" > /sys/class/gpio/export
|
||||||
fi
|
fi
|
||||||
if [ -e "/sys/class/gpio/${pin}/direction" ]; then
|
else
|
||||||
echo "out" > /sys/class/gpio/${pin}/direction
|
pin=$(echo /sys/class/gpio/enable-poe:*)
|
||||||
|
if [ "${pin}" = "/sys/class/gpio/enable-poe:*" ]; then
|
||||||
|
echo "There are NO PoE Passthrough ports defined for this device"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "${newval}" > /sys/class/gpio/${pin}/value
|
|
||||||
exit 0
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
active_low=$(cat ${pin}/active_low 2> /dev/null)
|
||||||
|
if [ "${active_low}" = "1" ]; then
|
||||||
|
newval=$((1 - ${newval}))
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e "${pin}/direction" ]; then
|
||||||
|
echo "out" > ${pin}/direction
|
||||||
|
fi
|
||||||
|
echo "${newval}" > ${pin}/value
|
||||||
|
exit 0
|
||||||
|
|
|
@ -37,7 +37,7 @@ LICENSE
|
||||||
# ServiceName[:ServiceDaemon] pairs.
|
# ServiceName[:ServiceDaemon] pairs.
|
||||||
# If ServiceDaemon is omitted, we wont first kill the daemon
|
# If ServiceDaemon is omitted, we wont first kill the daemon
|
||||||
#
|
#
|
||||||
SERVICES="dnsmasq:dnsmasq dropbear:dropbear urngd:urngd rpcd:rpcd telnet:telnetd manager:manager.lua log:logd"
|
SERVICES="dnsmasq:dnsmasq dropbear:dropbear urngd:urngd rpcd:rpcd telnet:telnetd manager:manager.lua log:logd wpad:hostapd"
|
||||||
|
|
||||||
#
|
#
|
||||||
# We unceremoniously kill services, and then stop them to prevent
|
# We unceremoniously kill services, and then stop them to prevent
|
||||||
|
|
|
@ -40,15 +40,27 @@ if [ -z "$newval" ]; then
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export pinnum=$(jsonfilter -e '@.gpioswitch.usb_power_switch.pin' < /etc/board.json)
|
pinnum=$(jsonfilter -e '@.gpioswitch.usb_power_switch.pin' < /etc/board.json)
|
||||||
if [ -z "$pinnum" ]; then
|
if [ "${pinnum}" != "" ]; then
|
||||||
echo "There are NO controllable USB ports defined for this device"
|
pin="/sys/class/gpio/gpio${pinnum}"
|
||||||
exit 1
|
if [ ! -d "${pin}" ]; then
|
||||||
|
echo "${pinnum}" > /sys/class/gpio/export
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
export pin=$(echo "gpio${pinnum}")
|
pin=$(echo /sys/class/gpio/usb-powe*)
|
||||||
if [ ! -d /sys/class/gpio/$pin ]; then
|
if [ "${pin}" = "/sys/class/gpio/usb-powe*" ]; then
|
||||||
echo ${pinnum} > /sys/class/gpio/export
|
echo "There are NO controllable USB ports defined for this device"
|
||||||
fi
|
exit 1
|
||||||
echo ${newval} > /sys/class/gpio/${pin}/value
|
fi
|
||||||
exit 0
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
active_low=$(cat ${pin}/active_low)
|
||||||
|
if [ "${active_low}" = "1" ]; then
|
||||||
|
newval=$((1 - ${newval}))
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e "${pin}/direction" ]; then
|
||||||
|
echo "out" > ${pin}/direction
|
||||||
|
fi
|
||||||
|
echo "${newval}" > ${pin}/value
|
||||||
|
exit 0
|
||||||
|
|
|
@ -52,9 +52,20 @@ done < $configfile
|
||||||
|
|
||||||
# get mesh RF dev master setting in /etc/config/network
|
# get mesh RF dev master setting in /etc/config/network
|
||||||
|
|
||||||
meshif="$(uci -q get network.wifi.ifname)"
|
meshif="$(uci -q get network.@device[2].name)"
|
||||||
meshphy="phy${meshif#wlan}"
|
meshphy="phy${meshif#wlan}"
|
||||||
|
|
||||||
|
# Configure WAN interface, which may be wireless or Ethernet
|
||||||
|
if [ $wifi3_enable -eq 1 ]; then
|
||||||
|
# switch WAN network config from Ethernet to Wireless interface
|
||||||
|
for i in `cat /etc/aredn_include/wan.network.config | cut -f3 -d' ' | sed -e "s/'//g"`; do
|
||||||
|
uci -q del_list network.@device[1].ports=$i
|
||||||
|
done
|
||||||
|
uci -q delete network.@device[1].type
|
||||||
|
# adding the wireless interface done later-below
|
||||||
|
uci -q commit network
|
||||||
|
fi
|
||||||
|
|
||||||
rm -f "${dropdir}/wireless"
|
rm -f "${dropdir}/wireless"
|
||||||
touch "${dropdir}/wireless"
|
touch "${dropdir}/wireless"
|
||||||
|
|
||||||
|
@ -110,7 +121,7 @@ for _dev in /sys/class/ieee80211/*; do
|
||||||
encryption="none"
|
encryption="none"
|
||||||
key=""
|
key=""
|
||||||
network="wifi"
|
network="wifi"
|
||||||
elif [[ $wifi2_enable -eq 1 -a \( $ifacecount -eq 1 -o \( \( $ifacecount -gt 1 \) -a \( "$hwmode" = "$wifi2_hwmode" \) \) \) ]]; then
|
elif [ $wifi2_enable -eq 1 -a \( $ifacecount -eq 1 -o \( \( $ifacecount -gt 1 \) -a \( "$hwmode" = "$wifi2_hwmode" \) \) \) ]; then
|
||||||
# LAN AP interface
|
# LAN AP interface
|
||||||
channel="${wifi2_channel}"
|
channel="${wifi2_channel}"
|
||||||
ssid=$(echo "${wifi2_ssid}" | sed -e 's/\(..\)/\\x\1/g')
|
ssid=$(echo "${wifi2_ssid}" | sed -e 's/\(..\)/\\x\1/g')
|
||||||
|
@ -122,7 +133,7 @@ for _dev in /sys/class/ieee80211/*; do
|
||||||
key=$(echo -e "${key}")
|
key=$(echo -e "${key}")
|
||||||
key=${key//\"/\\\"}
|
key=${key//\"/\\\"}
|
||||||
network="lan"
|
network="lan"
|
||||||
elif [[ $wifi3_enable -eq 1 -a \( $ifacecount -eq 1 -o \( \( $ifacecount -gt 1 \) -a \( "$hwmode" = "$wifi3_hwmode" \) \) \) ]]; then
|
elif [ $wifi3_enable -eq 1 -a \( $ifacecount -eq 1 -o \( \( $ifacecount -gt 1 \) -a \( "$hwmode" = "$wifi3_hwmode" \) \) \) ]; then
|
||||||
# WAN Client
|
# WAN Client
|
||||||
disabled="0"
|
disabled="0"
|
||||||
channel=""
|
channel=""
|
||||||
|
@ -142,7 +153,8 @@ for _dev in /sys/class/ieee80211/*; do
|
||||||
network="wan"
|
network="wan"
|
||||||
htmode=""
|
htmode=""
|
||||||
uci -c ${dropdir} -q batch > /dev/null <<-EOF
|
uci -c ${dropdir} -q batch > /dev/null <<-EOF
|
||||||
set network.wan.ifname=$wlan
|
set network.@device[1].name=$wlan
|
||||||
|
set network.wan.device=$wlan
|
||||||
EOF
|
EOF
|
||||||
uci -c ${dropdir} -q commit network
|
uci -c ${dropdir} -q commit network
|
||||||
else
|
else
|
||||||
|
@ -162,11 +174,12 @@ EOF
|
||||||
set wireless.${radio}.htmode=${htmode}
|
set wireless.${radio}.htmode=${htmode}
|
||||||
${dev_id}
|
${dev_id}
|
||||||
add wireless wifi-iface
|
add wireless wifi-iface
|
||||||
set wireless.@wifi-iface[${ifacenum}].device=${radio}
|
set wireless.@wifi-iface[${ifacenum}].ifname=${wlan}
|
||||||
set wireless.@wifi-iface[${ifacenum}].network=${network}
|
set wireless.@wifi-iface[${ifacenum}].device=${radio}
|
||||||
set wireless.@wifi-iface[${ifacenum}].mode=${mode}
|
set wireless.@wifi-iface[${ifacenum}].network=${network}
|
||||||
set wireless.@wifi-iface[${ifacenum}].ssid="${ssid}"
|
set wireless.@wifi-iface[${ifacenum}].mode=${mode}
|
||||||
set wireless.@wifi-iface[${ifacenum}].encryption=${encryption}
|
set wireless.@wifi-iface[${ifacenum}].ssid="${ssid}"
|
||||||
|
set wireless.@wifi-iface[${ifacenum}].encryption=${encryption}
|
||||||
set wireless.@wifi-iface[${ifacenum}].key="${key}"
|
set wireless.@wifi-iface[${ifacenum}].key="${key}"
|
||||||
EOF
|
EOF
|
||||||
uci -c ${dropdir} -q commit wireless
|
uci -c ${dropdir} -q commit wireless
|
||||||
|
@ -176,6 +189,7 @@ EOF
|
||||||
ifacenum=$((ifacenum + 1))
|
ifacenum=$((ifacenum + 1))
|
||||||
uci -c ${dropdir} -q batch > /dev/null <<-EOF
|
uci -c ${dropdir} -q batch > /dev/null <<-EOF
|
||||||
add wireless wifi-iface
|
add wireless wifi-iface
|
||||||
|
set wireless.@wifi-iface[${ifacenum}].ifname=${wlan}-1
|
||||||
set wireless.@wifi-iface[${ifacenum}].device=${radio}
|
set wireless.@wifi-iface[${ifacenum}].device=${radio}
|
||||||
set wireless.@wifi-iface[${ifacenum}].network=wifi_mon
|
set wireless.@wifi-iface[${ifacenum}].network=wifi_mon
|
||||||
set wireless.@wifi-iface[${ifacenum}].mode=monitor
|
set wireless.@wifi-iface[${ifacenum}].mode=monitor
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
body { font-family:Verdana,arial,sans-serif; background:rgb(231,231,231); color:black }
|
body { font-family:Verdana,arial,sans-serif; background:rgb(231,231,231); color:black }
|
||||||
a:link { background:rgb(231,231,231); color:rgb(190,30,44) }
|
a:link { background:transparent; color:rgb(190,30,44) }
|
||||||
a:visited { background:rgb(231,231,231); color:rgb(190,30,44) }
|
a:visited { background:transparent; color:rgb(190,30,44) }
|
||||||
a:active { background:rgb(231,231,231); color:rgb(190,30,44) }
|
a:active { background:transparent; color:rgb(190,30,44) }
|
||||||
h1 { font-family:Verdana,arial,sans-serif; color:rgb(190,30,44); text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black }
|
h1 { font-family:Verdana,arial,sans-serif; color:rgb(190,30,44); text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black }
|
||||||
|
|
||||||
hr {
|
hr {
|
||||||
|
@ -31,7 +31,7 @@ body table {
|
||||||
.navbar_select a:active { background:black; color:white }
|
.navbar_select a:active { background:black; color:white }
|
||||||
|
|
||||||
.TopBanner { width:100%; }
|
.TopBanner { width:100%; }
|
||||||
.LogoDiv { position:absolute left:0px; width:100%; height:95; }
|
.LogoDiv { left:0px; width:100%; height:95; }
|
||||||
.AREDNLogo { background:rgb(231,231,231); position:absolute; left:10%; width:175; height:95; border-style: none;}
|
.AREDNLogo { background:rgb(231,231,231); position:absolute; left:10%; width:175; height:95; border-style: none;}
|
||||||
.PartOfAREDN { font-family:Verdana,arial,sans-serif; font-size:xx-small; text-align:center; }
|
.PartOfAREDN { font-family:Verdana,arial,sans-serif; font-size:xx-small; text-align:center; }
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ body table {
|
||||||
.navbar_select a:active { background:white; color:black }
|
.navbar_select a:active { background:white; color:black }
|
||||||
|
|
||||||
.TopBanner { width:100%; }
|
.TopBanner { width:100%; }
|
||||||
.LogoDiv { position:absolute left:0px; width:100%; height:95; }
|
.LogoDiv { left:0px; width:100%; height:95; }
|
||||||
.AREDNLogo { background: white; position:absolute; left:10%; width:175; height:95; }
|
.AREDNLogo { background: white; position:absolute; left:10%; width:175; height:95; }
|
||||||
.PartOfAREDN { font-family:Verdana,arial,sans-serif; font-size:xx-small; text-align:center; }
|
.PartOfAREDN { font-family:Verdana,arial,sans-serif; font-size:xx-small; text-align:center; }
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,6 @@ aredn.html = require("aredn.html")
|
||||||
require("uci")
|
require("uci")
|
||||||
aredn.info = require("aredn.info")
|
aredn.info = require("aredn.info")
|
||||||
require("ubus")
|
require("ubus")
|
||||||
require("luci.sys")
|
|
||||||
|
|
||||||
local html = aredn.html
|
local html = aredn.html
|
||||||
|
|
||||||
|
@ -160,7 +159,7 @@ function reboot()
|
||||||
end
|
end
|
||||||
html.print("</center></body></html>")
|
html.print("</center></body></html>")
|
||||||
http_footer()
|
http_footer()
|
||||||
luci.sys.reboot()
|
os.execute("reboot >/dev/null 2>&1")
|
||||||
os.exit()
|
os.exit()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -191,7 +190,7 @@ local parms = {}
|
||||||
local firmfile = ""
|
local firmfile = ""
|
||||||
if os.getenv("REQUEST_METHOD") == "POST" then
|
if os.getenv("REQUEST_METHOD") == "POST" then
|
||||||
require('luci.http')
|
require('luci.http')
|
||||||
local request = luci.http.Request(luci.sys.getenv(),
|
local request = luci.http.Request(nixio.getenv(),
|
||||||
function()
|
function()
|
||||||
local v = io.read(1024)
|
local v = io.read(1024)
|
||||||
if not v then
|
if not v then
|
||||||
|
@ -201,30 +200,28 @@ if os.getenv("REQUEST_METHOD") == "POST" then
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
-- only allow file uploading without active tunnels
|
-- only allow file uploading without active tunnels
|
||||||
if not active_tunnel then
|
local fp
|
||||||
local fp
|
request:setfilehandler(
|
||||||
request:setfilehandler(
|
function(meta, chunk, eof)
|
||||||
function(meta, chunk, eof)
|
if not fp then
|
||||||
if not fp then
|
if meta and meta.file then
|
||||||
if meta and meta.file then
|
firmfile = meta.file
|
||||||
firmfile = meta.file
|
if firmfile:match("sysupgrade%.bin$") then
|
||||||
if firmfile:match("sysupgrade%.bin$") then
|
-- Uploading a system upgrade - clear out memory early
|
||||||
-- Uploading a system upgrade - clear out memory early
|
os.execute("/usr/local/bin/upgrade_prepare.sh > /dev/null 2>&1")
|
||||||
os.execute("/usr/local/bin/upgrade_prepare.sh > /dev/null 2>&1")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
nixio.fs.mkdir("/tmp/web/upload")
|
end
|
||||||
fp = io.open("/tmp/web/upload/file", "w")
|
nixio.fs.mkdir("/tmp/web/upload")
|
||||||
end
|
fp = io.open("/tmp/web/upload/file", "w")
|
||||||
if chunk then
|
|
||||||
fp:write(chunk)
|
|
||||||
end
|
|
||||||
if eof then
|
|
||||||
fp:close()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
)
|
if chunk then
|
||||||
end
|
fp:write(chunk)
|
||||||
|
end
|
||||||
|
if eof then
|
||||||
|
fp:close()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
parms = request:formvalue()
|
parms = request:formvalue()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -289,6 +286,8 @@ elseif mfgprefix == "cpe" then
|
||||||
hardwaretypev = "510-v3" -- v3.0
|
hardwaretypev = "510-v3" -- v3.0
|
||||||
elseif hwmodel:match("CPE510") then
|
elseif hwmodel:match("CPE510") then
|
||||||
hardwaretypev = "510-520-v1" -- CPE510 V1.0/v1.1
|
hardwaretypev = "510-520-v1" -- CPE510 V1.0/v1.1
|
||||||
|
elseif hwmodel:match("CPE605") then
|
||||||
|
hardwaretypev = "605-v1" -- CPE605 V1.0
|
||||||
elseif hwmodel:match("CPE610 v2%.0") then
|
elseif hwmodel:match("CPE610 v2%.0") then
|
||||||
hardwaretypev = "610-v2" -- CPE610 V2.0
|
hardwaretypev = "610-v2" -- CPE610 V2.0
|
||||||
elseif hwmodel:match("CPE610") then
|
elseif hwmodel:match("CPE610") then
|
||||||
|
@ -460,7 +459,7 @@ if fw_install and nixio.fs.stat(tmpdir .. "/firmware") then
|
||||||
html.print("<style>")
|
html.print("<style>")
|
||||||
html.print(read_all("/tmp/web/style.css"))
|
html.print(read_all("/tmp/web/style.css"))
|
||||||
html.print("</style>")
|
html.print("</style>")
|
||||||
html.print("<meta http-equiv='refresh' content='180;URL=http://" .. node .. ".local.mesh:8080'>")
|
html.print("<meta http-equiv='refresh' content='300;URL=http://" .. node .. ".local.mesh:8080'>")
|
||||||
html.print("</head>")
|
html.print("</head>")
|
||||||
html.print("<body><center>")
|
html.print("<body><center>")
|
||||||
html.print("<h2>The firmware is being updated.</h2>")
|
html.print("<h2>The firmware is being updated.</h2>")
|
||||||
|
@ -491,7 +490,7 @@ if fw_install and nixio.fs.stat(tmpdir .. "/firmware") then
|
||||||
html.print("</body></html>")
|
html.print("</body></html>")
|
||||||
http_footer()
|
http_footer()
|
||||||
aredn.info.set_nvram("nodeupgraded", "0")
|
aredn.info.set_nvram("nodeupgraded", "0")
|
||||||
luci.sys.reboot()
|
os.execute("reboot >/dev/null 2>&1")
|
||||||
else
|
else
|
||||||
html.print([[
|
html.print([[
|
||||||
<center><h2>Firmware will be written in the background.</h2>
|
<center><h2>Firmware will be written in the background.</h2>
|
||||||
|
@ -501,12 +500,12 @@ if fw_install and nixio.fs.stat(tmpdir .. "/firmware") then
|
||||||
When the node has finished booting you should ensure your computer has<br>
|
When the node has finished booting you should ensure your computer has<br>
|
||||||
received a new IP address and reconnect with<br>
|
received a new IP address and reconnect with<br>
|
||||||
<a href='http://]] .. node .. [[.local.mesh:8080/'>http://]] .. node .. [[.local.mesh:8080/</a><br>
|
<a href='http://]] .. node .. [[.local.mesh:8080/'>http://]] .. node .. [[.local.mesh:8080/</a><br>
|
||||||
(This page will automatically reload in 3 minutes)</h3>
|
(This page will automatically reload in 5 minutes)</h3>
|
||||||
</center></body></html>
|
</center></body></html>
|
||||||
]])
|
]])
|
||||||
http_footer()
|
http_footer()
|
||||||
nixio.fs.remove("/tmp/sysupgradefilelist")
|
nixio.fs.remove("/tmp/sysupgradefilelist")
|
||||||
upgradecmd = "/sbin/sysupgrade -f /tmp/arednsysupgradebackup.tgz -q " .. tmpdir .. "/firmware 2>&1 &"
|
upgradecmd = "/usr/local/bin/aredn_sysupgrade -f /tmp/arednsysupgradebackup.tgz -q " .. tmpdir .. "/firmware 2>&1 &"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
fin:close()
|
fin:close()
|
||||||
|
@ -520,7 +519,7 @@ if fw_install and nixio.fs.stat(tmpdir .. "/firmware") then
|
||||||
html.footer()
|
html.footer()
|
||||||
html.print("</body></html>")
|
html.print("</body></html>")
|
||||||
http_footer()
|
http_footer()
|
||||||
luci.sys.reboot()
|
os.execute("reboot >/dev/null 2>&1")
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
html.print([[
|
html.print([[
|
||||||
|
@ -532,11 +531,11 @@ if fw_install and nixio.fs.stat(tmpdir .. "/firmware") then
|
||||||
received a new IP address and reconnect with<br>
|
received a new IP address and reconnect with<br>
|
||||||
<a href='http://localnode.local.mesh:8080/'>http://192.168.1.1:8080/</a><br>
|
<a href='http://localnode.local.mesh:8080/'>http://192.168.1.1:8080/</a><br>
|
||||||
and continue setup of the node in firstboot state.<br>
|
and continue setup of the node in firstboot state.<br>
|
||||||
(This page will automatically reload in 3 minutes)</h3>
|
(This page will automatically reload in 5 minutes)</h3>
|
||||||
</center></body></html>
|
</center></body></html>
|
||||||
]])
|
]])
|
||||||
http_footer()
|
http_footer()
|
||||||
upgradecmd = "/sbin/sysupgrade -q -n " .. tmpdir .. "/firmware 2>&1 &"
|
upgradecmd = "/usr/local/bin/aredn_sysupgrade -q -n " .. tmpdir .. "/firmware 2>&1 &"
|
||||||
end
|
end
|
||||||
if upgradecmd then
|
if upgradecmd then
|
||||||
os.execute(upgradecmd)
|
os.execute(upgradecmd)
|
||||||
|
|
|
@ -42,7 +42,6 @@ require("aredn.utils")
|
||||||
aredn.html = require("aredn.html")
|
aredn.html = require("aredn.html")
|
||||||
require("uci")
|
require("uci")
|
||||||
aredn.info = require("aredn.info")
|
aredn.info = require("aredn.info")
|
||||||
require("luci.sys")
|
|
||||||
|
|
||||||
local html = aredn.html
|
local html = aredn.html
|
||||||
|
|
||||||
|
@ -63,8 +62,8 @@ function defaultPackageRepos(repo)
|
||||||
target = m
|
target = m
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if release:match("%.") then
|
local a, b = release:match("^(%d+)%.(%d+)%.")
|
||||||
local a, b = release:match("^(%d+)%.(%d+)%.")
|
if a and b then
|
||||||
urlprefix = urlprefix .. "/releases/" .. a .. "/" .. b .. "/" .. release
|
urlprefix = urlprefix .. "/releases/" .. a .. "/" .. b .. "/" .. release
|
||||||
else
|
else
|
||||||
-- nightly
|
-- nightly
|
||||||
|
@ -471,7 +470,7 @@ function reboot()
|
||||||
end
|
end
|
||||||
html.print("</center></body></html>")
|
html.print("</center></body></html>")
|
||||||
http_footer()
|
http_footer()
|
||||||
luci.sys.reboot()
|
os.execute("reboot >/dev/null 2>&1")
|
||||||
os.exit()
|
os.exit()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -614,12 +613,12 @@ end
|
||||||
function currentWANVLAN()
|
function currentWANVLAN()
|
||||||
for line in io.lines("/etc/config.mesh/_setup")
|
for line in io.lines("/etc/config.mesh/_setup")
|
||||||
do
|
do
|
||||||
local vlan = line:match("^wan_intf = %w+%d+%.(%d+)")
|
local vlan = line:match("^wan_intf = %w+%.(%d+)")
|
||||||
if vlan then
|
if vlan then
|
||||||
return vlan
|
return vlan
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local vlan = aredn.hardware.get_board().network.wan.ifname:match("^%w+%.(%d+)")
|
local vlan = aredn.hardware.get_board_network_ifname("wan"):match("^%w+%.(%d+)")
|
||||||
if vlan then
|
if vlan then
|
||||||
return vlan
|
return vlan
|
||||||
end
|
end
|
||||||
|
@ -636,7 +635,7 @@ function changeWANVLAN()
|
||||||
end
|
end
|
||||||
if newval ~= "" then
|
if newval ~= "" then
|
||||||
local wan_intf = ""
|
local wan_intf = ""
|
||||||
for dev in aredn.hardware.get_board().network.wan.ifname:gmatch("%S+")
|
for dev in aredn.hardware.get_board_network_ifname("wan"):gmatch("%S+")
|
||||||
do
|
do
|
||||||
wan_intf = wan_intf .. " " .. dev:match("^([^%.]+)") .. "." .. newval
|
wan_intf = wan_intf .. " " .. dev:match("^([^%.]+)") .. "." .. newval
|
||||||
end
|
end
|
||||||
|
@ -663,7 +662,7 @@ end
|
||||||
local parms = {}
|
local parms = {}
|
||||||
if os.getenv("REQUEST_METHOD") == "POST" then
|
if os.getenv("REQUEST_METHOD") == "POST" then
|
||||||
require('luci.http')
|
require('luci.http')
|
||||||
local request = luci.http.Request(luci.sys.getenv(),
|
local request = luci.http.Request(nixio.getenv(),
|
||||||
function()
|
function()
|
||||||
local v = io.read(1024)
|
local v = io.read(1024)
|
||||||
if not v then
|
if not v then
|
||||||
|
|
|
@ -49,5 +49,5 @@ else
|
||||||
end
|
end
|
||||||
|
|
||||||
print("Active firewall rules:")
|
print("Active firewall rules:")
|
||||||
print(capture("/usr/sbin/iptables -L"))
|
print(capture("nft list ruleset"))
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,6 @@
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
require("uci")
|
require("uci")
|
||||||
require("luci.sys")
|
|
||||||
require("nixio")
|
require("nixio")
|
||||||
local info = require("aredn.info")
|
local info = require("aredn.info")
|
||||||
|
|
||||||
|
@ -69,6 +68,6 @@ else
|
||||||
if not server:match("%.") then
|
if not server:match("%.") then
|
||||||
server = server .. ".local.mesh"
|
server = server .. ".local.mesh"
|
||||||
end
|
end
|
||||||
luci.sys.httpget("http://" .. server .. ":8080/cgi-bin/iperf?server=")
|
os.execute("wget -q 'http://" .. server .. ":8080/cgi-bin/iperf?server=' > /dev/null 2>&1")
|
||||||
print("<html><head><title>iperf</title></head><body><pre>" .. io.popen("/usr/bin/iperf3 -b 0 -c " .. server .. (protocol == "udp" and " -u" or "") .. " 2>&1"):read("*a") .. "</pre></body></html>")
|
print("<html><head><title>iperf</title></head><body><pre>" .. io.popen("/usr/bin/iperf3 -b 0 -c " .. server .. (protocol == "udp" and " -u" or "") .. " 2>&1"):read("*a") .. "</pre></body></html>")
|
||||||
end
|
end
|
||||||
|
|
|
@ -67,7 +67,8 @@ local rateL = {
|
||||||
MCS12 = 78,
|
MCS12 = 78,
|
||||||
MCS13 = 104,
|
MCS13 = 104,
|
||||||
MCS14 = 117,
|
MCS14 = 117,
|
||||||
MCS15 = 130
|
MCS15 = 130,
|
||||||
|
["54.0M"] = 54
|
||||||
}
|
}
|
||||||
local rateS = {
|
local rateS = {
|
||||||
MCS0 = 7.2,
|
MCS0 = 7.2,
|
||||||
|
@ -129,8 +130,7 @@ end
|
||||||
|
|
||||||
if os.getenv("REQUEST_METHOD") == "POST" then
|
if os.getenv("REQUEST_METHOD") == "POST" then
|
||||||
require('luci.http')
|
require('luci.http')
|
||||||
require('luci.sys')
|
local request = luci.http.Request(nixio.getenv(),
|
||||||
local request = luci.http.Request(luci.sys.getenv(),
|
|
||||||
function()
|
function()
|
||||||
local v = io.read(1024)
|
local v = io.read(1024)
|
||||||
if not v then
|
if not v then
|
||||||
|
@ -217,6 +217,7 @@ arptable(function(a)
|
||||||
arpcache[a["IP address"]] = a
|
arpcache[a["IP address"]] = a
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
local iwrates
|
||||||
local prefix = "/sys/kernel/debug/ieee80211/" .. phy .. "/netdev:" .. wifiif .. "/stations/"
|
local prefix = "/sys/kernel/debug/ieee80211/" .. phy .. "/netdev:" .. wifiif .. "/stations/"
|
||||||
for i, node in ipairs(aredn.olsr.getOLSRLinks())
|
for i, node in ipairs(aredn.olsr.getOLSRLinks())
|
||||||
do
|
do
|
||||||
|
@ -233,9 +234,9 @@ do
|
||||||
if gi and ewma then
|
if gi and ewma then
|
||||||
-- 802.11b/n
|
-- 802.11b/n
|
||||||
if gi == "SGI" then
|
if gi == "SGI" then
|
||||||
links[node.remoteIP].mbps = string.format("%.1f", rateS[rate] * ewma / 100 / chanbw)
|
links[node.remoteIP].mbps = string.format("%.1f", (rateS[rate] or 0) * ewma / 100 / chanbw)
|
||||||
else
|
else
|
||||||
links[node.remoteIP].mbps = string.format("%.1f", rateL[rate] * ewma / 100 / chanbw)
|
links[node.remoteIP].mbps = string.format("%.1f", (rateL[rate] or 0) * ewma / 100 / chanbw)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
rate, ewma = line:match("^A[^,]*,([^,]*),[^,]*,[^,]*,([^,]*,)")
|
rate, ewma = line:match("^A[^,]*,([^,]*),[^,]*,[^,]*,([^,]*,)")
|
||||||
|
@ -248,6 +249,27 @@ do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
f:close()
|
f:close()
|
||||||
|
else -- fallback (rates without error accounting)
|
||||||
|
if not iwrates then
|
||||||
|
iwrates = {}
|
||||||
|
local station = {}
|
||||||
|
for line in io.popen("iw " .. wifiif .. " station dump"):lines()
|
||||||
|
do
|
||||||
|
local mac = line:match("^Station (%S+) ")
|
||||||
|
if mac then
|
||||||
|
station = {}
|
||||||
|
iwrates[mac] = station
|
||||||
|
end
|
||||||
|
local txbitrate = line:match("tx bitrate:%s+([%d%.]+) MBit/s")
|
||||||
|
if txbitrate then
|
||||||
|
station.txbitrate = txbitrate
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local station = iwrates[mac["HW address"]]
|
||||||
|
if station then
|
||||||
|
links[node.remoteIP].mbps = string.format("%.1f", station.txbitrate)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -499,7 +521,7 @@ html.print("<a href='/help.html#meshstatus' target='_blank'>Help</a>  
|
||||||
if nixio.fs.stat("/tmp/web/automesh") then
|
if nixio.fs.stat("/tmp/web/automesh") then
|
||||||
html.print("<input type=submit name=stop value=Stop title='Abort continuous status'>")
|
html.print("<input type=submit name=stop value=Stop title='Abort continuous status'>")
|
||||||
else
|
else
|
||||||
html.print("<input type=submit name=refresh value=Refresh title='Refresh this page'>")
|
html.print("<input type=button name=refresh value=Refresh title='Refresh this page' onclick='window.location.reload();'>")
|
||||||
html.print(" ")
|
html.print(" ")
|
||||||
html.print("<input type=submit name=auto value=Auto title='Automatic page refresh'>")
|
html.print("<input type=submit name=auto value=Auto title='Automatic page refresh'>")
|
||||||
end
|
end
|
||||||
|
|
|
@ -42,7 +42,6 @@ require("aredn.utils")
|
||||||
aredn.html = require("aredn.html")
|
aredn.html = require("aredn.html")
|
||||||
require("uci")
|
require("uci")
|
||||||
aredn.info = require("aredn.info")
|
aredn.info = require("aredn.info")
|
||||||
require("luci.sys")
|
|
||||||
|
|
||||||
local html = aredn.html
|
local html = aredn.html
|
||||||
|
|
||||||
|
@ -62,7 +61,7 @@ end
|
||||||
local parms = {}
|
local parms = {}
|
||||||
if os.getenv("REQUEST_METHOD") == "POST" then
|
if os.getenv("REQUEST_METHOD") == "POST" then
|
||||||
require('luci.http')
|
require('luci.http')
|
||||||
local request = luci.http.Request(luci.sys.getenv(),
|
local request = luci.http.Request(nixio.getenv(),
|
||||||
function()
|
function()
|
||||||
local v = io.read(1024)
|
local v = io.read(1024)
|
||||||
if not v then
|
if not v then
|
||||||
|
@ -833,13 +832,12 @@ if parms.button_save and not (#port_err > 0 or #dhcp_err > 0 or #dmz_err > 0 or
|
||||||
if os.execute("/usr/local/bin/node-setup -a -p mesh") ~= 0 then
|
if os.execute("/usr/local/bin/node-setup -a -p mesh") ~= 0 then
|
||||||
err("problem with configuration")
|
err("problem with configuration")
|
||||||
end
|
end
|
||||||
if not luci.sys.init.reload("dnsmasq") then
|
if os.execute("/etc/init.d/dnsmasq restart") ~= 0 then
|
||||||
err("problem with dnsmasq")
|
err("problem with dnsmasq")
|
||||||
end
|
end
|
||||||
if not luci.sys.init.reload("firewall") then
|
if os.execute("/etc/init.d/firewall restart") ~= 0 then
|
||||||
err("problem with port setup")
|
err("problem with port setup")
|
||||||
end
|
end
|
||||||
-- This "luci.sys.init.restart("olsrd")" doesnt do the same thing so we have to call restart directly
|
|
||||||
if os.execute("/etc/init.d/olsrd restart") ~= 0 then
|
if os.execute("/etc/init.d/olsrd restart") ~= 0 then
|
||||||
err("problem with olsr setup")
|
err("problem with olsr setup")
|
||||||
end
|
end
|
||||||
|
@ -863,7 +861,7 @@ html.print([[<tr><td align=center>
|
||||||
|
|
||||||
<input type=submit name=button_save value='Save Changes' title='Save and use these settings now (takes about 20 seconds)'>
|
<input type=submit name=button_save value='Save Changes' title='Save and use these settings now (takes about 20 seconds)'>
|
||||||
<input type=submit name=button_reset value='Reset Values' title='Revert to the last saved settings'>
|
<input type=submit name=button_reset value='Reset Values' title='Revert to the last saved settings'>
|
||||||
<input type=submit name=button_refresh value='Refresh' title='Refresh this page'>
|
<input type=button name=button_refresh value='Refresh' title='Refresh this page' onclick='window.location.reload();'>
|
||||||
<tr><td> </td></tr>]])
|
<tr><td> </td></tr>]])
|
||||||
hide("<input type=hidden name=reload value=1></td></tr>")
|
hide("<input type=hidden name=reload value=1></td></tr>")
|
||||||
|
|
||||||
|
|
|
@ -128,8 +128,7 @@ end
|
||||||
|
|
||||||
if os.getenv("REQUEST_METHOD") == "POST" then
|
if os.getenv("REQUEST_METHOD") == "POST" then
|
||||||
require('luci.http')
|
require('luci.http')
|
||||||
require('luci.sys')
|
local request = luci.http.Request(nixio.getenv(),
|
||||||
local request = luci.http.Request(luci.sys.getenv(),
|
|
||||||
function()
|
function()
|
||||||
local v = io.read(1024)
|
local v = io.read(1024)
|
||||||
if not v then
|
if not v then
|
||||||
|
@ -177,7 +176,7 @@ html.print("<h1>" .. node .. " WiFi scan</h1><hr>")
|
||||||
if autoscan then
|
if autoscan then
|
||||||
html.print("<input type=submit name=stop value=Stop title='Abort continuous scan'>")
|
html.print("<input type=submit name=stop value=Stop title='Abort continuous scan'>")
|
||||||
else
|
else
|
||||||
html.print("<input type=submit name=refresh value=Refresh title='Refresh this page'>")
|
html.print("<input type=button name=refresh value=Refresh title='Refresh this page' onclick='window.location.reload();'>")
|
||||||
html.print(" ")
|
html.print(" ")
|
||||||
html.print("<input type=submit name=auto value=Auto title='Begin continuous scan'>")
|
html.print("<input type=submit name=auto value=Auto title='Begin continuous scan'>")
|
||||||
end
|
end
|
||||||
|
|
|
@ -42,7 +42,6 @@ require("aredn.utils")
|
||||||
require("aredn.hardware")
|
require("aredn.hardware")
|
||||||
require("uci")
|
require("uci")
|
||||||
require('luci.http')
|
require('luci.http')
|
||||||
require('luci.sys')
|
|
||||||
local html = require("aredn.html")
|
local html = require("aredn.html")
|
||||||
local aredn_info = require("aredn.info")
|
local aredn_info = require("aredn.info")
|
||||||
|
|
||||||
|
@ -55,42 +54,6 @@ local cursor = uci.cursor()
|
||||||
|
|
||||||
-- helpers start
|
-- helpers start
|
||||||
|
|
||||||
local rf_channel_map = {
|
|
||||||
["900"] = {},
|
|
||||||
["2400"] = {},
|
|
||||||
["3400"] = {},
|
|
||||||
["5500"] = {},
|
|
||||||
["5800ubntus"] = {}
|
|
||||||
}
|
|
||||||
for i = 4,7
|
|
||||||
do
|
|
||||||
rf_channel_map["900"][i - 3] = { label = i .. " (" .. (887 + i * 5) .. ")", number = i, frequency = 887 + i * 5 }
|
|
||||||
end
|
|
||||||
for i = -4,11
|
|
||||||
do
|
|
||||||
rf_channel_map["2400"][i + (i <= 0 and 5 or 4)] = { label = i .. " (" .. (2407 + i * 5) .. ")", number = i, frequency = 2407 + i * 5 }
|
|
||||||
end
|
|
||||||
for i = 76,99
|
|
||||||
do
|
|
||||||
rf_channel_map["3400"][i - 75] = { label = i .. " (" .. (3000 + i * 5) .. ")", number = i, frequency = 3000 + i * 5 }
|
|
||||||
end
|
|
||||||
for i = 36,64,4
|
|
||||||
do
|
|
||||||
rf_channel_map["5500"][(i - 32) / 4] = { label = i .. " (" .. (5000 + i * 5) .. ")", number = i, frequency = 5000 + i * 5 }
|
|
||||||
end
|
|
||||||
for i = 100,140,4
|
|
||||||
do
|
|
||||||
rf_channel_map["5500"][(i - 64) / 4] = { label = i .. " (" .. (5000 + i * 5) .. ")", number = i, frequency = 5000 + i * 5 }
|
|
||||||
end
|
|
||||||
for i = 149,165,4
|
|
||||||
do
|
|
||||||
rf_channel_map["5500"][(i - 69) / 4] = { label = i .. " (" .. (5000 + i * 5) .. ")", number = i, frequency = 5000 + i * 5 }
|
|
||||||
end
|
|
||||||
for i = 131,184
|
|
||||||
do
|
|
||||||
rf_channel_map["5800ubntus"][i - 130] = { label = i .. " (" .. (5000 + i * 5) .. ")", number = i, frequency = 5000 + i * 5 }
|
|
||||||
end
|
|
||||||
|
|
||||||
function capture_and_match(cmd, pattern)
|
function capture_and_match(cmd, pattern)
|
||||||
local f = io.popen(cmd)
|
local f = io.popen(cmd)
|
||||||
if f then
|
if f then
|
||||||
|
@ -106,33 +69,6 @@ function capture_and_match(cmd, pattern)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function rf_channels_list(wifiintf)
|
|
||||||
local channels = {}
|
|
||||||
local rfband = aredn.hardware.get_rfband()
|
|
||||||
if rfband and rf_channel_map[rfband] then
|
|
||||||
return rf_channel_map[rfband]
|
|
||||||
else
|
|
||||||
local f = io.popen("iwinfo " .. wifiintf .. " freqlist")
|
|
||||||
if f then
|
|
||||||
for line in f:lines()
|
|
||||||
do
|
|
||||||
local freq, num = line:match("(%d+%.%d+) GHz %(Channel (%d+)%)")
|
|
||||||
if freq and not line:match("restricted") then
|
|
||||||
freq = freq:gsub("%.", "")
|
|
||||||
num = num:gsub("^0+", "")
|
|
||||||
channels[#channels + 1] = {
|
|
||||||
label = num .. " (" .. freq .. ")",
|
|
||||||
number = tonumber(num),
|
|
||||||
frequency = freq
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
f:close()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return channels
|
|
||||||
end
|
|
||||||
|
|
||||||
function reboot()
|
function reboot()
|
||||||
local node = aredn_info.get_nvram("node")
|
local node = aredn_info.get_nvram("node")
|
||||||
if node == "" then
|
if node == "" then
|
||||||
|
@ -181,7 +117,7 @@ function reboot()
|
||||||
end
|
end
|
||||||
html.print("</center></body></html>")
|
html.print("</center></body></html>")
|
||||||
http_footer()
|
http_footer()
|
||||||
luci.sys.reboot()
|
os.execute("reboot >/dev/null 2>&1")
|
||||||
os.exit()
|
os.exit()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -194,7 +130,7 @@ function out(str)
|
||||||
end
|
end
|
||||||
|
|
||||||
function is_channel_valid(channel)
|
function is_channel_valid(channel)
|
||||||
local list = rf_channels_list(aredn.hardware.get_iface_name("wifi"))
|
local list = aredn.hardware.get_rfchannels(aredn.hardware.get_iface_name("wifi"))
|
||||||
for _, c in ipairs(list)
|
for _, c in ipairs(list)
|
||||||
do
|
do
|
||||||
if c.number == channel then
|
if c.number == channel then
|
||||||
|
@ -265,7 +201,7 @@ local phycount = tonumber(capture("ls -1d /sys/class/ieee80211/* | wc -l"):chomp
|
||||||
local parms = {}
|
local parms = {}
|
||||||
local has_parms = false
|
local has_parms = false
|
||||||
if os.getenv("REQUEST_METHOD") == "POST" then
|
if os.getenv("REQUEST_METHOD") == "POST" then
|
||||||
local request = luci.http.Request(luci.sys.getenv(),
|
local request = luci.http.Request(nixio.getenv(),
|
||||||
function()
|
function()
|
||||||
local v = io.read(1024)
|
local v = io.read(1024)
|
||||||
if not v then
|
if not v then
|
||||||
|
@ -803,7 +739,7 @@ if parms.button_save then
|
||||||
if f then
|
if f then
|
||||||
for k, v in pairs(parms)
|
for k, v in pairs(parms)
|
||||||
do
|
do
|
||||||
if k:match("^aprs_") or k:match("^dhcp_") or k:match("^dmz_") or k:match("^lan_") or k:match("^olsrd_") or k:match("^wan_") or k:match("^wifi_") or k:match("^wifi2_") or k:match("^wifi3_") or k:match("^dtdlink_") or k:match("^ntp_") or k:match("^time_") or k:match("^description_") then
|
if k:match("^aprs_") or k:match("^dhcp_") or k:match("^dmz_") or k:match("^lan_") or k:match("^olsrd_") or k:match("^wan_") or k:match("^wifi_") or k:match("^wifi2_") or k:match("^wifi3_") or k:match("^dtdlink_") or k:match("^ntp_") or k:match("^time_") or k:match("^description_") or k:match("^compat_version") then
|
||||||
f:write(k .. " = " .. v .. "\n")
|
f:write(k .. " = " .. v .. "\n")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1102,6 +1038,7 @@ html.print([[
|
||||||
<td><textarea rows='2' cols='60' wrap='soft' maxlength='210' id='node_description_entry' name='description_node' tabindex='4'>]] .. desc .. [[</textarea></td>
|
<td><textarea rows='2' cols='60' wrap='soft' maxlength='210' id='node_description_entry' name='description_node' tabindex='4'>]] .. desc .. [[</textarea></td>
|
||||||
]])
|
]])
|
||||||
hidden[#hidden + 1] = "<input type=hidden name=config value='mesh'>"
|
hidden[#hidden + 1] = "<input type=hidden name=config value='mesh'>"
|
||||||
|
hidden[#hidden + 1] = "<input type=hidden name=compat_version value='" .. (compat_version or "") .. "'>"
|
||||||
html.print([[
|
html.print([[
|
||||||
<td>Verify Password</td>
|
<td>Verify Password</td>
|
||||||
<td><input class='password-input' type=password name=passwd2 value=']] .. passwd2 .. [[' size=8 tabindex=3><i class='password-toggle'></i></td>
|
<td><input class='password-input' type=password name=passwd2 value=']] .. passwd2 .. [[' size=8 tabindex=3><i class='password-toggle'></i></td>
|
||||||
|
@ -1114,11 +1051,7 @@ html.print([[
|
||||||
|
|
||||||
-- mesh rf settings
|
-- mesh rf settings
|
||||||
html.print("<table width=100% style='border-collapse: collapse;'>")
|
html.print("<table width=100% style='border-collapse: collapse;'>")
|
||||||
if phycount > 1 then
|
html.print("<tr><th colspan=2>Mesh RF</th></tr>")
|
||||||
html.print("<tr><th colspan=2>Mesh RF (2GHz)</th></tr>")
|
|
||||||
else
|
|
||||||
html.print("<tr><th colspan=2>Mesh RF</th></tr>")
|
|
||||||
end
|
|
||||||
hidden[#hidden + 1] = "<input type=hidden name=wifi_proto value='static'>"
|
hidden[#hidden + 1] = "<input type=hidden name=wifi_proto value='static'>"
|
||||||
|
|
||||||
-- add enable/disable
|
-- add enable/disable
|
||||||
|
@ -1141,7 +1074,7 @@ if wifi_enable == "1" then
|
||||||
html.print("<tr><td>SSID</td><td><input type=text size=15 name=wifi_ssid value='" .. wifi_ssid .. "'>-" .. wifi_chanbw .. "-v3</td></tr>")
|
html.print("<tr><td>SSID</td><td><input type=text size=15 name=wifi_ssid value='" .. wifi_ssid .. "'>-" .. wifi_chanbw .. "-v3</td></tr>")
|
||||||
hidden[#hidden + 1] = "<input type=hidden name=wifi_mode value='" .. wifi_mode .. "'>"
|
hidden[#hidden + 1] = "<input type=hidden name=wifi_mode value='" .. wifi_mode .. "'>"
|
||||||
html.print("<tr><td>Channel</td><td><select name=wifi_channel>")
|
html.print("<tr><td>Channel</td><td><select name=wifi_channel>")
|
||||||
local rfchannels = rf_channels_list(wifiintf)
|
local rfchannels = aredn.hardware.get_rfchannels(wifiintf)
|
||||||
table.sort(rfchannels, function(a, b) return a.number < b.number end)
|
table.sort(rfchannels, function(a, b) return a.number < b.number end)
|
||||||
for _, chan in ipairs(rfchannels)
|
for _, chan in ipairs(rfchannels)
|
||||||
do
|
do
|
||||||
|
@ -1150,9 +1083,10 @@ if wifi_enable == "1" then
|
||||||
html.print("</select> <a href='/help.html#channel' target='_blank'><img src='/qmark.png'></a></td></tr>")
|
html.print("</select> <a href='/help.html#channel' target='_blank'><img src='/qmark.png'></a></td></tr>")
|
||||||
|
|
||||||
html.print("<tr><td>Channel Width</td><td><select name=wifi_chanbw>")
|
html.print("<tr><td>Channel Width</td><td><select name=wifi_chanbw>")
|
||||||
html.print("<option value='20'".. (wifi_chanbw == "20" and " selected" or "") .. ">20 MHz</option>")
|
for _, width in ipairs(aredn.hardware.get_rfbandwidths())
|
||||||
html.print("<option value='10'".. (wifi_chanbw == "10" and " selected" or "") .. ">10 MHz</option>")
|
do
|
||||||
html.print("<option value='5'".. (wifi_chanbw == "5" and " selected" or "") .. ">5 MHz</option>")
|
html.print("<option value='" .. width .. "'".. (wifi_chanbw == tostring(width) and " selected" or "") .. ">" .. width .. " MHz</option>")
|
||||||
|
end
|
||||||
html.print("</select></td></tr>")
|
html.print("</select></td></tr>")
|
||||||
|
|
||||||
hidden[#hidden + 1] = "<input type=hidden name=wifi_country value='HX'>"
|
hidden[#hidden + 1] = "<input type=hidden name=wifi_country value='HX'>"
|
||||||
|
@ -1274,8 +1208,9 @@ end
|
||||||
|
|
||||||
html.print("<tr><td colspan=2><hr></hr></td></tr>")
|
html.print("<tr><td colspan=2><hr></hr></td></tr>")
|
||||||
|
|
||||||
|
local APokay = nixio.fs.stat("/usr/sbin/wpad")
|
||||||
local M39model = aredn.hardware.get_board_id():match("M[39]")
|
local M39model = aredn.hardware.get_board_id():match("M[39]")
|
||||||
if (phycount > 1 and (wifi_enable ~= "1" or wifi3_enable ~= "1")) or (phycount == 1 and wifi_enable ~= "1" and wifi3_enable ~= "1") and not M39model then
|
if APokay and ((phycount > 1 and (wifi_enable ~= "1" or wifi3_enable ~= "1")) or (phycount == 1 and wifi_enable ~= "1" and wifi3_enable ~= "1") and not M39model) then
|
||||||
-- lan ap shows as an option
|
-- lan ap shows as an option
|
||||||
-- determine hardware options and set band ahd channels accordingly
|
-- determine hardware options and set band ahd channels accordingly
|
||||||
if phycount == 1 then
|
if phycount == 1 then
|
||||||
|
@ -1379,7 +1314,7 @@ html.print("<tr><td><nobr>DNS 2</nobr></td><td><input type=text size=15 name=wan
|
||||||
html.print("<tr><th colspan=2><hr></td></tr>")
|
html.print("<tr><th colspan=2><hr></td></tr>")
|
||||||
|
|
||||||
-- wan wifi client
|
-- wan wifi client
|
||||||
if (phycount > 1 and (wifi_enable ~= "1" or wifi2_enable ~= "1")) or (phycount == 1 and wifi_enable ~= "1" and wifi2_enable ~= "1") and not M39model then
|
if APokay and ((phycount > 1 and (wifi_enable ~= "1" or wifi2_enable ~= "1")) or (phycount == 1 and wifi_enable ~= "1" and wifi2_enable ~= "1")) and not M39model then
|
||||||
-- wifi client shows as an option
|
-- wifi client shows as an option
|
||||||
-- determine hardware options and set band accordingly
|
-- determine hardware options and set band accordingly
|
||||||
|
|
||||||
|
|
|
@ -179,11 +179,12 @@ local wifi_channel
|
||||||
local wifi_chanbw
|
local wifi_chanbw
|
||||||
local wifi_ssid
|
local wifi_ssid
|
||||||
if not wifi_disabled then
|
if not wifi_disabled then
|
||||||
wifi_channel = tonumber(cursor:get("wireless", radio, "channel"))
|
wifi_channel = cursor:get("wireless", radio, "channel")
|
||||||
|
wifi_channel = tonumber(wifi_channel) or 0
|
||||||
if wifi_channel >= 76 and wifi_channel <= 99 then
|
if wifi_channel >= 76 and wifi_channel <= 99 then
|
||||||
wifi_channel = wifi_channel * 5 + 3000
|
wifi_channel = wifi_channel * 5 + 3000
|
||||||
end
|
end
|
||||||
wifi_chanbw = cursor:get("wireless", radio, "chanbw")
|
wifi_chanbw = cursor:get("wireless", radio, "chanbw") or "20"
|
||||||
wifi_ssid = "none"
|
wifi_ssid = "none"
|
||||||
cursor:foreach("wireless", "wifi-iface",
|
cursor:foreach("wireless", "wifi-iface",
|
||||||
function (section)
|
function (section)
|
||||||
|
@ -222,8 +223,7 @@ end
|
||||||
|
|
||||||
if os.getenv("REQUEST_METHOD") == "POST" then
|
if os.getenv("REQUEST_METHOD") == "POST" then
|
||||||
require('luci.http')
|
require('luci.http')
|
||||||
require('luci.sys')
|
local request = luci.http.Request(nixio.getenv(),
|
||||||
local request = luci.http.Request(luci.sys.getenv(),
|
|
||||||
function()
|
function()
|
||||||
local v = io.read(1024)
|
local v = io.read(1024)
|
||||||
if not v then
|
if not v then
|
||||||
|
@ -265,7 +265,7 @@ html.print("<hr>")
|
||||||
html.print("<nobr>")
|
html.print("<nobr>")
|
||||||
html.print("<a href='/help.html' target='_blank'>Help</a>")
|
html.print("<a href='/help.html' target='_blank'>Help</a>")
|
||||||
html.print(" ")
|
html.print(" ")
|
||||||
html.print("<input type=submit name=refresh value=Refresh title='Refresh this page'>")
|
html.print("<input type=button name=refresh value=Refresh title='Refresh this page' onclick='window.location.reload()'>")
|
||||||
if config == "mesh" then
|
if config == "mesh" then
|
||||||
html.print(" ")
|
html.print(" ")
|
||||||
html.print("<button type=button onClick='window.location=\"mesh\"' title='See what is on the mesh'>Mesh Status</button>")
|
html.print("<button type=button onClick='window.location=\"mesh\"' title='See what is on the mesh'>Mesh Status</button>")
|
||||||
|
@ -290,8 +290,20 @@ html.print("<input type=hidden name=reload value=reload>")
|
||||||
|
|
||||||
if config == "not set" then
|
if config == "not set" then
|
||||||
html.print("<b><br><br>This node is not yet configured.<br>")
|
html.print("<b><br><br>This node is not yet configured.<br>")
|
||||||
html.print("Go to the setup page and set your node name and password.<br>")
|
local overlay = false
|
||||||
html.print("Click Save Changes, <u>even if you didn't make any changes</u>, then the node will reboot.</b>")
|
for line in io.lines("/proc/mounts")
|
||||||
|
do
|
||||||
|
if line:match("overlay") then
|
||||||
|
overlay = true
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if overlay then
|
||||||
|
html.print("Go to the <a href='setup'>setup page</a> and set your node name and password.<br>")
|
||||||
|
html.print("Click Save Changes, <u>even if you didn't make any changes</u>, then the node will reboot.</b>")
|
||||||
|
else
|
||||||
|
html.print("Go the the <a href='admin'>administration page</a> and upload new firmware.<br>")
|
||||||
|
end
|
||||||
html.print("<br><br>")
|
html.print("<br><br>")
|
||||||
html.print("<div style='max-width:540px; text-align:left'>")
|
html.print("<div style='max-width:540px; text-align:left'>")
|
||||||
html.print("<p>This device can be configured to either permit or prohibit known encrypted traffic on its RF link. It is up to the user to decide which is appropriate based on how it will be used and the license under which it will be operated. These rules vary by country, frequency, and intended use. You are encouraged to read and understand these rules before going further.</p>")
|
html.print("<p>This device can be configured to either permit or prohibit known encrypted traffic on its RF link. It is up to the user to decide which is appropriate based on how it will be used and the license under which it will be operated. These rules vary by country, frequency, and intended use. You are encouraged to read and understand these rules before going further.</p>")
|
||||||
|
|
|
@ -41,7 +41,7 @@ require("uci")
|
||||||
require("iwinfo")
|
require("iwinfo")
|
||||||
|
|
||||||
|
|
||||||
local wifiif = uci.cursor():get("network", "wifi", "ifname")
|
local wifiif = uci.cursor():get("network", "wifi", "device")
|
||||||
local phy = iwinfo.nl80211.phyname(wifiif)
|
local phy = iwinfo.nl80211.phyname(wifiif)
|
||||||
local mfg = capture("/usr/local/bin/get_hardware_mfg"):chomp()
|
local mfg = capture("/usr/local/bin/get_hardware_mfg"):chomp()
|
||||||
|
|
||||||
|
@ -51,13 +51,14 @@ local files = {
|
||||||
"/etc/config.mesh/",
|
"/etc/config.mesh/",
|
||||||
"/etc/local/",
|
"/etc/local/",
|
||||||
"/etc/mesh-release",
|
"/etc/mesh-release",
|
||||||
|
"/etc/os-release",
|
||||||
"/tmp/etc/",
|
"/tmp/etc/",
|
||||||
"/var/run/hosts_olsr",
|
"/var/run/hosts_olsr",
|
||||||
"/var/run/hosts_olsr.stable",
|
"/var/run/hosts_olsr.stable",
|
||||||
"/var/run/services_olsr",
|
"/var/run/services_olsr",
|
||||||
"/tmp/rssi.dat",
|
"/tmp/rssi.dat",
|
||||||
"/tmp/rssi.log",
|
"/tmp/rssi.log",
|
||||||
"/tmp/zombie.log",
|
"/tmp/rssi_ath10k.log",
|
||||||
"/tmp/olsrd.log",
|
"/tmp/olsrd.log",
|
||||||
"/tmp/manager.log",
|
"/tmp/manager.log",
|
||||||
"/tmp/manager.log.0",
|
"/tmp/manager.log.0",
|
||||||
|
@ -78,9 +79,11 @@ local cmds = {
|
||||||
"df -k",
|
"df -k",
|
||||||
"dmesg",
|
"dmesg",
|
||||||
"ifconfig",
|
"ifconfig",
|
||||||
"iptables -t filter -L -v",
|
"ethtool eth0",
|
||||||
"iptables -t nat -L -v",
|
"ethtool eth1",
|
||||||
"iptables -t mangle -L -v",
|
"ip link",
|
||||||
|
"ip addr",
|
||||||
|
"ip neigh",
|
||||||
"ip route list",
|
"ip route list",
|
||||||
"ip route list table 29",
|
"ip route list table 29",
|
||||||
"ip route list table 30",
|
"ip route list table 30",
|
||||||
|
@ -95,7 +98,7 @@ local cmds = {
|
||||||
"iw dev " .. wifiif .. " info",
|
"iw dev " .. wifiif .. " info",
|
||||||
"iw dev " .. wifiif .. " scan",
|
"iw dev " .. wifiif .. " scan",
|
||||||
"iw dev " .. wifiif .. " station dump",
|
"iw dev " .. wifiif .. " station dump",
|
||||||
"logread",
|
"nft list ruleset",
|
||||||
"md5sum /www/cgi-bin/*",
|
"md5sum /www/cgi-bin/*",
|
||||||
"echo /all | nc 127.0.0.1 2006",
|
"echo /all | nc 127.0.0.1 2006",
|
||||||
"opkg list-installed",
|
"opkg list-installed",
|
||||||
|
@ -104,6 +107,7 @@ local cmds = {
|
||||||
"/usr/local/bin/get_boardid",
|
"/usr/local/bin/get_boardid",
|
||||||
"/usr/local/bin/get_model",
|
"/usr/local/bin/get_model",
|
||||||
"/usr/local/bin/get_hardware_mfg",
|
"/usr/local/bin/get_hardware_mfg",
|
||||||
|
"logread",
|
||||||
}
|
}
|
||||||
local cmds_ubnt = {
|
local cmds_ubnt = {
|
||||||
"cat /dev/mtd0|grep 'U-Boot'|head -n1"
|
"cat /dev/mtd0|grep 'U-Boot'|head -n1"
|
||||||
|
@ -148,28 +152,26 @@ os.execute("sed -i -e 's/_key =.*$/_key =/' /tmp/sd/etc/config.mesh/_setup")
|
||||||
|
|
||||||
local f = io.open("/tmp/sd/data.txt", "w")
|
local f = io.open("/tmp/sd/data.txt", "w")
|
||||||
if f then
|
if f then
|
||||||
for _, cmd in ipairs(cmds)
|
|
||||||
do
|
|
||||||
local p = io.popen(cmd)
|
|
||||||
if p then
|
|
||||||
f:write("========== " .. cmd .. " ==========\n")
|
|
||||||
f:write(p:read("*a"))
|
|
||||||
p:close()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if mfg == "Ubiquiti" then
|
if mfg == "Ubiquiti" then
|
||||||
for _, cmd in ipairs(cmds_ubnt)
|
for _, cmd in ipairs(cmds_ubnt)
|
||||||
do
|
do
|
||||||
local p = io.popen(cmd)
|
local p = io.popen(cmd)
|
||||||
if p then
|
if p then
|
||||||
f:write("========== " .. cmd .. " (UBNT only) ==========\n")
|
f:write("\n========== " .. cmd .. " (UBNT only) ==========\n")
|
||||||
f:write(p:read("*a"))
|
f:write(p:read("*a"))
|
||||||
p:close()
|
p:close()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
for _, cmd in ipairs(cmds)
|
||||||
|
do
|
||||||
|
local p = io.popen(cmd)
|
||||||
|
if p then
|
||||||
|
f:write("\n========== " .. cmd .. " ==========\n")
|
||||||
|
f:write(p:read("*a"))
|
||||||
|
p:close()
|
||||||
|
end
|
||||||
|
end
|
||||||
f:close()
|
f:close()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,6 @@ require("aredn.html")
|
||||||
require("aredn.hardware")
|
require("aredn.hardware")
|
||||||
aredn.info = require("aredn.info")
|
aredn.info = require("aredn.info")
|
||||||
require("uci")
|
require("uci")
|
||||||
require("luci.sys")
|
|
||||||
|
|
||||||
local html = aredn.html
|
local html = aredn.html
|
||||||
|
|
||||||
|
@ -59,7 +58,7 @@ local VPNVER = "1.1"
|
||||||
local parms = {}
|
local parms = {}
|
||||||
if os.getenv("REQUEST_METHOD") == "POST" then
|
if os.getenv("REQUEST_METHOD") == "POST" then
|
||||||
require('luci.http')
|
require('luci.http')
|
||||||
local request = luci.http.Request(luci.sys.getenv(),
|
local request = luci.http.Request(nixio.getenv(),
|
||||||
function()
|
function()
|
||||||
local v = io.read(1024)
|
local v = io.read(1024)
|
||||||
if not v then
|
if not v then
|
||||||
|
@ -168,7 +167,7 @@ function get_client_info()
|
||||||
end
|
end
|
||||||
|
|
||||||
if parms.button_reboot then
|
if parms.button_reboot then
|
||||||
luci.sys.reboot()
|
os.execute("reboot >/dev/null 2>&1")
|
||||||
os.exit()
|
os.exit()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -391,12 +390,18 @@ html.print("<a href='/help.html#tunnels' target='_blank'>Help</a>")
|
||||||
html.print(" ")
|
html.print(" ")
|
||||||
html.print("<input type=submit name=button_save value='Save Changes' title='Save and use these settings now (takes about 20 seconds)'> ")
|
html.print("<input type=submit name=button_save value='Save Changes' title='Save and use these settings now (takes about 20 seconds)'> ")
|
||||||
html.print("<input type=submit name=button_reset value='Reset Values' title='Revert to the last saved settings'> ")
|
html.print("<input type=submit name=button_reset value='Reset Values' title='Revert to the last saved settings'> ")
|
||||||
html.print("<input type=submit name=button_refresh value='Refresh' title='Refresh this page'> ")
|
html.print("<input type=button name=button_refresh value='Refresh' title='Refresh this page' onclick='window.location.reload();'> ")
|
||||||
html.print("<tr><td> </td></tr>")
|
html.print("<tr><td> </td></tr>")
|
||||||
hide("<input type=hidden name=reload value=1></td></tr>")
|
hide("<input type=hidden name=reload value=1></td></tr>")
|
||||||
|
|
||||||
|
-- unsupported tunnels
|
||||||
|
local notunnels = not nixio.fs.stat("/usr/sbin/vtund")
|
||||||
|
if notunnels then
|
||||||
|
html.print("<tr><td align=center><span style=background-color:cyan;font-size:140%;> Tunnels are no longer supported on this hardware </span></td></tr>")
|
||||||
|
config = "notunnels"
|
||||||
|
cli_err = {}
|
||||||
-- low memory warning
|
-- low memory warning
|
||||||
if isLowMemNode() then
|
elseif isLowMemNode() then
|
||||||
html.print("<tr><td align=center><span style=background-color:cyan;font-size:140%;> Recommend not to use tunneling due to low memory on this node </span></td></tr>")
|
html.print("<tr><td align=center><span style=background-color:cyan;font-size:140%;> Recommend not to use tunneling due to low memory on this node </span></td></tr>")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,6 @@ require("aredn.html")
|
||||||
require("aredn.hardware")
|
require("aredn.hardware")
|
||||||
aredn.info = require("aredn.info")
|
aredn.info = require("aredn.info")
|
||||||
require("uci")
|
require("uci")
|
||||||
require("luci.sys")
|
|
||||||
|
|
||||||
local html = aredn.html
|
local html = aredn.html
|
||||||
|
|
||||||
|
@ -63,7 +62,7 @@ local VPNVER = "1.0"
|
||||||
local parms = {}
|
local parms = {}
|
||||||
if os.getenv("REQUEST_METHOD") == "POST" then
|
if os.getenv("REQUEST_METHOD") == "POST" then
|
||||||
require('luci.http')
|
require('luci.http')
|
||||||
local request = luci.http.Request(luci.sys.getenv(),
|
local request = luci.http.Request(nixio.getenv(),
|
||||||
function()
|
function()
|
||||||
local v = io.read(1024)
|
local v = io.read(1024)
|
||||||
if not v then
|
if not v then
|
||||||
|
@ -152,7 +151,7 @@ function get_connection_info()
|
||||||
end
|
end
|
||||||
|
|
||||||
if parms.button_reboot then
|
if parms.button_reboot then
|
||||||
luci.sys.reboot()
|
os.execute("reboot >/dev/null 2>&1")
|
||||||
os.exit()
|
os.exit()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -367,12 +366,16 @@ html.print("<a href='/help.html#tunnels' target='_blank'>Help</a>")
|
||||||
html.print(" ")
|
html.print(" ")
|
||||||
html.print("<input type=submit name=button_save value='Save Changes' title='Save and use these settings now (takes about 20 seconds)'> ")
|
html.print("<input type=submit name=button_save value='Save Changes' title='Save and use these settings now (takes about 20 seconds)'> ")
|
||||||
html.print("<input type=submit name=button_reset value='Reset Values' title='Revert to the last saved settings'> ")
|
html.print("<input type=submit name=button_reset value='Reset Values' title='Revert to the last saved settings'> ")
|
||||||
html.print("<input type=submit name=button_refresh value='Refresh' title='Refresh this page'> ")
|
html.print("<input type=button name=button_refresh value='Refresh' title='Refresh this page' onclick='window.location.reload();'> ")
|
||||||
html.print("<tr><td> </td></tr>")
|
html.print("<tr><td> </td></tr>")
|
||||||
hide("<input type=hidden name=reload value=1></td></tr>")
|
hide("<input type=hidden name=reload value=1></td></tr>")
|
||||||
|
|
||||||
|
local notunnels = not nixio.fs.stat("/usr/sbin/vtund")
|
||||||
|
if notunnels then
|
||||||
|
html.print("<tr><td align=center><span style=background-color:cyan;font-size:140%;> Tunnels are no longer supported on this hardware </span></td></tr>")
|
||||||
|
config = "notunnels"
|
||||||
-- low memory warning
|
-- low memory warning
|
||||||
if isLowMemNode() then
|
elseif isLowMemNode() then
|
||||||
html.print("<tr><td align=center><span style=background-color:cyan;font-size:140%;> Recommend not to use tunneling due to low memory on this node </span></td></tr>")
|
html.print("<tr><td align=center><span style=background-color:cyan;font-size:140%;> Recommend not to use tunneling due to low memory on this node </span></td></tr>")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ body table {
|
||||||
.navbar_select a:active { background:black; color:red }
|
.navbar_select a:active { background:black; color:red }
|
||||||
|
|
||||||
.TopBanner { width:100%; }
|
.TopBanner { width:100%; }
|
||||||
.LogoDiv { position:absolute left:0px; width:100%; height:95; }
|
.LogoDiv { left:0px; width:100%; height:95; }
|
||||||
.AREDNLogo { background: white; position:absolute; left:10%; width:175; height:95; }
|
.AREDNLogo { background: white; position:absolute; left:10%; width:175; height:95; }
|
||||||
.PartOfAREDN { font-family:Verdana,arial,sans-serif; font-size:xx-small; text-align:center; }
|
.PartOfAREDN { font-family:Verdana,arial,sans-serif; font-size:xx-small; text-align:center; }
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ body table {
|
||||||
.navbar_select a:active { background:black; color:white }
|
.navbar_select a:active { background:black; color:white }
|
||||||
|
|
||||||
.TopBanner { width:100%; }
|
.TopBanner { width:100%; }
|
||||||
.LogoDiv { position:absolute left:0px; width:100%; height:95; }
|
.LogoDiv { left:0px; width:100%; height:95; }
|
||||||
.AREDNLogo { background: white; position:absolute; left:10%; width:175; height:95; }
|
.AREDNLogo { background: white; position:absolute; left:10%; width:175; height:95; }
|
||||||
.PartOfAREDN { font-family:Verdana,arial,sans-serif; font-size:xx-small; text-align:center; }
|
.PartOfAREDN { font-family:Verdana,arial,sans-serif; font-size:xx-small; text-align:center; }
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ body table {
|
||||||
.navbar_select a:active { background:black; color:yellow }
|
.navbar_select a:active { background:black; color:yellow }
|
||||||
|
|
||||||
.TopBanner { width:100%; }
|
.TopBanner { width:100%; }
|
||||||
.LogoDiv { position:absolute left:0px; width:100%; height:95; }
|
.LogoDiv { left:0px; width:100%; height:95; }
|
||||||
.AREDNLogo { background: white; position:absolute; left:10%; width:175; height:95; }
|
.AREDNLogo { background: white; position:absolute; left:10%; width:175; height:95; }
|
||||||
.PartOfAREDN { font-family:Verdana,arial,sans-serif; font-size:xx-small; text-align:center; }
|
.PartOfAREDN { font-family:Verdana,arial,sans-serif; font-size:xx-small; text-align:center; }
|
||||||
|
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
OPENWRT_SRC=https://github.com/openwrt/openwrt.git
|
OPENWRT_SRC=https://github.com/openwrt/openwrt.git
|
||||||
|
|
||||||
# what branch, tag or commit in this repo?
|
# what branch, tag or commit in this repo?
|
||||||
OPENWRT_COMMIT=v19.07.10
|
OPENWRT_COMMIT=v22.03.2
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,189 @@
|
||||||
|
From d51e261e893451f9d0958a5ac39989d10b275e86 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andrew Cameron <apcameron@softhome.net>
|
||||||
|
Date: Sun, 6 Nov 2022 14:43:37 +0000
|
||||||
|
Subject: [PATCH 1/1] ath79: add support for TP-Link CPE605-v1 TP-Link
|
||||||
|
CPE605-v1 is an outdoor wireless CPE for 5 GHz with one Ethernet port based
|
||||||
|
on Atheros AR9344
|
||||||
|
|
||||||
|
Specifications:
|
||||||
|
- 560/450/225 MHz (CPU/DDR/AHB)
|
||||||
|
- 1x 10/100 Mbps Ethernet
|
||||||
|
- 64 MB of DDR2 RAM
|
||||||
|
- 8 MB of SPI-NOR Flash
|
||||||
|
- 23dBi high-gain directional antenna and a dedicated metal reflector
|
||||||
|
- Power, LAN, WLAN5G green LEDs
|
||||||
|
- 3x green RSSI LEDs
|
||||||
|
|
||||||
|
Flashing instructions:
|
||||||
|
Flash factory image through stock firmware WEB UI or through TFTP
|
||||||
|
To get to TFTP recovery just hold reset button while powering on for
|
||||||
|
around 4-5 seconds and release.
|
||||||
|
Rename factory image to recovery.bin
|
||||||
|
Stock TFTP server IP:192.168.0.100
|
||||||
|
Stock device TFTP adress:192.168.0.254
|
||||||
|
|
||||||
|
Signed-off-by: Andrew Cameron <apcameron@softhome.net>
|
||||||
|
---
|
||||||
|
.../ath79/dts/ar9344_tplink_cpe605-v1.dts | 33 +++++++++++++++++++
|
||||||
|
.../generic/base-files/etc/board.d/01_leds | 1 +
|
||||||
|
.../generic/base-files/etc/board.d/02_network | 1 +
|
||||||
|
target/linux/ath79/image/generic-tp-link.mk | 10 ++++++
|
||||||
|
4 files changed, 45 insertions(+)
|
||||||
|
create mode 100644 target/linux/ath79/dts/ar9344_tplink_cpe605-v1.dts
|
||||||
|
|
||||||
|
diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe605-v1.dts b/target/linux/ath79/dts/ar9344_tplink_cpe605-v1.dts
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000..0c6eee7ba6
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/target/linux/ath79/dts/ar9344_tplink_cpe605-v1.dts
|
||||||
|
@@ -0,0 +1,33 @@
|
||||||
|
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||||
|
+
|
||||||
|
+#include "ar9344_tplink_cpe.dtsi"
|
||||||
|
+
|
||||||
|
+/ {
|
||||||
|
+ model = "TP-Link CPE605 v1";
|
||||||
|
+ compatible = "tplink,cpe605-v1", "qca,ar9344";
|
||||||
|
+
|
||||||
|
+ aliases {
|
||||||
|
+ led-boot = &led_lan;
|
||||||
|
+ led-failsafe = &led_lan;
|
||||||
|
+ led-upgrade = &led_lan;
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+ leds {
|
||||||
|
+ compatible = "gpio-leds";
|
||||||
|
+
|
||||||
|
+ led_lan: lan {
|
||||||
|
+ label = "green:lan";
|
||||||
|
+ gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+ wlan5g {
|
||||||
|
+ label = "green:wlan5g";
|
||||||
|
+ gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
|
||||||
|
+ linux,default-trigger = "phy0tpt";
|
||||||
|
+ };
|
||||||
|
+ };
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+ð1 {
|
||||||
|
+ compatible = "syscon", "simple-mfd";
|
||||||
|
+};
|
||||||
|
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 606a194f7e..54d764f907 100644
|
||||||
|
--- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds
|
||||||
|
+++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
|
||||||
|
@@ -18,6 +18,7 @@ glinet,6416|\
|
||||||
|
glinet,gl-ar300m-lite|\
|
||||||
|
glinet,gl-ar300m16|\
|
||||||
|
pcs,cap324|\
|
||||||
|
+tplink,cpe605-v1|\
|
||||||
|
tplink,cpe610-v1|\
|
||||||
|
tplink,cpe610-v2|\
|
||||||
|
tplink,tl-wa1201-v2)
|
||||||
|
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 e47f66c2f2..2fa0487981 100644
|
||||||
|
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
|
||||||
|
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
|
||||||
|
@@ -76,6 +76,7 @@ ath79_setup_interfaces()
|
||||||
|
tplink,cpe210-v3|\
|
||||||
|
tplink,cpe510-v2|\
|
||||||
|
tplink,cpe510-v3|\
|
||||||
|
+ tplink,cpe605-v1|\
|
||||||
|
tplink,cpe610-v1|\
|
||||||
|
tplink,cpe610-v2|\
|
||||||
|
tplink,cpe710-v1|\
|
||||||
|
diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk
|
||||||
|
index 598085e50b..314ece1e03 100644
|
||||||
|
--- a/target/linux/ath79/image/generic-tp-link.mk
|
||||||
|
+++ b/target/linux/ath79/image/generic-tp-link.mk
|
||||||
|
@@ -350,6 +350,16 @@ define Device/tplink_cpe510-v3
|
||||||
|
endef
|
||||||
|
TARGET_DEVICES += tplink_cpe510-v3
|
||||||
|
|
||||||
|
+define Device/tplink_cpe605-v1
|
||||||
|
+ $(Device/tplink-safeloader-okli)
|
||||||
|
+ SOC := ar9344
|
||||||
|
+ IMAGE_SIZE := 7680k
|
||||||
|
+ DEVICE_MODEL := CPE605
|
||||||
|
+ DEVICE_VARIANT := v1
|
||||||
|
+ TPLINK_BOARD_ID := CPE605V1
|
||||||
|
+endef
|
||||||
|
+TARGET_DEVICES += tplink_cpe605-v1
|
||||||
|
+
|
||||||
|
define Device/tplink_cpe610-v1
|
||||||
|
$(Device/tplink-safeloader-okli)
|
||||||
|
SOC := ar9344
|
||||||
|
--
|
||||||
|
2.30.2
|
||||||
|
|
||||||
|
Index: openwrt/tools/firmware-utils/patches/0001-tplink-safeloader-add-TP-Link-CPE605-v1-Support.patch
|
||||||
|
===================================================================
|
||||||
|
--- /dev/null
|
||||||
|
+++ openwrt/tools/firmware-utils/patches/0001-tplink-safeloader-add-TP-Link-CPE605-v1-Support.patch
|
||||||
|
@@ -0,0 +1,64 @@
|
||||||
|
+From 2b43d1376a6945d07b2a87e48e3645eaa4f24d5a Mon Sep 17 00:00:00 2001
|
||||||
|
+From: Andrew Cameron <apcameron@softhome.net>
|
||||||
|
+Date: Wed, 9 Nov 2022 13:07:11 +0000
|
||||||
|
+Subject: [PATCH 1/1] tplink-safeloader: add TP-Link CPE605 v1 Support
|
||||||
|
+
|
||||||
|
+Enable creating images compatible with the TP-Link CPE605 v1 Router
|
||||||
|
+
|
||||||
|
+Signed-off-by: Andrew Cameron <apcameron@softhome.net>
|
||||||
|
+---
|
||||||
|
+ src/tplink-safeloader.c | 38 ++++++++++++++++++++++++++++++++++++++
|
||||||
|
+ 1 file changed, 38 insertions(+)
|
||||||
|
+
|
||||||
|
+diff --git a/src/tplink-safeloader.c b/src/tplink-safeloader.c
|
||||||
|
+index 7f9081d..b920191 100644
|
||||||
|
+--- a/src/tplink-safeloader.c
|
||||||
|
++++ b/src/tplink-safeloader.c
|
||||||
|
+@@ -468,6 +468,44 @@ static struct device_info boards[] = {
|
||||||
|
+ .last_sysupgrade_partition = "support-list",
|
||||||
|
+ },
|
||||||
|
+
|
||||||
|
++ /** Firmware layout for the CPE605V1 */
|
||||||
|
++ {
|
||||||
|
++ .id = "CPE605V1",
|
||||||
|
++ .vendor = "CPE605(TP-LINK|UN|N150-5):1.0\r\n",
|
||||||
|
++ .support_list =
|
||||||
|
++ "SupportList:\r\n"
|
||||||
|
++ "CPE605(TP-LINK|UN|N150-5|00000000):1.0\r\n"
|
||||||
|
++ "CPE605(TP-LINK|EU|N150-5|45550000):1.0\r\n"
|
||||||
|
++ "CPE605(TP-LINK|US|N150-5|55530000):1.0\r\n"
|
||||||
|
++ "CPE605(TP-LINK|UN|N150-5):1.0\r\n"
|
||||||
|
++ "CPE605(TP-LINK|EU|N150-5):1.0\r\n"
|
||||||
|
++ "CPE605(TP-LINK|US|N150-5):1.0\r\n",
|
||||||
|
++ .part_trail = 0xff,
|
||||||
|
++ .soft_ver = SOFT_VER_DEFAULT,
|
||||||
|
++
|
||||||
|
++ .partitions = {
|
||||||
|
++ {"fs-uboot", 0x00000, 0x20000},
|
||||||
|
++ {"partition-table", 0x20000, 0x02000},
|
||||||
|
++ {"default-mac", 0x30000, 0x00020},
|
||||||
|
++ {"serial-number", 0x30100, 0x00020},
|
||||||
|
++ {"product-info", 0x31100, 0x00100},
|
||||||
|
++ {"device-info", 0x31400, 0x00400},
|
||||||
|
++ {"signature", 0x32000, 0x00400},
|
||||||
|
++ {"device-id", 0x33000, 0x00100},
|
||||||
|
++ {"firmware", 0x40000, 0x770000},
|
||||||
|
++ {"soft-version", 0x7b0000, 0x00100},
|
||||||
|
++ {"support-list", 0x7b1000, 0x01000},
|
||||||
|
++ {"user-config", 0x7c0000, 0x10000},
|
||||||
|
++ {"default-config", 0x7d0000, 0x10000},
|
||||||
|
++ {"log", 0x7e0000, 0x10000},
|
||||||
|
++ {"radio", 0x7f0000, 0x10000},
|
||||||
|
++ {NULL, 0, 0}
|
||||||
|
++ },
|
||||||
|
++
|
||||||
|
++ .first_sysupgrade_partition = "os-image",
|
||||||
|
++ .last_sysupgrade_partition = "support-list",
|
||||||
|
++ },
|
||||||
|
++
|
||||||
|
+ /** Firmware layout for the CPE610V1 */
|
||||||
|
+ {
|
||||||
|
+ .id = "CPE610V1",
|
||||||
|
+--
|
||||||
|
+2.30.2
|
||||||
|
+
|
|
@ -1,15 +0,0 @@
|
||||||
Index: openwrt/target/linux/ar71xx/base-files/etc/board.d/01_leds
|
|
||||||
===================================================================
|
|
||||||
--- openwrt.orig/target/linux/ar71xx/base-files/etc/board.d/01_leds
|
|
||||||
+++ openwrt/target/linux/ar71xx/base-files/etc/board.d/01_leds
|
|
||||||
@@ -435,8 +435,8 @@ gl-mifi)
|
|
||||||
;;
|
|
||||||
gl-ar150)
|
|
||||||
ucidef_set_led_wlan "wlan" "WLAN" "$board:orange:wlan" "phy0tpt"
|
|
||||||
- ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
|
|
||||||
- ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth1"
|
|
||||||
+ ucidef_set_led_netdev "wan" "WAN" "$board:green:lan" "eth0"
|
|
||||||
+ ucidef_set_led_netdev "lan" "LAN" "$board:green:wan" "eth1"
|
|
||||||
;;
|
|
||||||
gl-ar300)
|
|
||||||
ucidef_set_led_wlan "wlan" "WLAN" "$board:wlan" "phy0tpt"
|
|
|
@ -1,71 +0,0 @@
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/01_leds
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/01_leds
|
|
||||||
@@ -148,6 +148,7 @@ tplink,archer-d50-v1)
|
|
||||||
ucidef_set_led_switch "wan_link" "WAN Link" "tp-link:white:wan" "switch0" "0x02" "" "link"
|
|
||||||
;;
|
|
||||||
tplink,cpe510-v1|\
|
|
||||||
+tplink,cpe210-v1|\
|
|
||||||
tplink,cpe220-v2|\
|
|
||||||
tplink,cpe220-v3)
|
|
||||||
ucidef_set_led_netdev "lan0" "LAN0" "tp-link:green:lan0" "eth1"
|
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/02_network
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
|
|
||||||
@@ -120,6 +120,7 @@ ath79_setup_interfaces()
|
|
||||||
comfast,cf-e110n-v2|\
|
|
||||||
comfast,cf-e120a-v3|\
|
|
||||||
tplink,cpe510-v1|\
|
|
||||||
+ tplink,cpe210-v1|\
|
|
||||||
tplink,cpe220-v2|\
|
|
||||||
tplink,cpe220-v3|\
|
|
||||||
ubnt,nanostation-m|\
|
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/03_gpio_switches
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/03_gpio_switches
|
|
||||||
@@ -28,6 +28,7 @@ tplink,archer-c25-v1)
|
|
||||||
ucidef_add_gpio_switch "led_reset" "LED reset" "19" "1"
|
|
||||||
;;
|
|
||||||
tplink,cpe510-v1|\
|
|
||||||
+tplink,cpe210-v1|\
|
|
||||||
tplink,cpe220-v2|\
|
|
||||||
tplink,cpe220-v3)
|
|
||||||
ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "20"
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/target/linux/ath79/dts/ar9344_tplink_cpe210-v1.dts
|
|
||||||
@@ -0,0 +1,13 @@
|
|
||||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
|
||||||
+/dts-v1/;
|
|
||||||
+
|
|
||||||
+#include "ar9344_tplink_cpe_2port.dtsi"
|
|
||||||
+
|
|
||||||
+/ {
|
|
||||||
+ compatible = "tplink,cpe210-v1", "qca,ar9344";
|
|
||||||
+ model = "TP-Link CPE210 v1";
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+&led_link4 {
|
|
||||||
+ gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
|
|
||||||
+};
|
|
||||||
--- a/target/linux/ath79/image/generic-tp-link.mk
|
|
||||||
+++ b/target/linux/ath79/image/generic-tp-link.mk
|
|
||||||
@@ -153,6 +153,22 @@ define Device/tplink_archer-c7-v5
|
|
||||||
endef
|
|
||||||
TARGET_DEVICES += tplink_archer-c7-v5
|
|
||||||
|
|
||||||
+define Device/tplink_cpe210-v1
|
|
||||||
+ $(Device/tplink-safeloader)
|
|
||||||
+ ATH_SOC := ar9344
|
|
||||||
+ IMAGE_SIZE := 7680k
|
|
||||||
+ DEVICE_TITLE := TP-Link CPE210 v1
|
|
||||||
+ DEVICE_PACKAGES := rssileds
|
|
||||||
+ TPLINK_BOARD_ID := CPE210
|
|
||||||
+ LOADER_TYPE := elf
|
|
||||||
+ LOADER_FLASH_OFFS := 0x43000
|
|
||||||
+ COMPILE := loader-$(1).elf
|
|
||||||
+ COMPILE/loader-$(1).elf := loader-okli-compile
|
|
||||||
+ KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 12288
|
|
||||||
+ SUPPORTED_DEVICES += cpe210
|
|
||||||
+endef
|
|
||||||
+TARGET_DEVICES += tplink_cpe210-v1
|
|
||||||
+
|
|
||||||
define Device/tplink_cpe210-v2
|
|
||||||
$(Device/tplink-safeloader)
|
|
||||||
ATH_SOC := qca9533
|
|
|
@ -1,147 +0,0 @@
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/01_leds
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/01_leds
|
|
||||||
@@ -147,6 +147,7 @@ tplink,archer-d50-v1)
|
|
||||||
ucidef_set_led_switch "wan_data" "WAN Data" "tp-link:white:internet" "switch0" "0x02" "" "tx rx"
|
|
||||||
ucidef_set_led_switch "wan_link" "WAN Link" "tp-link:white:wan" "switch0" "0x02" "" "link"
|
|
||||||
;;
|
|
||||||
+tplink,cpe220-v2|\
|
|
||||||
tplink,cpe220-v3)
|
|
||||||
ucidef_set_led_netdev "lan0" "LAN0" "tp-link:green:lan0" "eth1"
|
|
||||||
ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
|
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/02_network
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
|
|
||||||
@@ -119,6 +119,7 @@ ath79_setup_interfaces()
|
|
||||||
;;
|
|
||||||
comfast,cf-e110n-v2|\
|
|
||||||
comfast,cf-e120a-v3|\
|
|
||||||
+ tplink,cpe220-v2|\
|
|
||||||
tplink,cpe220-v3|\
|
|
||||||
ubnt,nanostation-m|\
|
|
||||||
ubnt,routerstation)
|
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/03_gpio_switches
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/03_gpio_switches
|
|
||||||
@@ -27,6 +27,7 @@ tplink,archer-c25-v1)
|
|
||||||
ucidef_add_gpio_switch "led_control" "LED control" "21" "0"
|
|
||||||
ucidef_add_gpio_switch "led_reset" "LED reset" "19" "1"
|
|
||||||
;;
|
|
||||||
+tplink,cpe220-v2|\
|
|
||||||
tplink,cpe220-v3)
|
|
||||||
ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "20"
|
|
||||||
;;
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/target/linux/ath79/dts/ar9344_tplink_cpe220-v2.dts
|
|
||||||
@@ -0,0 +1,13 @@
|
|
||||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
|
||||||
+/dts-v1/;
|
|
||||||
+
|
|
||||||
+#include "ar9344_tplink_cpe_2port.dtsi"
|
|
||||||
+
|
|
||||||
+/ {
|
|
||||||
+ compatible = "tplink,cpe220-v2", "qca,ar9344";
|
|
||||||
+ model = "TP-Link CPE220 v2";
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+&led_link4 {
|
|
||||||
+ gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
|
|
||||||
+};
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/target/linux/ath79/dts/ar9344_tplink_cpe_2port.dtsi
|
|
||||||
@@ -0,0 +1,73 @@
|
|
||||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
|
||||||
+
|
|
||||||
+#include "ar9344_tplink_cpe.dtsi"
|
|
||||||
+
|
|
||||||
+/ {
|
|
||||||
+ aliases {
|
|
||||||
+ led-boot = &led_link4;
|
|
||||||
+ led-failsafe = &led_link4;
|
|
||||||
+ led-running = &led_link4;
|
|
||||||
+ led-upgrade = &led_link4;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ leds {
|
|
||||||
+ compatible = "gpio-leds";
|
|
||||||
+
|
|
||||||
+ lan0 {
|
|
||||||
+ label = "tp-link:green:lan0";
|
|
||||||
+ gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ lan1 {
|
|
||||||
+ label = "tp-link:green:lan1";
|
|
||||||
+ gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ link1 {
|
|
||||||
+ label = "tp-link:green:link1";
|
|
||||||
+ gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ link2 {
|
|
||||||
+ label = "tp-link:green:link2";
|
|
||||||
+ gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ link3 {
|
|
||||||
+ label = "tp-link:green:link3";
|
|
||||||
+ gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ led_link4: link4 {
|
|
||||||
+ label = "tp-link:green:link4";
|
|
||||||
+ };
|
|
||||||
+ };
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+&gpio {
|
|
||||||
+ gpio_ext_lna0 {
|
|
||||||
+ gpio-hog;
|
|
||||||
+ gpios = <18 0>;
|
|
||||||
+ output-high;
|
|
||||||
+ line-name = "tp-link:ext:lna0";
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ gpio_ext_lna1 {
|
|
||||||
+ gpio-hog;
|
|
||||||
+ gpios = <19 0>;
|
|
||||||
+ output-high;
|
|
||||||
+ line-name = "tp-link:ext:lna1";
|
|
||||||
+ };
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+ð1 {
|
|
||||||
+ status = "okay";
|
|
||||||
+
|
|
||||||
+ mtd-mac-address = <&info 0x8>;
|
|
||||||
+
|
|
||||||
+ gmac-config {
|
|
||||||
+ device = <&gmac>;
|
|
||||||
+ switch-phy-swap = <0>;
|
|
||||||
+ switch-only-mode = <1>;
|
|
||||||
+ };
|
|
||||||
+};
|
|
||||||
--- a/target/linux/ath79/image/generic-tp-link.mk
|
|
||||||
+++ b/target/linux/ath79/image/generic-tp-link.mk
|
|
||||||
@@ -177,6 +177,22 @@ define Device/tplink_cpe210-v3
|
|
||||||
endef
|
|
||||||
TARGET_DEVICES += tplink_cpe210-v3
|
|
||||||
|
|
||||||
+define Device/tplink_cpe220-v2
|
|
||||||
+ $(Device/tplink-safeloader)
|
|
||||||
+ ATH_SOC := ar9344
|
|
||||||
+ IMAGE_SIZE := 7680k
|
|
||||||
+ DEVICE_TITLE := TP-Link CPE220 v2
|
|
||||||
+ DEVICE_PACKAGES := rssileds
|
|
||||||
+ TPLINK_BOARD_ID := CPE210
|
|
||||||
+ LOADER_TYPE := elf
|
|
||||||
+ LOADER_FLASH_OFFS := 0x43000
|
|
||||||
+ COMPILE := loader-$(1).elf
|
|
||||||
+ COMPILE/loader-$(1).elf := loader-okli-compile
|
|
||||||
+ KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 12288
|
|
||||||
+ SUPPORTED_DEVICES += cpe220-v2
|
|
||||||
+endef
|
|
||||||
+TARGET_DEVICES += tplink_cpe220-v2
|
|
||||||
+
|
|
||||||
define Device/tplink_cpe220-v3
|
|
||||||
$(Device/tplink-safeloader)
|
|
||||||
ATH_SOC := qca9533
|
|
|
@ -1,71 +0,0 @@
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/01_leds
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/01_leds
|
|
||||||
@@ -147,6 +147,7 @@ tplink,archer-d50-v1)
|
|
||||||
ucidef_set_led_switch "wan_data" "WAN Data" "tp-link:white:internet" "switch0" "0x02" "" "tx rx"
|
|
||||||
ucidef_set_led_switch "wan_link" "WAN Link" "tp-link:white:wan" "switch0" "0x02" "" "link"
|
|
||||||
;;
|
|
||||||
+tplink,cpe510-v1|\
|
|
||||||
tplink,cpe220-v2|\
|
|
||||||
tplink,cpe220-v3)
|
|
||||||
ucidef_set_led_netdev "lan0" "LAN0" "tp-link:green:lan0" "eth1"
|
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/02_network
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
|
|
||||||
@@ -119,6 +119,7 @@ ath79_setup_interfaces()
|
|
||||||
;;
|
|
||||||
comfast,cf-e110n-v2|\
|
|
||||||
comfast,cf-e120a-v3|\
|
|
||||||
+ tplink,cpe510-v1|\
|
|
||||||
tplink,cpe220-v2|\
|
|
||||||
tplink,cpe220-v3|\
|
|
||||||
ubnt,nanostation-m|\
|
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/03_gpio_switches
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/03_gpio_switches
|
|
||||||
@@ -27,6 +27,7 @@ tplink,archer-c25-v1)
|
|
||||||
ucidef_add_gpio_switch "led_control" "LED control" "21" "0"
|
|
||||||
ucidef_add_gpio_switch "led_reset" "LED reset" "19" "1"
|
|
||||||
;;
|
|
||||||
+tplink,cpe510-v1|\
|
|
||||||
tplink,cpe220-v2|\
|
|
||||||
tplink,cpe220-v3)
|
|
||||||
ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "20"
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/target/linux/ath79/dts/ar9344_tplink_cpe510-v1.dts
|
|
||||||
@@ -0,0 +1,13 @@
|
|
||||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
|
||||||
+/dts-v1/;
|
|
||||||
+
|
|
||||||
+#include "ar9344_tplink_cpe_2port.dtsi"
|
|
||||||
+
|
|
||||||
+/ {
|
|
||||||
+ compatible = "tplink,cpe510-v1", "qca,ar9344";
|
|
||||||
+ model = "TP-Link CPE510 v1";
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+&led_link4 {
|
|
||||||
+ gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
|
|
||||||
+};
|
|
||||||
--- a/target/linux/ath79/image/generic-tp-link.mk
|
|
||||||
+++ b/target/linux/ath79/image/generic-tp-link.mk
|
|
||||||
@@ -204,6 +204,22 @@ define Device/tplink_cpe220-v3
|
|
||||||
endef
|
|
||||||
TARGET_DEVICES += tplink_cpe220-v3
|
|
||||||
|
|
||||||
+define Device/tplink_cpe510-v1
|
|
||||||
+ $(Device/tplink-safeloader)
|
|
||||||
+ ATH_SOC := ar9344
|
|
||||||
+ IMAGE_SIZE := 7680k
|
|
||||||
+ DEVICE_TITLE := TP-Link CPE510 v1
|
|
||||||
+ DEVICE_PACKAGES := rssileds
|
|
||||||
+ TPLINK_BOARD_ID := CPE510
|
|
||||||
+ LOADER_TYPE := elf
|
|
||||||
+ LOADER_FLASH_OFFS := 0x43000
|
|
||||||
+ COMPILE := loader-$(1).elf
|
|
||||||
+ COMPILE/loader-$(1).elf := loader-okli-compile
|
|
||||||
+ KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 12288
|
|
||||||
+ SUPPORTED_DEVICES += cpe510
|
|
||||||
+endef
|
|
||||||
+TARGET_DEVICES += tplink_cpe510-v1
|
|
||||||
+
|
|
||||||
define Device/tplink_cpe510-v2
|
|
||||||
$(Device/tplink-safeloader)
|
|
||||||
ATH_SOC := ar9344
|
|
|
@ -1,261 +0,0 @@
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/01_leds
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/01_leds
|
|
||||||
@@ -165,6 +165,15 @@ tplink,cpe210-v3)
|
|
||||||
ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "60" "100"
|
|
||||||
ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "80" "100"
|
|
||||||
;;
|
|
||||||
+tplink,cpe510-v2|\
|
|
||||||
+tplink,cpe510-v3)
|
|
||||||
+ ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
|
|
||||||
+ ucidef_set_rssimon "wlan0" "200000" "1"
|
|
||||||
+ ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:green:link1" "wlan0" "1" "100" "0" "13"
|
|
||||||
+ ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:green:link2" "wlan0" "26" "100" "-25" "13"
|
|
||||||
+ ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "51" "100" "-50" "13"
|
|
||||||
+ ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
|
|
||||||
+ ;;
|
|
||||||
tplink,re450-v2)
|
|
||||||
ucidef_set_led_netdev "lan_data" "LAN Data" "tp-link:green:lan_data" "eth0" "tx rx"
|
|
||||||
ucidef_set_led_netdev "lan_link" "LAN Link" "tp-link:green:lan_link" "eth0" "link"
|
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/02_network
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
|
|
||||||
@@ -26,6 +26,8 @@ ath79_setup_interfaces()
|
|
||||||
pqi,air-pen|\
|
|
||||||
tplink,cpe210-v2|\
|
|
||||||
tplink,cpe210-v3|\
|
|
||||||
+ tplink,cpe510-v2|\
|
|
||||||
+ tplink,cpe510-v3|\
|
|
||||||
tplink,re350k-v1|\
|
|
||||||
tplink,re450-v2|\
|
|
||||||
tplink,tl-mr10u|\
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi
|
|
||||||
@@ -0,0 +1,112 @@
|
|
||||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
|
||||||
+
|
|
||||||
+#include <dt-bindings/gpio/gpio.h>
|
|
||||||
+#include <dt-bindings/input/input.h>
|
|
||||||
+
|
|
||||||
+#include "ar9344.dtsi"
|
|
||||||
+
|
|
||||||
+/ {
|
|
||||||
+ aliases {
|
|
||||||
+ label-mac-device = &wmac;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ keys {
|
|
||||||
+ compatible = "gpio-keys";
|
|
||||||
+
|
|
||||||
+ reset {
|
|
||||||
+ linux,code = <KEY_RESTART>;
|
|
||||||
+ gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
|
|
||||||
+ debounce-interval = <60>;
|
|
||||||
+ };
|
|
||||||
+ };
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+&ref {
|
|
||||||
+ clock-frequency = <40000000>;
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+&uart {
|
|
||||||
+ status = "okay";
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+&spi {
|
|
||||||
+ status = "okay";
|
|
||||||
+
|
|
||||||
+ num-cs = <1>;
|
|
||||||
+
|
|
||||||
+ flash@0 {
|
|
||||||
+ compatible = "jedec,spi-nor";
|
|
||||||
+ reg = <0>;
|
|
||||||
+ spi-max-frequency = <25000000>;
|
|
||||||
+
|
|
||||||
+ partitions {
|
|
||||||
+ compatible = "fixed-partitions";
|
|
||||||
+ #address-cells = <1>;
|
|
||||||
+ #size-cells = <1>;
|
|
||||||
+
|
|
||||||
+ uboot: partition@0 {
|
|
||||||
+ label = "u-boot";
|
|
||||||
+ reg = <0x000000 0x020000>;
|
|
||||||
+ read-only;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ partition@20000 {
|
|
||||||
+ label = "partition-table";
|
|
||||||
+ reg = <0x020000 0x010000>;
|
|
||||||
+ read-only;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ info: partition@30000 {
|
|
||||||
+ label = "info";
|
|
||||||
+ reg = <0x030000 0x010000>;
|
|
||||||
+ read-only;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ partition@40000 {
|
|
||||||
+ label = "firmware";
|
|
||||||
+ reg = <0x040000 0x780000>;
|
|
||||||
+
|
|
||||||
+ compatible = "fixed-partitions";
|
|
||||||
+ #address-cells = <1>;
|
|
||||||
+ #size-cells = <1>;
|
|
||||||
+
|
|
||||||
+ partition@0 {
|
|
||||||
+ label = "kernel";
|
|
||||||
+ reg = <0x000000 0x1c0000>;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ partition@1c0000 {
|
|
||||||
+ label = "rootfs";
|
|
||||||
+ reg = <0x1c0000 0x5c0000>;
|
|
||||||
+ };
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ partition@7c0000 {
|
|
||||||
+ label = "config";
|
|
||||||
+ reg = <0x7c0000 0x030000>;
|
|
||||||
+ read-only;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ art: partition@7f0000 {
|
|
||||||
+ label = "art";
|
|
||||||
+ reg = <0x7f0000 0x010000>;
|
|
||||||
+ read-only;
|
|
||||||
+ };
|
|
||||||
+ };
|
|
||||||
+ };
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+&wmac {
|
|
||||||
+ status = "okay";
|
|
||||||
+
|
|
||||||
+ mtd-cal-data = <&art 0x1000>;
|
|
||||||
+ mtd-mac-address = <&info 0x08>;
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+ð0 {
|
|
||||||
+ status = "okay";
|
|
||||||
+
|
|
||||||
+ phy-handle = <&swphy4>;
|
|
||||||
+
|
|
||||||
+ mtd-mac-address = <&info 0x8>;
|
|
||||||
+};
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/target/linux/ath79/dts/ar9344_tplink_cpe510-v2.dts
|
|
||||||
@@ -0,0 +1,10 @@
|
|
||||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
|
||||||
+/dts-v1/;
|
|
||||||
+
|
|
||||||
+#include "ar9344_tplink_cpe_1port.dtsi"
|
|
||||||
+
|
|
||||||
+/ {
|
|
||||||
+ compatible = "tplink,cpe510-v2", "qca,ar9344";
|
|
||||||
+ model = "TP-Link CPE510 v2";
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/target/linux/ath79/dts/ar9344_tplink_cpe510-v3.dts
|
|
||||||
@@ -0,0 +1,10 @@
|
|
||||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
|
||||||
+/dts-v1/;
|
|
||||||
+
|
|
||||||
+#include "ar9344_tplink_cpe_1port.dtsi"
|
|
||||||
+
|
|
||||||
+/ {
|
|
||||||
+ compatible = "tplink,cpe510-v3", "qca,ar9344";
|
|
||||||
+ model = "TP-Link CPE510 v3";
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/target/linux/ath79/dts/ar9344_tplink_cpe_1port.dtsi
|
|
||||||
@@ -0,0 +1,47 @@
|
|
||||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
|
||||||
+
|
|
||||||
+#include "ar9344_tplink_cpe.dtsi"
|
|
||||||
+
|
|
||||||
+/ {
|
|
||||||
+ aliases {
|
|
||||||
+ led-boot = &led_system;
|
|
||||||
+ led-failsafe = &led_system;
|
|
||||||
+ led-running = &led_system;
|
|
||||||
+ led-upgrade = &led_system;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ leds {
|
|
||||||
+ compatible = "gpio-leds";
|
|
||||||
+
|
|
||||||
+ lan {
|
|
||||||
+ label = "tp-link:green:lan";
|
|
||||||
+ gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ link1 {
|
|
||||||
+ label = "tp-link:green:link1";
|
|
||||||
+ gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ link2 {
|
|
||||||
+ label = "tp-link:green:link2";
|
|
||||||
+ gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ link3 {
|
|
||||||
+ label = "tp-link:green:link3";
|
|
||||||
+ gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ led_system: link4 {
|
|
||||||
+ label = "tp-link:green:link4";
|
|
||||||
+ gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
|
|
||||||
+ };
|
|
||||||
+ };
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+ð1 {
|
|
||||||
+ status = "okay";
|
|
||||||
+
|
|
||||||
+ compatible = "syscon", "simple-mfd";
|
|
||||||
+};
|
|
||||||
--- a/target/linux/ath79/image/generic-tp-link.mk
|
|
||||||
+++ b/target/linux/ath79/image/generic-tp-link.mk
|
|
||||||
@@ -188,6 +188,38 @@ define Device/tplink_cpe220-v3
|
|
||||||
endef
|
|
||||||
TARGET_DEVICES += tplink_cpe220-v3
|
|
||||||
|
|
||||||
+define Device/tplink_cpe510-v2
|
|
||||||
+ $(Device/tplink-safeloader)
|
|
||||||
+ ATH_SOC := ar9344
|
|
||||||
+ IMAGE_SIZE := 7680k
|
|
||||||
+ DEVICE_TITLE := TP-Link CPE510 v2
|
|
||||||
+ DEVICE_PACKAGES := rssileds
|
|
||||||
+ TPLINK_BOARD_ID := CPE510V2
|
|
||||||
+ LOADER_TYPE := elf
|
|
||||||
+ LOADER_FLASH_OFFS := 0x43000
|
|
||||||
+ COMPILE := loader-$(1).elf
|
|
||||||
+ COMPILE/loader-$(1).elf := loader-okli-compile
|
|
||||||
+ KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 12288
|
|
||||||
+ SUPPORTED_DEVICES += cpe510-v2
|
|
||||||
+endef
|
|
||||||
+TARGET_DEVICES += tplink_cpe510-v2
|
|
||||||
+
|
|
||||||
+define Device/tplink_cpe510-v3
|
|
||||||
+ $(Device/tplink-safeloader)
|
|
||||||
+ ATH_SOC := ar9344
|
|
||||||
+ IMAGE_SIZE := 7680k
|
|
||||||
+ DEVICE_TITLE := TP-Link CPE510 v3
|
|
||||||
+ DEVICE_PACKAGES := rssileds
|
|
||||||
+ TPLINK_BOARD_ID := CPE510V2
|
|
||||||
+ LOADER_TYPE := elf
|
|
||||||
+ LOADER_FLASH_OFFS := 0x43000
|
|
||||||
+ COMPILE := loader-$(1).elf
|
|
||||||
+ COMPILE/loader-$(1).elf := loader-okli-compile
|
|
||||||
+ KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 12288
|
|
||||||
+ SUPPORTED_DEVICES += cpe510-v3
|
|
||||||
+endef
|
|
||||||
+TARGET_DEVICES += tplink_cpe510-v3
|
|
||||||
+
|
|
||||||
define Device/tplink_archer-d50-v1
|
|
||||||
ATH_SOC := qca9531
|
|
||||||
DEVICE_TITLE := TP-Link Archer D50 v1
|
|
|
@ -1,124 +0,0 @@
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/01_leds
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/01_leds
|
|
||||||
@@ -174,6 +174,9 @@ tplink,cpe510-v3)
|
|
||||||
ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "51" "100" "-50" "13"
|
|
||||||
ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
|
|
||||||
;;
|
|
||||||
+tplink,cpe610-v1)
|
|
||||||
+ ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
|
|
||||||
+ ;;
|
|
||||||
tplink,re450-v2)
|
|
||||||
ucidef_set_led_netdev "lan_data" "LAN Data" "tp-link:green:lan_data" "eth0" "tx rx"
|
|
||||||
ucidef_set_led_netdev "lan_link" "LAN Link" "tp-link:green:lan_link" "eth0" "link"
|
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/02_network
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
|
|
||||||
@@ -28,6 +28,7 @@ ath79_setup_interfaces()
|
|
||||||
tplink,cpe210-v3|\
|
|
||||||
tplink,cpe510-v2|\
|
|
||||||
tplink,cpe510-v3|\
|
|
||||||
+ tplink,cpe610-v1|\
|
|
||||||
tplink,re350k-v1|\
|
|
||||||
tplink,re450-v2|\
|
|
||||||
tplink,tl-mr10u|\
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/target/linux/ath79/dts/ar9344_tplink_cpe610-v1.dts
|
|
||||||
@@ -0,0 +1,36 @@
|
|
||||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
|
||||||
+/dts-v1/;
|
|
||||||
+
|
|
||||||
+#include "ar9344_tplink_cpe.dtsi"
|
|
||||||
+
|
|
||||||
+/ {
|
|
||||||
+ model = "TP-Link CPE610 v1";
|
|
||||||
+ compatible = "tplink,cpe610-v1", "qca,ar9344";
|
|
||||||
+
|
|
||||||
+ aliases {
|
|
||||||
+ led-boot = &led_lan;
|
|
||||||
+ led-failsafe = &led_lan;
|
|
||||||
+ led-upgrade = &led_lan;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ leds {
|
|
||||||
+ compatible = "gpio-leds";
|
|
||||||
+
|
|
||||||
+ led_lan: lan {
|
|
||||||
+ label = "tp-link:green:lan";
|
|
||||||
+ gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ wlan5g {
|
|
||||||
+ label = "tp-link:green:wlan5g";
|
|
||||||
+ gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
|
|
||||||
+ linux,default-trigger = "phy0tpt";
|
|
||||||
+ };
|
|
||||||
+ };
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+ð1 {
|
|
||||||
+ status = "okay";
|
|
||||||
+
|
|
||||||
+ compatible = "syscon", "simple-mfd";
|
|
||||||
+};
|
|
||||||
--- a/target/linux/ath79/image/generic-tp-link.mk
|
|
||||||
+++ b/target/linux/ath79/image/generic-tp-link.mk
|
|
||||||
@@ -220,6 +220,22 @@ define Device/tplink_cpe510-v3
|
|
||||||
endef
|
|
||||||
TARGET_DEVICES += tplink_cpe510-v3
|
|
||||||
|
|
||||||
+define Device/tplink_cpe610-v1
|
|
||||||
+ $(Device/tplink-safeloader)
|
|
||||||
+ ATH_SOC := ar9344
|
|
||||||
+ IMAGE_SIZE := 7680k
|
|
||||||
+ DEVICE_TITLE := TP-Link CPE610 v1
|
|
||||||
+ DEVICE_PACKAGES := rssileds
|
|
||||||
+ TPLINK_BOARD_ID := CPE610
|
|
||||||
+ LOADER_TYPE := elf
|
|
||||||
+ LOADER_FLASH_OFFS := 0x43000
|
|
||||||
+ COMPILE := loader-$(1).elf
|
|
||||||
+ COMPILE/loader-$(1).elf := loader-okli-compile
|
|
||||||
+ KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 12288
|
|
||||||
+ SUPPORTED_DEVICES += cpe610
|
|
||||||
+endef
|
|
||||||
+TARGET_DEVICES += tplink_cpe610-v1
|
|
||||||
+
|
|
||||||
define Device/tplink_archer-d50-v1
|
|
||||||
ATH_SOC := qca9531
|
|
||||||
DEVICE_TITLE := TP-Link Archer D50 v1
|
|
||||||
--- a/tools/firmware-utils/src/tplink-safeloader.c
|
|
||||||
+++ b/tools/firmware-utils/src/tplink-safeloader.c
|
|
||||||
@@ -309,21 +309,20 @@ static struct device_info boards[] = {
|
|
||||||
.soft_ver = NULL,
|
|
||||||
|
|
||||||
.partitions = {
|
|
||||||
- {"fs-uboot", 0x00000, 0x20000},
|
|
||||||
- {"partition-table", 0x20000, 0x02000},
|
|
||||||
- {"default-mac", 0x30000, 0x00020},
|
|
||||||
- {"product-info", 0x31100, 0x00100},
|
|
||||||
- {"device-info", 0x31400, 0x00400},
|
|
||||||
- {"signature", 0x32000, 0x00400},
|
|
||||||
- {"device-id", 0x33000, 0x00100},
|
|
||||||
- {"firmware", 0x40000, 0x770000},
|
|
||||||
- {"soft-version", 0x7b0000, 0x00100},
|
|
||||||
- {"support-list", 0x7b1000, 0x01000},
|
|
||||||
- {"user-config", 0x7c0000, 0x10000},
|
|
||||||
- {"default-config", 0x7d0000, 0x10000},
|
|
||||||
- {"log", 0x7e0000, 0x10000},
|
|
||||||
- {"radio", 0x7f0000, 0x10000},
|
|
||||||
- {NULL, 0, 0}
|
|
||||||
+ {"fs-uboot", 0x00000, 0x20000},
|
|
||||||
+ {"partition-table", 0x20000, 0x02000},
|
|
||||||
+ {"default-mac", 0x30000, 0x00020},
|
|
||||||
+ {"product-info", 0x31100, 0x00100},
|
|
||||||
+ {"signature", 0x32000, 0x00400},
|
|
||||||
+ {"os-image", 0x40000, 0x1c0000},
|
|
||||||
+ {"file-system", 0x200000, 0x5b0000},
|
|
||||||
+ {"soft-version", 0x7b0000, 0x00100},
|
|
||||||
+ {"support-list", 0x7b1000, 0x00400},
|
|
||||||
+ {"user-config", 0x7c0000, 0x10000},
|
|
||||||
+ {"default-config", 0x7d0000, 0x10000},
|
|
||||||
+ {"log", 0x7e0000, 0x10000},
|
|
||||||
+ {"radio", 0x7f0000, 0x10000},
|
|
||||||
+ {NULL, 0, 0}
|
|
||||||
},
|
|
||||||
|
|
||||||
.first_sysupgrade_partition = "os-image",
|
|
|
@ -1,135 +0,0 @@
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/01_leds
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/01_leds
|
|
||||||
@@ -174,7 +174,8 @@ tplink,cpe510-v3)
|
|
||||||
ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "51" "100" "-50" "13"
|
|
||||||
ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
|
|
||||||
;;
|
|
||||||
-tplink,cpe610-v1)
|
|
||||||
+tplink,cpe610-v1|\
|
|
||||||
+tplink,cpe610-v2)
|
|
||||||
ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
|
|
||||||
;;
|
|
||||||
tplink,re450-v2)
|
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/02_network
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
|
|
||||||
@@ -29,6 +29,7 @@ ath79_setup_interfaces()
|
|
||||||
tplink,cpe510-v2|\
|
|
||||||
tplink,cpe510-v3|\
|
|
||||||
tplink,cpe610-v1|\
|
|
||||||
+ tplink,cpe610-v2|\
|
|
||||||
tplink,re350k-v1|\
|
|
||||||
tplink,re450-v2|\
|
|
||||||
tplink,tl-mr10u|\
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/target/linux/ath79/dts/ar9344_tplink_cpe610-v2.dts
|
|
||||||
@@ -0,0 +1,36 @@
|
|
||||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
|
||||||
+/dts-v1/;
|
|
||||||
+
|
|
||||||
+#include "ar9344_tplink_cpe.dtsi"
|
|
||||||
+
|
|
||||||
+/ {
|
|
||||||
+ model = "TP-Link CPE610 v2";
|
|
||||||
+ compatible = "tplink,cpe610-v2", "qca,ar9344";
|
|
||||||
+
|
|
||||||
+ aliases {
|
|
||||||
+ led-boot = &led_lan;
|
|
||||||
+ led-failsafe = &led_lan;
|
|
||||||
+ led-upgrade = &led_lan;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ leds {
|
|
||||||
+ compatible = "gpio-leds";
|
|
||||||
+
|
|
||||||
+ led_lan: lan {
|
|
||||||
+ label = "tp-link:green:lan";
|
|
||||||
+ gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ wlan5g {
|
|
||||||
+ label = "tp-link:green:wlan5g";
|
|
||||||
+ gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
|
|
||||||
+ linux,default-trigger = "phy0tpt";
|
|
||||||
+ };
|
|
||||||
+ };
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+ð1 {
|
|
||||||
+ status = "okay";
|
|
||||||
+
|
|
||||||
+ compatible = "syscon", "simple-mfd";
|
|
||||||
+};
|
|
||||||
--- a/target/linux/ath79/image/generic-tp-link.mk
|
|
||||||
+++ b/target/linux/ath79/image/generic-tp-link.mk
|
|
||||||
@@ -236,6 +236,22 @@ define Device/tplink_cpe610-v1
|
|
||||||
endef
|
|
||||||
TARGET_DEVICES += tplink_cpe610-v1
|
|
||||||
|
|
||||||
+define Device/tplink_cpe610-v2
|
|
||||||
+ $(Device/tplink-safeloader)
|
|
||||||
+ ATH_SOC := ar9344
|
|
||||||
+ IMAGE_SIZE := 7680k
|
|
||||||
+ DEVICE_TITLE := TP-Link CPE610 v2
|
|
||||||
+ DEVICE_PACKAGES := rssileds
|
|
||||||
+ TPLINK_BOARD_ID := CPE610V2
|
|
||||||
+ LOADER_TYPE := elf
|
|
||||||
+ LOADER_FLASH_OFFS := 0x43000
|
|
||||||
+ COMPILE := loader-$(1).elf
|
|
||||||
+ COMPILE/loader-$(1).elf := loader-okli-compile
|
|
||||||
+ KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 12288
|
|
||||||
+ SUPPORTED_DEVICES += cpe610-v2
|
|
||||||
+endef
|
|
||||||
+TARGET_DEVICES += tplink_cpe610-v2
|
|
||||||
+
|
|
||||||
define Device/tplink_archer-d50-v1
|
|
||||||
ATH_SOC := qca9531
|
|
||||||
DEVICE_TITLE := TP-Link Archer D50 v1
|
|
||||||
--- a/tools/firmware-utils/src/tplink-safeloader.c
|
|
||||||
+++ b/tools/firmware-utils/src/tplink-safeloader.c
|
|
||||||
@@ -249,6 +249,46 @@ static struct device_info boards[] = {
|
|
||||||
.last_sysupgrade_partition = "support-list",
|
|
||||||
},
|
|
||||||
|
|
||||||
+ /** Firmware layout for the CPE610 v2 */
|
|
||||||
+ {
|
|
||||||
+ .id = "CPE610V2",
|
|
||||||
+ .vendor = "CPE610(TP-LINK|UN|N300-5|00000000):2.0\r\n",
|
|
||||||
+ .support_list =
|
|
||||||
+ "SupportList:\r\n"
|
|
||||||
+ "CPE610(TP-LINK|EU|N300-5|00000000):2.0\r\n"
|
|
||||||
+ "CPE610(TP-LINK|EU|N300-5|45550000):2.0\r\n"
|
|
||||||
+ "CPE610(TP-LINK|EU|N300-5|55530000):2.0\r\n"
|
|
||||||
+ "CPE610(TP-LINK|UN|N300-5|00000000):2.0\r\n"
|
|
||||||
+ "CPE610(TP-LINK|UN|N300-5|45550000):2.0\r\n"
|
|
||||||
+ "CPE610(TP-LINK|UN|N300-5|55530000):2.0\r\n"
|
|
||||||
+ "CPE610(TP-LINK|US|N300-5|55530000):2.0\r\n"
|
|
||||||
+ "CPE610(TP-LINK|UN|N300-5):2.0\r\n"
|
|
||||||
+ "CPE610(TP-LINK|EU|N300-5):2.0\r\n"
|
|
||||||
+ "CPE610(TP-LINK|US|N300-5):2.0\r\n",
|
|
||||||
+ .support_trail = '\xff',
|
|
||||||
+ .soft_ver = NULL,
|
|
||||||
+
|
|
||||||
+ .partitions = {
|
|
||||||
+ {"fs-uboot", 0x00000, 0x20000},
|
|
||||||
+ {"partition-table", 0x20000, 0x02000},
|
|
||||||
+ {"default-mac", 0x30000, 0x00020},
|
|
||||||
+ {"product-info", 0x31100, 0x00100},
|
|
||||||
+ {"signature", 0x32000, 0x00400},
|
|
||||||
+ {"os-image", 0x40000, 0x1c0000},
|
|
||||||
+ {"file-system", 0x200000, 0x5b0000},
|
|
||||||
+ {"soft-version", 0x7b0000, 0x00100},
|
|
||||||
+ {"support-list", 0x7b1000, 0x00400},
|
|
||||||
+ {"user-config", 0x7c0000, 0x10000},
|
|
||||||
+ {"default-config", 0x7d0000, 0x10000},
|
|
||||||
+ {"log", 0x7e0000, 0x10000},
|
|
||||||
+ {"radio", 0x7f0000, 0x10000},
|
|
||||||
+ {NULL, 0, 0}
|
|
||||||
+ },
|
|
||||||
+
|
|
||||||
+ .first_sysupgrade_partition = "os-image",
|
|
||||||
+ .last_sysupgrade_partition = "support-list",
|
|
||||||
+ },
|
|
||||||
+
|
|
||||||
/** Firmware layout for the CPE220 V3 */
|
|
||||||
{
|
|
||||||
.id = "CPE220V3",
|
|
|
@ -1,71 +0,0 @@
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/01_leds
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/01_leds
|
|
||||||
@@ -147,6 +147,7 @@ tplink,archer-d50-v1)
|
|
||||||
ucidef_set_led_switch "wan_data" "WAN Data" "tp-link:white:internet" "switch0" "0x02" "" "tx rx"
|
|
||||||
ucidef_set_led_switch "wan_link" "WAN Link" "tp-link:white:wan" "switch0" "0x02" "" "link"
|
|
||||||
;;
|
|
||||||
+tplink,wbs210-v1|\
|
|
||||||
tplink,cpe510-v1|\
|
|
||||||
tplink,cpe210-v1|\
|
|
||||||
tplink,cpe220-v2|\
|
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/02_network
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
|
|
||||||
@@ -119,6 +119,7 @@ ath79_setup_interfaces()
|
|
||||||
;;
|
|
||||||
comfast,cf-e110n-v2|\
|
|
||||||
comfast,cf-e120a-v3|\
|
|
||||||
+ tplink,wbs210-v1|\
|
|
||||||
tplink,cpe510-v1|\
|
|
||||||
tplink,cpe210-v1|\
|
|
||||||
tplink,cpe220-v2|\
|
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/03_gpio_switches
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/03_gpio_switches
|
|
||||||
@@ -27,6 +27,7 @@ tplink,archer-c25-v1)
|
|
||||||
ucidef_add_gpio_switch "led_control" "LED control" "21" "0"
|
|
||||||
ucidef_add_gpio_switch "led_reset" "LED reset" "19" "1"
|
|
||||||
;;
|
|
||||||
+tplink,wbs210-v1|\
|
|
||||||
tplink,cpe510-v1|\
|
|
||||||
tplink,cpe210-v1|\
|
|
||||||
tplink,cpe220-v2|\
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/target/linux/ath79/dts/ar9344_tplink_wbs210-v1.dts
|
|
||||||
@@ -0,0 +1,13 @@
|
|
||||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
|
||||||
+/dts-v1/;
|
|
||||||
+
|
|
||||||
+#include "ar9344_tplink_cpe_2port.dtsi"
|
|
||||||
+
|
|
||||||
+/ {
|
|
||||||
+ compatible = "tplink,wbs210-v1", "qca,ar9344";
|
|
||||||
+ model = "TP-Link WBS210 v1";
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+&led_link4 {
|
|
||||||
+ gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
|
|
||||||
+};
|
|
||||||
--- a/target/linux/ath79/image/generic-tp-link.mk
|
|
||||||
+++ b/target/linux/ath79/image/generic-tp-link.mk
|
|
||||||
@@ -300,6 +300,22 @@ define Device/tplink_cpe610-v2
|
|
||||||
endef
|
|
||||||
TARGET_DEVICES += tplink_cpe610-v2
|
|
||||||
|
|
||||||
+define Device/tplink_wbs210-v1
|
|
||||||
+ $(Device/tplink-safeloader)
|
|
||||||
+ ATH_SOC := ar9344
|
|
||||||
+ IMAGE_SIZE := 7680k
|
|
||||||
+ DEVICE_TITLE := TP-Link WBS210 v1
|
|
||||||
+ DEVICE_PACKAGES := rssileds
|
|
||||||
+ TPLINK_BOARD_ID := WBS210
|
|
||||||
+ LOADER_TYPE := elf
|
|
||||||
+ LOADER_FLASH_OFFS := 0x43000
|
|
||||||
+ COMPILE := loader-$(1).elf
|
|
||||||
+ COMPILE/loader-$(1).elf := loader-okli-compile
|
|
||||||
+ KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 12288
|
|
||||||
+ SUPPORTED_DEVICES += wbs210
|
|
||||||
+endef
|
|
||||||
+TARGET_DEVICES += tplink_wbs210-v1
|
|
||||||
+
|
|
||||||
define Device/tplink_archer-d50-v1
|
|
||||||
ATH_SOC := qca9531
|
|
||||||
DEVICE_TITLE := TP-Link Archer D50 v1
|
|
|
@ -1,117 +0,0 @@
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/01_leds
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/01_leds
|
|
||||||
@@ -148,6 +148,7 @@ tplink,archer-d50-v1)
|
|
||||||
ucidef_set_led_switch "wan_link" "WAN Link" "tp-link:white:wan" "switch0" "0x02" "" "link"
|
|
||||||
;;
|
|
||||||
tplink,wbs210-v1|\
|
|
||||||
+tplink,wbs210-v2|\
|
|
||||||
tplink,cpe510-v1|\
|
|
||||||
tplink,cpe210-v1|\
|
|
||||||
tplink,cpe220-v2|\
|
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/02_network
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
|
|
||||||
@@ -120,6 +120,7 @@ ath79_setup_interfaces()
|
|
||||||
comfast,cf-e110n-v2|\
|
|
||||||
comfast,cf-e120a-v3|\
|
|
||||||
tplink,wbs210-v1|\
|
|
||||||
+ tplink,wbs210-v2|\
|
|
||||||
tplink,cpe510-v1|\
|
|
||||||
tplink,cpe210-v1|\
|
|
||||||
tplink,cpe220-v2|\
|
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/03_gpio_switches
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/03_gpio_switches
|
|
||||||
@@ -28,6 +28,7 @@ tplink,archer-c25-v1)
|
|
||||||
ucidef_add_gpio_switch "led_reset" "LED reset" "19" "1"
|
|
||||||
;;
|
|
||||||
tplink,wbs210-v1|\
|
|
||||||
+tplink,wbs210-v2|\
|
|
||||||
tplink,cpe510-v1|\
|
|
||||||
tplink,cpe210-v1|\
|
|
||||||
tplink,cpe220-v2|\
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/target/linux/ath79/dts/ar9344_tplink_wbs210-v2.dts
|
|
||||||
@@ -0,0 +1,13 @@
|
|
||||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
|
||||||
+/dts-v1/;
|
|
||||||
+
|
|
||||||
+#include "ar9344_tplink_cpe_2port.dtsi"
|
|
||||||
+
|
|
||||||
+/ {
|
|
||||||
+ compatible = "tplink,wbs210-v2", "qca,ar9344";
|
|
||||||
+ model = "TP-Link WBS210 v2";
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+&led_link4 {
|
|
||||||
+ gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
|
|
||||||
+};
|
|
||||||
--- a/target/linux/ath79/image/generic-tp-link.mk
|
|
||||||
+++ b/target/linux/ath79/image/generic-tp-link.mk
|
|
||||||
@@ -316,6 +316,22 @@ define Device/tplink_wbs210-v1
|
|
||||||
endef
|
|
||||||
TARGET_DEVICES += tplink_wbs210-v1
|
|
||||||
|
|
||||||
+define Device/tplink_wbs210-v2
|
|
||||||
+ $(Device/tplink-safeloader)
|
|
||||||
+ ATH_SOC := ar9344
|
|
||||||
+ IMAGE_SIZE := 7680k
|
|
||||||
+ DEVICE_TITLE := TP-Link WBS210 v2
|
|
||||||
+ DEVICE_PACKAGES := rssileds
|
|
||||||
+ TPLINK_BOARD_ID := WBS210V2
|
|
||||||
+ LOADER_TYPE := elf
|
|
||||||
+ LOADER_FLASH_OFFS := 0x43000
|
|
||||||
+ COMPILE := loader-$(1).elf
|
|
||||||
+ COMPILE/loader-$(1).elf := loader-okli-compile
|
|
||||||
+ KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 12288
|
|
||||||
+ SUPPORTED_DEVICES += wbs210-v2
|
|
||||||
+endef
|
|
||||||
+TARGET_DEVICES += tplink_wbs210-v2
|
|
||||||
+
|
|
||||||
define Device/tplink_archer-d50-v1
|
|
||||||
ATH_SOC := qca9531
|
|
||||||
DEVICE_TITLE := TP-Link Archer D50 v1
|
|
||||||
--- a/tools/firmware-utils/src/tplink-safeloader.c
|
|
||||||
+++ b/tools/firmware-utils/src/tplink-safeloader.c
|
|
||||||
@@ -1,4 +1,3 @@
|
|
||||||
-
|
|
||||||
/*
|
|
||||||
Copyright (c) 2014, Matthias Schiffer <mschiffer@universe-factory.net>
|
|
||||||
All rights reserved.
|
|
||||||
@@ -502,6 +501,38 @@ static struct device_info boards[] = {
|
|
||||||
.support_trail = '\xff',
|
|
||||||
.soft_ver = NULL,
|
|
||||||
|
|
||||||
+ .partitions = {
|
|
||||||
+ {"fs-uboot", 0x00000, 0x20000},
|
|
||||||
+ {"partition-table", 0x20000, 0x02000},
|
|
||||||
+ {"default-mac", 0x30000, 0x00020},
|
|
||||||
+ {"product-info", 0x31100, 0x00100},
|
|
||||||
+ {"signature", 0x32000, 0x00400},
|
|
||||||
+ {"os-image", 0x40000, 0x1c0000},
|
|
||||||
+ {"file-system", 0x200000, 0x5b0000},
|
|
||||||
+ {"soft-version", 0x7b0000, 0x00100},
|
|
||||||
+ {"support-list", 0x7b1000, 0x00400},
|
|
||||||
+ {"user-config", 0x7c0000, 0x10000},
|
|
||||||
+ {"default-config", 0x7d0000, 0x10000},
|
|
||||||
+ {"log", 0x7e0000, 0x10000},
|
|
||||||
+ {"radio", 0x7f0000, 0x10000},
|
|
||||||
+ {NULL, 0, 0}
|
|
||||||
+ },
|
|
||||||
+
|
|
||||||
+ .first_sysupgrade_partition = "os-image",
|
|
||||||
+ .last_sysupgrade_partition = "support-list",
|
|
||||||
+ },
|
|
||||||
+
|
|
||||||
+ {
|
|
||||||
+ .id = "WBS210V2",
|
|
||||||
+ .vendor = "CPE510(TP-LINK|UN|N300-5):1.0\r\n",
|
|
||||||
+ .support_list =
|
|
||||||
+ "SupportList:\r\n"
|
|
||||||
+ "WBS210(TP-LINK|UN|N300-2|00000000):2.00\r\n"
|
|
||||||
+ "WBS210(TP-LINK|US|N300-2|55530000):2.00\r\n"
|
|
||||||
+ "WBS210(TP-LINK|EU|N300-2|45550000):2.00\r\n",
|
|
||||||
+ .support_trail = '\xff',
|
|
||||||
+ .soft_ver = NULL,
|
|
||||||
+
|
|
||||||
.partitions = {
|
|
||||||
{"fs-uboot", 0x00000, 0x20000},
|
|
||||||
{"partition-table", 0x20000, 0x02000},
|
|
|
@ -1,71 +0,0 @@
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/01_leds
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/01_leds
|
|
||||||
@@ -149,6 +149,7 @@ tplink,archer-d50-v1)
|
|
||||||
;;
|
|
||||||
tplink,wbs210-v1|\
|
|
||||||
tplink,wbs210-v2|\
|
|
||||||
+tplink,wbs510-v1|\
|
|
||||||
tplink,cpe510-v1|\
|
|
||||||
tplink,cpe210-v1|\
|
|
||||||
tplink,cpe220-v2|\
|
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/02_network
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
|
|
||||||
@@ -121,6 +121,7 @@ ath79_setup_interfaces()
|
|
||||||
comfast,cf-e120a-v3|\
|
|
||||||
tplink,wbs210-v1|\
|
|
||||||
tplink,wbs210-v2|\
|
|
||||||
+ tplink,wbs510-v1|\
|
|
||||||
tplink,cpe510-v1|\
|
|
||||||
tplink,cpe210-v1|\
|
|
||||||
tplink,cpe220-v2|\
|
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/03_gpio_switches
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/03_gpio_switches
|
|
||||||
@@ -29,6 +29,7 @@ tplink,archer-c25-v1)
|
|
||||||
;;
|
|
||||||
tplink,wbs210-v1|\
|
|
||||||
tplink,wbs210-v2|\
|
|
||||||
+tplink,wbs510-v1|\
|
|
||||||
tplink,cpe510-v1|\
|
|
||||||
tplink,cpe210-v1|\
|
|
||||||
tplink,cpe220-v2|\
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/target/linux/ath79/dts/ar9344_tplink_wbs510-v1.dts
|
|
||||||
@@ -0,0 +1,13 @@
|
|
||||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
|
||||||
+/dts-v1/;
|
|
||||||
+
|
|
||||||
+#include "ar9344_tplink_cpe_2port.dtsi"
|
|
||||||
+
|
|
||||||
+/ {
|
|
||||||
+ compatible = "tplink,wbs510-v1", "qca,ar9344";
|
|
||||||
+ model = "TP-Link WBS510 v1";
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+&led_link4 {
|
|
||||||
+ gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
|
|
||||||
+};
|
|
||||||
--- a/target/linux/ath79/image/generic-tp-link.mk
|
|
||||||
+++ b/target/linux/ath79/image/generic-tp-link.mk
|
|
||||||
@@ -332,6 +332,22 @@ define Device/tplink_wbs210-v2
|
|
||||||
endef
|
|
||||||
TARGET_DEVICES += tplink_wbs210-v2
|
|
||||||
|
|
||||||
+define Device/tplink_wbs510-v1
|
|
||||||
+ $(Device/tplink-safeloader)
|
|
||||||
+ ATH_SOC := ar9344
|
|
||||||
+ IMAGE_SIZE := 7680k
|
|
||||||
+ DEVICE_TITLE := TP-Link WBS510 v1
|
|
||||||
+ DEVICE_PACKAGES := rssileds
|
|
||||||
+ TPLINK_BOARD_ID := WBS510
|
|
||||||
+ LOADER_TYPE := elf
|
|
||||||
+ LOADER_FLASH_OFFS := 0x43000
|
|
||||||
+ COMPILE := loader-$(1).elf
|
|
||||||
+ COMPILE/loader-$(1).elf := loader-okli-compile
|
|
||||||
+ KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 12288
|
|
||||||
+ SUPPORTED_DEVICES += wbs510
|
|
||||||
+endef
|
|
||||||
+TARGET_DEVICES += tplink_wbs510-v1
|
|
||||||
+
|
|
||||||
define Device/tplink_archer-d50-v1
|
|
||||||
ATH_SOC := qca9531
|
|
||||||
DEVICE_TITLE := TP-Link Archer D50 v1
|
|
|
@ -1,71 +0,0 @@
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/01_leds
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/01_leds
|
|
||||||
@@ -150,6 +150,7 @@ tplink,archer-d50-v1)
|
|
||||||
tplink,wbs210-v1|\
|
|
||||||
tplink,wbs210-v2|\
|
|
||||||
tplink,wbs510-v1|\
|
|
||||||
+tplink,wbs510-v2|\
|
|
||||||
tplink,cpe510-v1|\
|
|
||||||
tplink,cpe210-v1|\
|
|
||||||
tplink,cpe220-v2|\
|
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/02_network
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
|
|
||||||
@@ -122,6 +122,7 @@ ath79_setup_interfaces()
|
|
||||||
tplink,wbs210-v1|\
|
|
||||||
tplink,wbs210-v2|\
|
|
||||||
tplink,wbs510-v1|\
|
|
||||||
+ tplink,wbs510-v2|\
|
|
||||||
tplink,cpe510-v1|\
|
|
||||||
tplink,cpe210-v1|\
|
|
||||||
tplink,cpe220-v2|\
|
|
||||||
--- a/target/linux/ath79/base-files/etc/board.d/03_gpio_switches
|
|
||||||
+++ b/target/linux/ath79/base-files/etc/board.d/03_gpio_switches
|
|
||||||
@@ -30,6 +30,7 @@ tplink,archer-c25-v1)
|
|
||||||
tplink,wbs210-v1|\
|
|
||||||
tplink,wbs210-v2|\
|
|
||||||
tplink,wbs510-v1|\
|
|
||||||
+tplink,wbs510-v2|\
|
|
||||||
tplink,cpe510-v1|\
|
|
||||||
tplink,cpe210-v1|\
|
|
||||||
tplink,cpe220-v2|\
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/target/linux/ath79/dts/ar9344_tplink_wbs510-v2.dts
|
|
||||||
@@ -0,0 +1,13 @@
|
|
||||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
|
||||||
+/dts-v1/;
|
|
||||||
+
|
|
||||||
+#include "ar9344_tplink_cpe_2port.dtsi"
|
|
||||||
+
|
|
||||||
+/ {
|
|
||||||
+ compatible = "tplink,wbs510-v2", "qca,ar9344";
|
|
||||||
+ model = "TP-Link WBS510 v2";
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+&led_link4 {
|
|
||||||
+ gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
|
|
||||||
+};
|
|
||||||
--- a/target/linux/ath79/image/generic-tp-link.mk
|
|
||||||
+++ b/target/linux/ath79/image/generic-tp-link.mk
|
|
||||||
@@ -348,6 +348,22 @@ define Device/tplink_wbs510-v1
|
|
||||||
endef
|
|
||||||
TARGET_DEVICES += tplink_wbs510-v1
|
|
||||||
|
|
||||||
+define Device/tplink_wbs510-v2
|
|
||||||
+ $(Device/tplink-safeloader)
|
|
||||||
+ ATH_SOC := ar9344
|
|
||||||
+ IMAGE_SIZE := 7680k
|
|
||||||
+ DEVICE_TITLE := TP-Link WBS510 v2
|
|
||||||
+ DEVICE_PACKAGES := rssileds
|
|
||||||
+ TPLINK_BOARD_ID := WBS510V2
|
|
||||||
+ LOADER_TYPE := elf
|
|
||||||
+ LOADER_FLASH_OFFS := 0x43000
|
|
||||||
+ COMPILE := loader-$(1).elf
|
|
||||||
+ COMPILE/loader-$(1).elf := loader-okli-compile
|
|
||||||
+ KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 12288
|
|
||||||
+ SUPPORTED_DEVICES += wbs510-v2
|
|
||||||
+endef
|
|
||||||
+TARGET_DEVICES += tplink_wbs510-v2
|
|
||||||
+
|
|
||||||
define Device/tplink_archer-d50-v1
|
|
||||||
ATH_SOC := qca9531
|
|
||||||
DEVICE_TITLE := TP-Link Archer D50 v1
|
|
|
@ -1,103 +0,0 @@
|
||||||
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
|
|
||||||
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
|
|
||||||
@@ -254,6 +254,7 @@ cf-e530n)
|
|
||||||
cpe210|\
|
|
||||||
cpe210-v2|\
|
|
||||||
cpe210-v3|\
|
|
||||||
+cpe220-v2|\
|
|
||||||
cpe220-v3|\
|
|
||||||
cpe510|\
|
|
||||||
cpe510-v2|\
|
|
||||||
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
|
|
||||||
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
|
|
||||||
@@ -290,6 +290,7 @@ ar71xx_setup_interfaces()
|
|
||||||
"0@eth0" "2:lan" "1:wan" "6@eth1"
|
|
||||||
;;
|
|
||||||
cpe210|\
|
|
||||||
+ cpe220-v2|\
|
|
||||||
cpe220-v3|\
|
|
||||||
cpe510|\
|
|
||||||
wbs210|\
|
|
||||||
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
|
|
||||||
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
|
|
||||||
@@ -759,6 +759,10 @@ ar71xx_board_detect() {
|
|
||||||
name="cpe210-v3"
|
|
||||||
tplink_pharos_board_detect "$(tplink_pharos_v2_get_model_string)"
|
|
||||||
;;
|
|
||||||
+ *"CPE220 v2")
|
|
||||||
+ name="cpe220-v2"
|
|
||||||
+ tplink_pharos_board_detect "$(tplink_pharos_v2_get_model_string)"
|
|
||||||
+ ;;
|
|
||||||
*"CPE220 v3")
|
|
||||||
name="cpe220-v3"
|
|
||||||
tplink_pharos_board_detect "$(tplink_pharos_v2_get_model_string)"
|
|
||||||
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
|
|
||||||
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
|
|
||||||
@@ -599,6 +599,7 @@ platform_check_image() {
|
|
||||||
tplink_pharos_check_image "$1" "01000000" "$(tplink_pharos_v2_get_model_string)" '\0\xff\r' && return 0
|
|
||||||
return 1
|
|
||||||
;;
|
|
||||||
+ cpe220-v2|\
|
|
||||||
cpe610|\
|
|
||||||
cpe510-v2|\
|
|
||||||
cpe510-v3)
|
|
||||||
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
|
|
||||||
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
|
|
||||||
@@ -334,6 +334,9 @@ MIPS_MACHINE(ATH79_MACH_CPE210_V2, "CPE2
|
|
||||||
MIPS_MACHINE(ATH79_MACH_CPE210_V3, "CPE210V3", "TP-LINK CPE210 v3",
|
|
||||||
cpe210_v2_setup);
|
|
||||||
|
|
||||||
+MIPS_MACHINE(ATH79_MACH_CPE220_V2, "CPE220V2", "TP-LINK CPE220 v2",
|
|
||||||
+ cpe210_setup);
|
|
||||||
+
|
|
||||||
MIPS_MACHINE(ATH79_MACH_CPE220_V3, "CPE220V3", "TP-LINK CPE220 v3",
|
|
||||||
cpe220_v3_setup);
|
|
||||||
|
|
||||||
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
|
|
||||||
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
|
|
||||||
@@ -77,6 +77,7 @@ enum ath79_mach_type {
|
|
||||||
ATH79_MACH_CPE210, /* TP-LINK CPE210 v1 */
|
|
||||||
ATH79_MACH_CPE210_V2, /* TP-LINK CPE210 v2 */
|
|
||||||
ATH79_MACH_CPE210_V3, /* TP-LINK CPE210 v3 */
|
|
||||||
+ ATH79_MACH_CPE220_V2, /* TP-LINK CPE220 v2 */
|
|
||||||
ATH79_MACH_CPE220_V3, /* TP-LINK CPE220 v3 */
|
|
||||||
ATH79_MACH_CPE505N, /* P&W CPE505N */
|
|
||||||
ATH79_MACH_CPE510, /* TP-LINK CPE510 */
|
|
||||||
--- a/target/linux/ar71xx/image/generic-tp-link.mk
|
|
||||||
+++ b/target/linux/ar71xx/image/generic-tp-link.mk
|
|
||||||
@@ -239,6 +239,14 @@ define Device/cpe610-v1
|
|
||||||
endef
|
|
||||||
TARGET_DEVICES += cpe610-v1
|
|
||||||
|
|
||||||
+define Device/cpe220-v2
|
|
||||||
+ $(Device/cpe510-520-v1)
|
|
||||||
+ DEVICE_TITLE := TP-LINK CPE220 v2
|
|
||||||
+ BOARDNAME := CPE220V2
|
|
||||||
+ TPLINK_BOARD_ID := CPE210
|
|
||||||
+endef
|
|
||||||
+TARGET_DEVICES += cpe220-v2
|
|
||||||
+
|
|
||||||
define Device/cpe220-v3
|
|
||||||
$(Device/cpe210-v2)
|
|
||||||
DEVICE_TITLE := TP-LINK CPE220 v3
|
|
||||||
--- a/tools/firmware-utils/src/tplink-safeloader.c
|
|
||||||
+++ b/tools/firmware-utils/src/tplink-safeloader.c
|
|
||||||
@@ -131,7 +131,17 @@ static struct device_info boards[] = {
|
|
||||||
"CPE210(TP-LINK|EU|N300-2):1.1\r\n"
|
|
||||||
"CPE220(TP-LINK|UN|N300-2):1.1\r\n"
|
|
||||||
"CPE220(TP-LINK|US|N300-2):1.1\r\n"
|
|
||||||
- "CPE220(TP-LINK|EU|N300-2):1.1\r\n",
|
|
||||||
+ "CPE220(TP-LINK|EU|N300-2):1.1\r\n"
|
|
||||||
+ "CPE220(TP-LINK|EU|N300-2|00000000):2.0\r\n"
|
|
||||||
+ "CPE220(TP-LINK|EU|N300-2|45550000):2.0\r\n"
|
|
||||||
+ "CPE220(TP-LINK|EU|N300-2|55530000):2.0\r\n"
|
|
||||||
+ "CPE220(TP-LINK|UN|N300-2|00000000):2.0\r\n"
|
|
||||||
+ "CPE220(TP-LINK|UN|N300-2|45550000):2.0\r\n"
|
|
||||||
+ "CPE220(TP-LINK|UN|N300-2|55530000):2.0\r\n"
|
|
||||||
+ "CPE220(TP-LINK|US|N300-2|55530000):2.0\r\n"
|
|
||||||
+ "CPE220(TP-LINK|UN|N300-2):2.0\r\n"
|
|
||||||
+ "CPE220(TP-LINK|EU|N300-2):2.0\r\n"
|
|
||||||
+ "CPE220(TP-LINK|US|N300-2):2.0\r\n",
|
|
||||||
.support_trail = '\xff',
|
|
||||||
.soft_ver = NULL,
|
|
||||||
|
|
|
@ -1,157 +0,0 @@
|
||||||
From 70260d35ff2f9428c085583f30b053ec45eea2f8 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andrew Cameron <apcameron@softhome.net>
|
|
||||||
Date: Fri, 25 Oct 2019 20:32:48 -0500
|
|
||||||
Subject: [PATCH 2/2] ar71xx: add Support for the TP-LINK CPE220 V3.0 Device
|
|
||||||
|
|
||||||
This adds support for a popular low-cost 2.4GHz N based AP
|
|
||||||
|
|
||||||
Specifications:
|
|
||||||
SoC: Qualcomm Atheros QCA9533 (650MHz)
|
|
||||||
RAM: 64MB
|
|
||||||
Storage: 8 MB SPI NOR
|
|
||||||
Wireless: 2.4GHz N based built into SoC 2x2
|
|
||||||
Ethernet: 2x 100/10 Mbps, integrated into SoC
|
|
||||||
|
|
||||||
Installation:
|
|
||||||
Flash factory image through stock firmware WEB UI
|
|
||||||
or through TFTP
|
|
||||||
To get to TFTP recovery just hold reset button while powering on for
|
|
||||||
around 4-5 seconds and release.
|
|
||||||
Rename factory image to recovery.bin
|
|
||||||
Stock TFTP server IP:192.168.0.100
|
|
||||||
Stock device TFTP adress:192.168.0.254
|
|
||||||
|
|
||||||
Signed-off-by: Andrew Cameron apcameron@softhome.net
|
|
||||||
---
|
|
||||||
.../ar71xx/base-files/etc/board.d/01_leds | 1 +
|
|
||||||
.../ar71xx/base-files/etc/board.d/02_network | 1 +
|
|
||||||
.../base-files/etc/board.d/03_gpio_switches | 1 +
|
|
||||||
target/linux/ar71xx/base-files/lib/ar71xx.sh | 4 ++++
|
|
||||||
.../ar71xx/base-files/lib/upgrade/platform.sh | 3 ++-
|
|
||||||
.../files/arch/mips/ath79/mach-cpe510.c | 24 +++++++++++++++++++
|
|
||||||
.../ar71xx/files/arch/mips/ath79/machtypes.h | 1 +
|
|
||||||
target/linux/ar71xx/image/generic-tp-link.mk | 8 +++++++
|
|
||||||
8 files changed, 42 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
|
|
||||||
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
|
|
||||||
@@ -254,6 +254,7 @@ cf-e530n)
|
|
||||||
cpe210|\
|
|
||||||
cpe210-v2|\
|
|
||||||
cpe210-v3|\
|
|
||||||
+cpe220-v3|\
|
|
||||||
cpe510|\
|
|
||||||
cpe510-v2|\
|
|
||||||
wbs210|\
|
|
||||||
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
|
|
||||||
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
|
|
||||||
@@ -289,6 +289,7 @@ ar71xx_setup_interfaces()
|
|
||||||
"0@eth0" "2:lan" "1:wan" "6@eth1"
|
|
||||||
;;
|
|
||||||
cpe210|\
|
|
||||||
+ cpe220-v3|\
|
|
||||||
cpe510|\
|
|
||||||
wbs210|\
|
|
||||||
wbs510)
|
|
||||||
--- a/target/linux/ar71xx/base-files/etc/board.d/03_gpio_switches
|
|
||||||
+++ b/target/linux/ar71xx/base-files/etc/board.d/03_gpio_switches
|
|
||||||
@@ -11,6 +11,7 @@ board=$(board_name)
|
|
||||||
|
|
||||||
case "$board" in
|
|
||||||
cpe210|\
|
|
||||||
+cpe220-v3|\
|
|
||||||
cpe510|\
|
|
||||||
wbs210|\
|
|
||||||
wbs510)
|
|
||||||
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
|
|
||||||
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
|
|
||||||
@@ -759,6 +759,10 @@ ar71xx_board_detect() {
|
|
||||||
name="cpe210-v3"
|
|
||||||
tplink_pharos_board_detect "$(tplink_pharos_v2_get_model_string)"
|
|
||||||
;;
|
|
||||||
+ *"CPE220 v3")
|
|
||||||
+ name="cpe220-v3"
|
|
||||||
+ tplink_pharos_board_detect "$(tplink_pharos_v2_get_model_string)"
|
|
||||||
+ ;;
|
|
||||||
*"CPE505N")
|
|
||||||
name="cpe505n"
|
|
||||||
;;
|
|
||||||
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
|
|
||||||
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
|
|
||||||
@@ -594,7 +594,8 @@ platform_check_image() {
|
|
||||||
return 1
|
|
||||||
;;
|
|
||||||
cpe210-v2|\
|
|
||||||
- cpe210-v3)
|
|
||||||
+ cpe210-v3|\
|
|
||||||
+ cpe220-v3)
|
|
||||||
tplink_pharos_check_image "$1" "01000000" "$(tplink_pharos_v2_get_model_string)" '\0\xff\r' && return 0
|
|
||||||
return 1
|
|
||||||
;;
|
|
||||||
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
|
|
||||||
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
|
|
||||||
@@ -304,6 +304,27 @@ static void __init cpe610_setup(void)
|
|
||||||
ath79_register_wmac(ee, mac);
|
|
||||||
}
|
|
||||||
|
|
||||||
+static void __init cpe220_v3_setup(void)
|
|
||||||
+{
|
|
||||||
+ u8 *mac = (u8 *) KSEG1ADDR(0x1f830008);
|
|
||||||
+ u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
|
|
||||||
+
|
|
||||||
+ ath79_register_leds_gpio(-1, ARRAY_SIZE(cpe510_leds_gpio),
|
|
||||||
+ cpe510_leds_gpio);
|
|
||||||
+
|
|
||||||
+ ath79_register_gpio_keys_polled(-1, CPE510_KEYS_POLL_INTERVAL,
|
|
||||||
+ ARRAY_SIZE(cpe210_v2_gpio_keys),
|
|
||||||
+ cpe210_v2_gpio_keys);
|
|
||||||
+
|
|
||||||
+ ath79_register_m25p80(NULL);
|
|
||||||
+ ath79_register_mdio(0, 0x0);
|
|
||||||
+ ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
|
|
||||||
+ ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
|
|
||||||
+ ath79_register_eth(1);
|
|
||||||
+
|
|
||||||
+ ath79_register_wmac(ee, mac);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
MIPS_MACHINE(ATH79_MACH_CPE210, "CPE210", "TP-LINK CPE210/220",
|
|
||||||
cpe210_setup);
|
|
||||||
|
|
||||||
@@ -313,6 +334,9 @@ MIPS_MACHINE(ATH79_MACH_CPE210_V2, "CPE2
|
|
||||||
MIPS_MACHINE(ATH79_MACH_CPE210_V3, "CPE210V3", "TP-LINK CPE210 v3",
|
|
||||||
cpe210_v2_setup);
|
|
||||||
|
|
||||||
+MIPS_MACHINE(ATH79_MACH_CPE220_V3, "CPE220V3", "TP-LINK CPE220 v3",
|
|
||||||
+ cpe220_v3_setup);
|
|
||||||
+
|
|
||||||
MIPS_MACHINE(ATH79_MACH_CPE510, "CPE510", "TP-LINK CPE510/520",
|
|
||||||
cpe510_setup);
|
|
||||||
|
|
||||||
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
|
|
||||||
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
|
|
||||||
@@ -77,6 +77,7 @@ enum ath79_mach_type {
|
|
||||||
ATH79_MACH_CPE210, /* TP-LINK CPE210 v1 */
|
|
||||||
ATH79_MACH_CPE210_V2, /* TP-LINK CPE210 v2 */
|
|
||||||
ATH79_MACH_CPE210_V3, /* TP-LINK CPE210 v3 */
|
|
||||||
+ ATH79_MACH_CPE220_V3, /* TP-LINK CPE220 v3 */
|
|
||||||
ATH79_MACH_CPE505N, /* P&W CPE505N */
|
|
||||||
ATH79_MACH_CPE510, /* TP-LINK CPE510 */
|
|
||||||
ATH79_MACH_CPE510_V2, /* TP-LINK CPE510 v2 */
|
|
||||||
--- a/target/linux/ar71xx/image/generic-tp-link.mk
|
|
||||||
+++ b/target/linux/ar71xx/image/generic-tp-link.mk
|
|
||||||
@@ -231,6 +231,14 @@ define Device/cpe610-v1
|
|
||||||
endef
|
|
||||||
TARGET_DEVICES += cpe610-v1
|
|
||||||
|
|
||||||
+define Device/cpe220-v3
|
|
||||||
+ $(Device/cpe210-v2)
|
|
||||||
+ DEVICE_TITLE := TP-LINK CPE220 v3
|
|
||||||
+ BOARDNAME := CPE220V3
|
|
||||||
+ TPLINK_BOARD_ID := CPE220V3
|
|
||||||
+endef
|
|
||||||
+TARGET_DEVICES += cpe220-v3
|
|
||||||
+
|
|
||||||
define Device/wbs210-v1
|
|
||||||
$(Device/cpe510-520-v1)
|
|
||||||
DEVICE_TITLE := TP-LINK WBS210 v1
|
|
|
@ -1,19 +0,0 @@
|
||||||
--- a/tools/firmware-utils/src/tplink-safeloader.c
|
|
||||||
+++ b/tools/firmware-utils/src/tplink-safeloader.c
|
|
||||||
@@ -424,13 +424,12 @@ static struct device_info boards[] = {
|
|
||||||
"CPE510(TP-LINK|UN|N300-5):2.0\r\n"
|
|
||||||
"CPE510(TP-LINK|EU|N300-5):2.0\r\n"
|
|
||||||
"CPE510(TP-LINK|US|N300-5):2.0\r\n"
|
|
||||||
- "CPE510(TP-LINK|EU|N300-5|00000000):3.0\r\n"
|
|
||||||
"CPE510(TP-LINK|EU|N300-5|45550000):3.0\r\n"
|
|
||||||
- "CPE510(TP-LINK|EU|N300-5|55530000):3.0\r\n"
|
|
||||||
"CPE510(TP-LINK|UN|N300-5|00000000):3.0\r\n"
|
|
||||||
- "CPE510(TP-LINK|UN|N300-5|45550000):3.0\r\n"
|
|
||||||
- "CPE510(TP-LINK|UN|N300-5|55530000):3.0\r\n"
|
|
||||||
"CPE510(TP-LINK|US|N300-5|55530000):3.0\r\n"
|
|
||||||
+ "CPE510(TP-LINK|EU|N300-5|45550000):3.20\r\n"
|
|
||||||
+ "CPE510(TP-LINK|UN|N300-5|00000000):3.20\r\n"
|
|
||||||
+ "CPE510(TP-LINK|US|N300-5|55530000):3.20\r\n"
|
|
||||||
"CPE510(TP-LINK|UN|N300-5):3.0\r\n"
|
|
||||||
"CPE510(TP-LINK|EU|N300-5):3.0\r\n"
|
|
||||||
"CPE510(TP-LINK|US|N300-5):3.0\r\n",
|
|
|
@ -1,115 +0,0 @@
|
||||||
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
|
|
||||||
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
|
|
||||||
@@ -257,6 +257,7 @@ cpe210-v3|\
|
|
||||||
cpe220-v3|\
|
|
||||||
cpe510|\
|
|
||||||
cpe510-v2|\
|
|
||||||
+cpe510-v3|\
|
|
||||||
wbs210|\
|
|
||||||
wbs510)
|
|
||||||
ucidef_set_rssimon "wlan0" "200000" "1"
|
|
||||||
@@ -268,7 +269,8 @@ wbs510)
|
|
||||||
case "$board" in
|
|
||||||
cpe210-v2|\
|
|
||||||
cpe210-v3|\
|
|
||||||
- cpe510-v2)
|
|
||||||
+ cpe510-v2|\
|
|
||||||
+ cpe510-v3)
|
|
||||||
ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan0" "eth0"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
|
|
||||||
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
|
|
||||||
@@ -78,6 +78,7 @@ ar71xx_setup_interfaces()
|
|
||||||
cpe210-v2|\
|
|
||||||
cpe210-v3|\
|
|
||||||
cpe510-v2|\
|
|
||||||
+ cpe510-v3|\
|
|
||||||
dr342|\
|
|
||||||
eap120|\
|
|
||||||
eap300v2|\
|
|
||||||
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
|
|
||||||
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
|
|
||||||
@@ -774,6 +774,10 @@ ar71xx_board_detect() {
|
|
||||||
name="cpe510-v2"
|
|
||||||
tplink_pharos_board_detect "$(tplink_pharos_v2_get_model_string)"
|
|
||||||
;;
|
|
||||||
+ *"CPE510 v3")
|
|
||||||
+ name="cpe510-v3"
|
|
||||||
+ tplink_pharos_board_detect "$(tplink_pharos_v2_get_model_string)"
|
|
||||||
+ ;;
|
|
||||||
*"CPE610")
|
|
||||||
name="cpe610"
|
|
||||||
tplink_pharos_board_detect "$(tplink_pharos_v2_get_model_string)"
|
|
||||||
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
|
|
||||||
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
|
|
||||||
@@ -600,7 +600,8 @@ platform_check_image() {
|
|
||||||
return 1
|
|
||||||
;;
|
|
||||||
cpe610|\
|
|
||||||
- cpe510-v2)
|
|
||||||
+ cpe510-v2|\
|
|
||||||
+ cpe510-v3)
|
|
||||||
tplink_pharos_check_image "$1" "7f454c46" "$(tplink_pharos_v2_get_model_string)" '\0\xff\r' && return 0
|
|
||||||
return 1
|
|
||||||
;;
|
|
||||||
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
|
|
||||||
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
|
|
||||||
@@ -337,6 +337,9 @@ MIPS_MACHINE(ATH79_MACH_CPE210_V3, "CPE2
|
|
||||||
MIPS_MACHINE(ATH79_MACH_CPE220_V3, "CPE220V3", "TP-LINK CPE220 v3",
|
|
||||||
cpe220_v3_setup);
|
|
||||||
|
|
||||||
+MIPS_MACHINE(ATH79_MACH_CPE510_V3, "CPE510V3", "TP-LINK CPE510 v3",
|
|
||||||
+ cpe510_v2_setup);
|
|
||||||
+
|
|
||||||
MIPS_MACHINE(ATH79_MACH_CPE510, "CPE510", "TP-LINK CPE510/520",
|
|
||||||
cpe510_setup);
|
|
||||||
|
|
||||||
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
|
|
||||||
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
|
|
||||||
@@ -81,6 +81,7 @@ enum ath79_mach_type {
|
|
||||||
ATH79_MACH_CPE505N, /* P&W CPE505N */
|
|
||||||
ATH79_MACH_CPE510, /* TP-LINK CPE510 */
|
|
||||||
ATH79_MACH_CPE510_V2, /* TP-LINK CPE510 v2 */
|
|
||||||
+ ATH79_MACH_CPE510_V3, /* TP-LINK CPE510 v3 */
|
|
||||||
ATH79_MACH_CPE610, /* TP-LINK CPE610 */
|
|
||||||
ATH79_MACH_CPE830, /* YunCore CPE830 */
|
|
||||||
ATH79_MACH_CPE870, /* YunCore CPE870 */
|
|
||||||
--- a/target/linux/ar71xx/image/generic-tp-link.mk
|
|
||||||
+++ b/target/linux/ar71xx/image/generic-tp-link.mk
|
|
||||||
@@ -185,6 +185,14 @@ define Device/cpe510-v2
|
|
||||||
endef
|
|
||||||
TARGET_DEVICES += cpe510-v2
|
|
||||||
|
|
||||||
+define Device/cpe510-v3
|
|
||||||
+ $(Device/cpe510-520-v1)
|
|
||||||
+ DEVICE_TITLE := TP-LINK CPE510 v3
|
|
||||||
+ BOARDNAME := CPE510V3
|
|
||||||
+ TPLINK_BOARD_ID := CPE510V2
|
|
||||||
+endef
|
|
||||||
+TARGET_DEVICES += cpe510-v3
|
|
||||||
+
|
|
||||||
define Device/cpe210-220-v1
|
|
||||||
$(Device/cpe510-520-v1)
|
|
||||||
DEVICE_TITLE := TP-LINK CPE210/220 v1
|
|
||||||
--- a/tools/firmware-utils/src/tplink-safeloader.c
|
|
||||||
+++ b/tools/firmware-utils/src/tplink-safeloader.c
|
|
||||||
@@ -375,7 +375,17 @@ static struct device_info boards[] = {
|
|
||||||
"CPE510(TP-LINK|US|N300-5|55530000):2.0\r\n"
|
|
||||||
"CPE510(TP-LINK|UN|N300-5):2.0\r\n"
|
|
||||||
"CPE510(TP-LINK|EU|N300-5):2.0\r\n"
|
|
||||||
- "CPE510(TP-LINK|US|N300-5):2.0\r\n",
|
|
||||||
+ "CPE510(TP-LINK|US|N300-5):2.0\r\n"
|
|
||||||
+ "CPE510(TP-LINK|EU|N300-5|00000000):3.0\r\n"
|
|
||||||
+ "CPE510(TP-LINK|EU|N300-5|45550000):3.0\r\n"
|
|
||||||
+ "CPE510(TP-LINK|EU|N300-5|55530000):3.0\r\n"
|
|
||||||
+ "CPE510(TP-LINK|UN|N300-5|00000000):3.0\r\n"
|
|
||||||
+ "CPE510(TP-LINK|UN|N300-5|45550000):3.0\r\n"
|
|
||||||
+ "CPE510(TP-LINK|UN|N300-5|55530000):3.0\r\n"
|
|
||||||
+ "CPE510(TP-LINK|US|N300-5|55530000):3.0\r\n"
|
|
||||||
+ "CPE510(TP-LINK|UN|N300-5):3.0\r\n"
|
|
||||||
+ "CPE510(TP-LINK|EU|N300-5):3.0\r\n"
|
|
||||||
+ "CPE510(TP-LINK|US|N300-5):3.0\r\n",
|
|
||||||
.support_trail = '\xff',
|
|
||||||
.soft_ver = NULL,
|
|
||||||
|
|
|
@ -1,198 +0,0 @@
|
||||||
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
|
|
||||||
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
|
|
||||||
@@ -598,6 +598,7 @@ platform_check_image() {
|
|
||||||
tplink_pharos_check_image "$1" "01000000" "$(tplink_pharos_v2_get_model_string)" '\0\xff\r' && return 0
|
|
||||||
return 1
|
|
||||||
;;
|
|
||||||
+ cpe610|\
|
|
||||||
cpe510-v2)
|
|
||||||
tplink_pharos_check_image "$1" "7f454c46" "$(tplink_pharos_v2_get_model_string)" '\0\xff\r' && return 0
|
|
||||||
return 1
|
|
||||||
--- a/tools/firmware-utils/src/tplink-safeloader.c
|
|
||||||
+++ b/tools/firmware-utils/src/tplink-safeloader.c
|
|
||||||
@@ -1,3 +1,4 @@
|
|
||||||
+
|
|
||||||
/*
|
|
||||||
Copyright (c) 2014, Matthias Schiffer <mschiffer@universe-factory.net>
|
|
||||||
All rights reserved.
|
|
||||||
@@ -257,6 +258,46 @@ static struct device_info boards[] = {
|
|
||||||
.support_trail = '\xff',
|
|
||||||
.soft_ver = NULL,
|
|
||||||
|
|
||||||
+ .partitions = {
|
|
||||||
+ {"fs-uboot", 0x00000, 0x20000},
|
|
||||||
+ {"partition-table", 0x20000, 0x02000},
|
|
||||||
+ {"default-mac", 0x30000, 0x00020},
|
|
||||||
+ {"product-info", 0x31100, 0x00100},
|
|
||||||
+ {"signature", 0x32000, 0x00400},
|
|
||||||
+ {"os-image", 0x40000, 0x200000},
|
|
||||||
+ {"file-system", 0x240000, 0x570000},
|
|
||||||
+ {"soft-version", 0x7b0000, 0x00100},
|
|
||||||
+ {"support-list", 0x7b1000, 0x00400},
|
|
||||||
+ {"user-config", 0x7c0000, 0x10000},
|
|
||||||
+ {"default-config", 0x7d0000, 0x10000},
|
|
||||||
+ {"log", 0x7e0000, 0x10000},
|
|
||||||
+ {"radio", 0x7f0000, 0x10000},
|
|
||||||
+ {NULL, 0, 0}
|
|
||||||
+ },
|
|
||||||
+
|
|
||||||
+ .first_sysupgrade_partition = "os-image",
|
|
||||||
+ .last_sysupgrade_partition = "support-list",
|
|
||||||
+ },
|
|
||||||
+
|
|
||||||
+ /** Firmware layout for the CPE610 */
|
|
||||||
+ {
|
|
||||||
+ .id = "CPE610",
|
|
||||||
+ .vendor = "CPE610(TP-LINK|UN|N300-5|00000000):1.0\r\n",
|
|
||||||
+ .support_list =
|
|
||||||
+ "SupportList:\r\n"
|
|
||||||
+ "CPE610(TP-LINK|EU|N300-5|00000000):1.0\r\n"
|
|
||||||
+ "CPE610(TP-LINK|EU|N300-5|45550000):1.0\r\n"
|
|
||||||
+ "CPE610(TP-LINK|EU|N300-5|55530000):1.0\r\n"
|
|
||||||
+ "CPE610(TP-LINK|UN|N300-5|00000000):1.0\r\n"
|
|
||||||
+ "CPE610(TP-LINK|UN|N300-5|45550000):1.0\r\n"
|
|
||||||
+ "CPE610(TP-LINK|UN|N300-5|55530000):1.0\r\n"
|
|
||||||
+ "CPE610(TP-LINK|US|N300-5|55530000):1.0\r\n"
|
|
||||||
+ "CPE610(TP-LINK|UN|N300-5):1.0\r\n"
|
|
||||||
+ "CPE610(TP-LINK|EU|N300-5):1.0\r\n"
|
|
||||||
+ "CPE610(TP-LINK|US|N300-5):1.0\r\n",
|
|
||||||
+ .support_trail = '\xff',
|
|
||||||
+ .soft_ver = NULL,
|
|
||||||
+
|
|
||||||
.partitions = {
|
|
||||||
{"fs-uboot", 0x00000, 0x20000},
|
|
||||||
{"partition-table", 0x20000, 0x02000},
|
|
||||||
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
|
|
||||||
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
|
|
||||||
@@ -125,6 +125,18 @@ static struct gpio_led cpe210_v2_leds_gp
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
+static struct gpio_led cpe610_leds_gpio[] __initdata = {
|
|
||||||
+ {
|
|
||||||
+ .name = "tp-link:green:lan0",
|
|
||||||
+ .gpio = CPE510_GPIO_LED_LAN0,
|
|
||||||
+ .active_low = 1,
|
|
||||||
+ }, {
|
|
||||||
+ .name = "tp-link:green:link1",
|
|
||||||
+ .gpio = CPE510_GPIO_LED_L1,
|
|
||||||
+ .active_low = 1,
|
|
||||||
+ },
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
static struct gpio_keys_button cpe510_gpio_keys[] __initdata = {
|
|
||||||
{
|
|
||||||
.desc = "Reset button",
|
|
||||||
@@ -259,6 +271,39 @@ static void __init cpe510_v2_setup(void)
|
|
||||||
ath79_register_wmac(ee, mac);
|
|
||||||
}
|
|
||||||
|
|
||||||
+static void __init cpe610_setup(void)
|
|
||||||
+{
|
|
||||||
+ u8 *mac = (u8 *) KSEG1ADDR(0x1f830008);
|
|
||||||
+ u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
|
|
||||||
+
|
|
||||||
+ /* disable PHY_SWAP and PHY_ADDR_SWAP bits */
|
|
||||||
+ ath79_setup_ar933x_phy4_switch(false, false);
|
|
||||||
+
|
|
||||||
+ ath79_register_leds_gpio(-1, ARRAY_SIZE(cpe610_leds_gpio),
|
|
||||||
+ cpe610_leds_gpio);
|
|
||||||
+ ath79_register_gpio_keys_polled(-1, CPE510_KEYS_POLL_INTERVAL,
|
|
||||||
+ ARRAY_SIZE(cpe510_gpio_keys),
|
|
||||||
+ cpe510_gpio_keys);
|
|
||||||
+ ath79_register_m25p80(NULL);
|
|
||||||
+ ath79_register_mdio(1, 0x0);
|
|
||||||
+ /* WAN */
|
|
||||||
+ ath79_switch_data.phy4_mii_en = 1;
|
|
||||||
+ ath79_switch_data.phy_poll_mask = BIT(4);
|
|
||||||
+ ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
|
|
||||||
+ ath79_eth0_data.phy_mask = BIT(4);
|
|
||||||
+ ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev;
|
|
||||||
+ ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
|
|
||||||
+ ath79_register_eth(0);
|
|
||||||
+ /* LAN */
|
|
||||||
+ ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
|
|
||||||
+ ath79_eth1_data.duplex = DUPLEX_FULL;
|
|
||||||
+ ath79_eth1_data.speed = SPEED_1000;
|
|
||||||
+ ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
|
|
||||||
+ ath79_register_eth(1);
|
|
||||||
+
|
|
||||||
+ ath79_register_wmac(ee, mac);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
MIPS_MACHINE(ATH79_MACH_CPE210, "CPE210", "TP-LINK CPE210/220",
|
|
||||||
cpe210_setup);
|
|
||||||
|
|
||||||
@@ -274,6 +319,9 @@ MIPS_MACHINE(ATH79_MACH_CPE510, "CPE510"
|
|
||||||
MIPS_MACHINE(ATH79_MACH_CPE510_V2, "CPE510V2", "TP-LINK CPE510 v2",
|
|
||||||
cpe510_v2_setup);
|
|
||||||
|
|
||||||
+MIPS_MACHINE(ATH79_MACH_CPE610, "CPE610", "TP-LINK CPE610",
|
|
||||||
+ cpe610_setup);
|
|
||||||
+
|
|
||||||
MIPS_MACHINE(ATH79_MACH_WBS210, "WBS210", "TP-LINK WBS210",
|
|
||||||
wbs_setup);
|
|
||||||
|
|
||||||
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
|
|
||||||
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
|
|
||||||
@@ -770,6 +770,10 @@ ar71xx_board_detect() {
|
|
||||||
name="cpe510-v2"
|
|
||||||
tplink_pharos_board_detect "$(tplink_pharos_v2_get_model_string)"
|
|
||||||
;;
|
|
||||||
+ *"CPE610")
|
|
||||||
+ name="cpe610"
|
|
||||||
+ tplink_pharos_board_detect "$(tplink_pharos_v2_get_model_string)"
|
|
||||||
+ ;;
|
|
||||||
*"CPE830")
|
|
||||||
name="cpe830"
|
|
||||||
;;
|
|
||||||
--- a/target/linux/ar71xx/image/generic-tp-link.mk
|
|
||||||
+++ b/target/linux/ar71xx/image/generic-tp-link.mk
|
|
||||||
@@ -223,6 +223,14 @@ define Device/cpe210-v3
|
|
||||||
endef
|
|
||||||
TARGET_DEVICES += cpe210-v3
|
|
||||||
|
|
||||||
+define Device/cpe610-v1
|
|
||||||
+ $(Device/cpe510-520-v1)
|
|
||||||
+ DEVICE_TITLE := TP-LINK CPE610
|
|
||||||
+ BOARDNAME := CPE610
|
|
||||||
+ TPLINK_BOARD_ID := CPE610
|
|
||||||
+endef
|
|
||||||
+TARGET_DEVICES += cpe610-v1
|
|
||||||
+
|
|
||||||
define Device/wbs210-v1
|
|
||||||
$(Device/cpe510-520-v1)
|
|
||||||
DEVICE_TITLE := TP-LINK WBS210 v1
|
|
||||||
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
|
|
||||||
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
|
|
||||||
@@ -276,6 +276,10 @@ wbs510)
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
+cpe610)
|
|
||||||
+ ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan0" "eth0"
|
|
||||||
+ ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:link1" "wlan0"
|
|
||||||
+ ;;
|
|
||||||
cr3000)
|
|
||||||
ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
|
|
||||||
ucidef_set_led_switch "lan1" "LAN1" "pcs:blue:lan1" "switch0" "0x04"
|
|
||||||
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
|
|
||||||
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
|
|
||||||
@@ -74,6 +74,7 @@ ar71xx_setup_interfaces()
|
|
||||||
cap4200ag|\
|
|
||||||
cf-e380ac-v1|\
|
|
||||||
cf-e380ac-v2|\
|
|
||||||
+ cpe610|\
|
|
||||||
cpe210-v2|\
|
|
||||||
cpe210-v3|\
|
|
||||||
cpe510-v2|\
|
|
||||||
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
|
|
||||||
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
|
|
||||||
@@ -80,6 +80,7 @@ enum ath79_mach_type {
|
|
||||||
ATH79_MACH_CPE505N, /* P&W CPE505N */
|
|
||||||
ATH79_MACH_CPE510, /* TP-LINK CPE510 */
|
|
||||||
ATH79_MACH_CPE510_V2, /* TP-LINK CPE510 v2 */
|
|
||||||
+ ATH79_MACH_CPE610, /* TP-LINK CPE610 */
|
|
||||||
ATH79_MACH_CPE830, /* YunCore CPE830 */
|
|
||||||
ATH79_MACH_CPE870, /* YunCore CPE870 */
|
|
||||||
ATH79_MACH_CR3000, /* PowerCloud Systems CR3000 */
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue