On 14.07.20 04:28, Adrian Schmutzler wrote:
This implements the newly introduced compat-version to prevent
upgrade between swconfig and DSA for mvebu.

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

Having taken care of sysupgrade, we can put back the SUPPORTED_DEVICES
that have been removed in previous patches to prevent broken config.

While at it, fix alphabetic sorting in 02_network.

Signed-off-by: Adrian Schmutzler <freif...@adrianschmutzler.de>

---

Added in v2
---
  .../base-files/etc/board.d/02_network         | 14 ++++++++------
  target/linux/mvebu/image/cortexa9.mk          | 19 +++++++++++++++++++
  2 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network 
b/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network
index 9718b332a7..9255f2535e 100755
--- a/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network
+++ b/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network
@@ -23,6 +23,7 @@ mvebu_setup_interfaces()
        linksys,wrt3200acm|\
        linksys,wrt32x)
                ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
+               ucidef_set_compat_version "1.1"
                ;;
        marvell,a385-db-ap)
                ucidef_set_interfaces_lan_wan "eth0 eth1" "eth2"
@@ -30,18 +31,19 @@ mvebu_setup_interfaces()
        marvell,axp-gp)
                ucidef_set_interface_lan "eth0 eth1 eth2 eth3"
                ;;
-       solidrun,clearfog-pro-a1)
-               # eth0 is standalone ethernet
-               # eth1 is switch
-               # eth2 is SFP
-               ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5 lan6" "eth0 
eth2"
-               ;;
        solidrun,clearfog-base-a1)
                # eth0 is standalone ethernet
                # eth1 is standalone ethernet
                # eth2 is SFP
                ucidef_set_interfaces_lan_wan "eth1" "eth0 eth2"
                ;;
+       solidrun,clearfog-pro-a1)
+               # eth0 is standalone ethernet
+               # eth1 is switch
+               # eth2 is SFP
+               ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5 lan6" "eth0 
eth2"
+               ucidef_set_compat_version "1.1"
+               ;;
        *)
                ucidef_set_interface_lan "eth0"
                ;;
diff --git a/target/linux/mvebu/image/cortexa9.mk 
b/target/linux/mvebu/image/cortexa9.mk
index 7f0a2fe697..1a4c43d133 100644
--- a/target/linux/mvebu/image/cortexa9.mk
+++ b/target/linux/mvebu/image/cortexa9.mk
@@ -6,6 +6,11 @@
  # See /LICENSE for more information.
  #
+define Device/dsa-migration
+  DEVICE_COMPAT_VERSION := 1.1
+  DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA
+endef
Shouldn't this be defined in a more central place as it at least impacts two, later more targets?
+
  define Device/buffalo_ls421de
    $(Device/NAND-128K)
    DEVICE_VENDOR := Buffalo
@@ -63,16 +68,19 @@ endef
define Device/linksys_wrt1200ac
    $(call Device/linksys)
+  $(Device/dsa-migration)
    DEVICE_MODEL := WRT1200AC
    DEVICE_ALT0_VENDOR := Linksys
    DEVICE_ALT0_MODEL := Caiman
    DEVICE_DTS := armada-385-linksys-caiman
    DEVICE_PACKAGES += mwlwifi-firmware-88w8864
+  SUPPORTED_DEVICES += armada-385-linksys-caiman linksys,caiman
  endef
  TARGET_DEVICES += linksys_wrt1200ac
define Device/linksys_wrt1900acs
    $(call Device/linksys)
+  $(Device/dsa-migration)
    DEVICE_MODEL := WRT1900ACS
    DEVICE_VARIANT := v1
    DEVICE_ALT0_VENDOR := Linksys
@@ -82,11 +90,13 @@ define Device/linksys_wrt1900acs
    DEVICE_ALT1_MODEL := Shelby
    DEVICE_DTS := armada-385-linksys-shelby
    DEVICE_PACKAGES += mwlwifi-firmware-88w8864
+  SUPPORTED_DEVICES += armada-385-linksys-shelby linksys,shelby
  endef
  TARGET_DEVICES += linksys_wrt1900acs
define Device/linksys_wrt1900ac-v1
    $(call Device/linksys)
+  $(Device/dsa-migration)
    DEVICE_MODEL := WRT1900AC
    DEVICE_VARIANT := v1
    DEVICE_ALT0_VENDOR := Linksys
@@ -94,32 +104,38 @@ define Device/linksys_wrt1900ac-v1
    DEVICE_DTS := armada-xp-linksys-mamba
    DEVICE_PACKAGES += mwlwifi-firmware-88w8864
    KERNEL_SIZE := 3072k
+  SUPPORTED_DEVICES += armada-xp-linksys-mamba linksys,mamba
  endef
  TARGET_DEVICES += linksys_wrt1900ac-v1
define Device/linksys_wrt1900ac-v2
    $(call Device/linksys)
+  $(Device/dsa-migration)
    DEVICE_MODEL := WRT1900AC
    DEVICE_VARIANT := v2
    DEVICE_ALT0_VENDOR := Linksys
    DEVICE_ALT0_MODEL := Cobra
    DEVICE_DTS := armada-385-linksys-cobra
    DEVICE_PACKAGES += mwlwifi-firmware-88w8864
+  SUPPORTED_DEVICES += armada-385-linksys-cobra linksys,cobra
  endef
  TARGET_DEVICES += linksys_wrt1900ac-v2
define Device/linksys_wrt3200acm
    $(call Device/linksys)
+  $(Device/dsa-migration)
    DEVICE_MODEL := WRT3200ACM
    DEVICE_ALT0_VENDOR := Linksys
    DEVICE_ALT0_MODEL := Rango
    DEVICE_DTS := armada-385-linksys-rango
    DEVICE_PACKAGES += kmod-btmrvl kmod-mwifiex-sdio mwlwifi-firmware-88w8964
+  SUPPORTED_DEVICES += armada-385-linksys-rango linksys,rango
  endef
  TARGET_DEVICES += linksys_wrt3200acm
define Device/linksys_wrt32x
    $(call Device/linksys)
+  $(Device/dsa-migration)
    DEVICE_MODEL := WRT32X
    DEVICE_ALT0_VENDOR := Linksys
    DEVICE_ALT0_MODEL := Venom
@@ -127,6 +143,7 @@ define Device/linksys_wrt32x
    DEVICE_PACKAGES += kmod-btmrvl kmod-mwifiex-sdio mwlwifi-firmware-88w8964
    KERNEL_SIZE := 3072k
    KERNEL := kernel-bin | append-dtb
+  SUPPORTED_DEVICES += armada-385-linksys-venom linksys,venom
  endef
  TARGET_DEVICES += linksys_wrt32x
@@ -218,6 +235,7 @@ endef
  TARGET_DEVICES += solidrun_clearfog-base-a1
define Device/solidrun_clearfog-pro-a1
+  $(Device/dsa-migration)
    DEVICE_VENDOR := SolidRun
    DEVICE_MODEL := ClearFog Pro
    KERNEL_INSTALL := 1
@@ -228,5 +246,6 @@ define Device/solidrun_clearfog-pro-a1
    DEVICE_DTS := armada-388-clearfog-pro armada-388-clearfog-base
    UBOOT := clearfog-u-boot-spl.kwb
    BOOT_SCRIPT := clearfog
+  SUPPORTED_DEVICES += armada-388-clearfog armada-388-clearfog-pro
  endef
  TARGET_DEVICES += solidrun_clearfog-pro-a1

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to