aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/mt7621/base-files
diff options
context:
space:
mode:
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-07-14 16:42:40 +0200
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-08-08 16:13:51 +0200
commit1eac573b530425c80c046eaa0b373b5e63d92451 (patch)
tree853b1178bcbbe16cae52b6ee0119c0c295099a9a /target/linux/ramips/mt7621/base-files
parentfbd4214bb0727268aa535af5b600d38939ec8dbc (diff)
downloadupstream-1eac573b530425c80c046eaa0b373b5e63d92451.tar.gz
upstream-1eac573b530425c80c046eaa0b373b5e63d92451.tar.bz2
upstream-1eac573b530425c80c046eaa0b373b5e63d92451.zip
ramips: mt7621: implement compatibility version for DSA migration
This implements the newly introduced compat-version to prevent broken upgrade between swconfig and DSA for ramips' mt7621 subtarget. In order to make the situation more transparent for the user, and to prevent large switch-cases for devices, it is more convenient to have the entire subtarget 1.1-by-default. This means that new devices will be added with 1.1 from the start, but in contrast we don't need to switch them in board.d files. Apart from that, users that manually backport devices to 19.07 with swconfig will have an equivalent upgrade experience to officially supported devices. Since DSA support on mt7621 is out for a while already, this applies the same uci-defaults workaround for early adopters as already done for kirkwood and mvebu in previous commits. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/ramips/mt7621/base-files')
-rwxr-xr-xtarget/linux/ramips/mt7621/base-files/etc/board.d/05_compat-version19
-rw-r--r--target/linux/ramips/mt7621/base-files/etc/uci-defaults/05_fix-compat-version8
2 files changed, 27 insertions, 0 deletions
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/05_compat-version b/target/linux/ramips/mt7621/base-files/etc/board.d/05_compat-version
new file mode 100755
index 0000000000..d79092f76f
--- /dev/null
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/05_compat-version
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# Copyright (C) 2020 OpenWrt.org
+#
+
+. /lib/functions.sh
+. /lib/functions/uci-defaults.sh
+
+board_config_update
+
+case "$(board_name)" in
+ *)
+ ucidef_set_compat_version "1.1"
+ ;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/ramips/mt7621/base-files/etc/uci-defaults/05_fix-compat-version b/target/linux/ramips/mt7621/base-files/etc/uci-defaults/05_fix-compat-version
new file mode 100644
index 0000000000..09cce180e4
--- /dev/null
+++ b/target/linux/ramips/mt7621/base-files/etc/uci-defaults/05_fix-compat-version
@@ -0,0 +1,8 @@
+#
+# Copyright (C) 2020 OpenWrt.org
+#
+
+uci set system.@system[0].compat_version="1.1"
+uci commit system
+
+exit 0