From 1eac573b530425c80c046eaa0b373b5e63d92451 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 14 Jul 2020 16:42:40 +0200 Subject: 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 --- .../mt7621/base-files/etc/board.d/05_compat-version | 19 +++++++++++++++++++ .../base-files/etc/uci-defaults/05_fix-compat-version | 8 ++++++++ 2 files changed, 27 insertions(+) create mode 100755 target/linux/ramips/mt7621/base-files/etc/board.d/05_compat-version create mode 100644 target/linux/ramips/mt7621/base-files/etc/uci-defaults/05_fix-compat-version (limited to 'target/linux/ramips/mt7621/base-files') 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 -- cgit v1.2.3