fff-network: Add migration for Archer C7 WAN ports

With 8d66bdf the port configuration of TP-Link Archer C7 has been
changed to a single-interface configuration.

This had unforseen side effects on upgraded devices. Because WANDEV
is evaluated from the updated network.* file, the port configuration
of the switch is evaluated from the update-safe network.config, which
is now incompatible with the updated interface configuration.

Therefore, a migration script has to be added, which updates the port
configuration in network.config to the new single-interface network
configuration.

Fixes: #60 (gitea)
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
This commit is contained in:
Fabian Bläse 2021-01-27 17:34:19 +01:00 committed by Adrian Schmutzler
parent afe633e874
commit 37695a1cfc
2 changed files with 15 additions and 1 deletions

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-network
PKG_RELEASE:=28
PKG_RELEASE:=29
include $(INCLUDE_DIR)/package.mk

View File

@ -0,0 +1,14 @@
BOARD="$(uci get board.model.name)"
# only execute if running on a TP-Link Archer C7 v2
if [ "$BOARD" != "tplink,archer-c7-v2" ]; then
exit 0
fi
# only execute if there is something to migrate
if [ ! -s /etc/network.config ]; then
exit 0
fi
# modify WAN_PORTS to new single-interface configuration
sed -i '/WAN_PORTS/ s/6/0t/g' /etc/network.config