From 37695a1cfcb826594d53dc60086d55b834400ac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Bl=C3=A4se?= Date: Wed, 27 Jan 2021 17:34:19 +0100 Subject: [PATCH] fff-network: Add migration for Archer C7 WAN ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Robert Langhammer --- src/packages/fff/fff-network/Makefile | 2 +- .../etc/uci-defaults/20-migrate-c7-portconfig | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/packages/fff/fff-network/files/etc/uci-defaults/20-migrate-c7-portconfig diff --git a/src/packages/fff/fff-network/Makefile b/src/packages/fff/fff-network/Makefile index 43d00ae..d25c7c7 100644 --- a/src/packages/fff/fff-network/Makefile +++ b/src/packages/fff/fff-network/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fff-network -PKG_RELEASE:=28 +PKG_RELEASE:=29 include $(INCLUDE_DIR)/package.mk diff --git a/src/packages/fff/fff-network/files/etc/uci-defaults/20-migrate-c7-portconfig b/src/packages/fff/fff-network/files/etc/uci-defaults/20-migrate-c7-portconfig new file mode 100644 index 0000000..e6afa59 --- /dev/null +++ b/src/packages/fff/fff-network/files/etc/uci-defaults/20-migrate-c7-portconfig @@ -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