This implements the newly introduced compat-version to prevent
upgrade between swconfig and DSA for kirkwood.

Just define a compat version with minor increment and an appropriate
message for both image (in Makefile) and device (in base-files).

Since we never removed SUPPORTED_DEVICES for this target, we don't
have to add it back either.

Signed-off-by: Adrian Schmutzler <[email protected]>

---

Added in v2
---
 target/linux/kirkwood/base-files/etc/board.d/02_network | 1 +
 target/linux/kirkwood/image/Makefile                    | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/target/linux/kirkwood/base-files/etc/board.d/02_network 
b/target/linux/kirkwood/base-files/etc/board.d/02_network
index 658ce13346..45c0182493 100755
--- a/target/linux/kirkwood/base-files/etc/board.d/02_network
+++ b/target/linux/kirkwood/base-files/etc/board.d/02_network
@@ -32,6 +32,7 @@ case "$board" in
 "linksys,viper")
        ucidef_set_interfaces_lan_wan "ethernet1 ethernet2 ethernet3 ethernet4" 
"internet"
        ucidef_set_interface_macaddr "wan" $( mtd_get_mac_ascii u_env eth1addr )
+       ucidef_set_compat_version "1.1"
        ;;
 "zyxel,nsa310b"|\
 "zyxel,nsa325")
diff --git a/target/linux/kirkwood/image/Makefile 
b/target/linux/kirkwood/image/Makefile
index ba93fffeb2..6554fc2669 100644
--- a/target/linux/kirkwood/image/Makefile
+++ b/target/linux/kirkwood/image/Makefile
@@ -10,6 +10,11 @@ include $(INCLUDE_DIR)/image.mk
 
 KERNEL_LOADADDR:=0x8000
 
+define Device/dsa-migration
+  DEVICE_COMPAT_VERSION := 1.1
+  DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA
+endef
+
 define Device/Default
   PROFILES := Default
   DEVICE_DTS = $$(if $$(BOARD_NAME),kirkwood-$$(BOARD_NAME),)
@@ -92,6 +97,7 @@ endef
 TARGET_DEVICES += iom_ix2-200
 
 define Device/linksys_audi
+  $(Device/dsa-migration)
   DEVICE_VENDOR := Linksys
   DEVICE_MODEL := EA3500 (Audi)
   DEVICE_PACKAGES := kmod-mwl8k wpad-basic kmod-gpio-button-hotplug
@@ -107,6 +113,7 @@ endef
 TARGET_DEVICES += linksys_audi
 
 define Device/linksys_viper
+  $(Device/dsa-migration)
   DEVICE_VENDOR := Linksys
   DEVICE_MODEL := E4200v2 / EA4500 (Viper)
   DEVICE_PACKAGES := kmod-mwl8k wpad-basic kmod-gpio-button-hotplug
-- 
2.20.1


_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to