diff mbox series

[OpenWrt-Devel,RFC] kirkwood: use real model names for Linksys devices

Message ID 20200613200852.28760-1-freifunk@adrianschmutzler.de
State Superseded
Delegated to: Adrian Schmutzler
Headers show
Series [OpenWrt-Devel,RFC] kirkwood: use real model names for Linksys devices | expand

Commit Message

Adrian Schmutzler June 13, 2020, 8:08 p.m. UTC
This replaces the internal device names "Audi" and "Viper" with the
real model names, which a user would look for. This makes the
Linksys devices on this target consistent with the names recently
changed for mvebu based on the same idea.

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

While marked as RFC, this patch should be fully ready for merge already.

---
 package/boot/uboot-envtools/files/kirkwood             |  4 ++--
 target/linux/kirkwood/base-files/etc/board.d/01_leds   |  2 +-
 .../linux/kirkwood/base-files/etc/board.d/02_network   |  4 ++--
 target/linux/kirkwood/base-files/etc/init.d/bootcount  |  4 ++--
 .../linux/kirkwood/base-files/lib/upgrade/platform.sh  |  4 ++--
 .../arch/arm/boot/dts/kirkwood-linksys-audi.dts        |  2 +-
 target/linux/kirkwood/image/Makefile                   | 10 ++++++----
 target/linux/kirkwood/patches-5.4/105-ea4500.patch     |  9 +++++++++
 8 files changed, 25 insertions(+), 14 deletions(-)

Comments

Paweł Dembicki June 14, 2020, 7:52 p.m. UTC | #1
sob., 13 cze 2020 o 22:09 Adrian Schmutzler
<freifunk@adrianschmutzler.de> napisał(a):
>

Hi Adrian,

> This replaces the internal device names "Audi" and "Viper" with the
> real model names, which a user would look for. This makes the
> Linksys devices on this target consistent with the names recently
> changed for mvebu based on the same idea.
>
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> ---
>
> While marked as RFC, this patch should be fully ready for merge already.
>
> ---
>  package/boot/uboot-envtools/files/kirkwood             |  4 ++--
>  target/linux/kirkwood/base-files/etc/board.d/01_leds   |  2 +-
>  .../linux/kirkwood/base-files/etc/board.d/02_network   |  4 ++--
>  target/linux/kirkwood/base-files/etc/init.d/bootcount  |  4 ++--
>  .../linux/kirkwood/base-files/lib/upgrade/platform.sh  |  4 ++--
>  .../arch/arm/boot/dts/kirkwood-linksys-audi.dts        |  2 +-
>  target/linux/kirkwood/image/Makefile                   | 10 ++++++----
>  target/linux/kirkwood/patches-5.4/105-ea4500.patch     |  9 +++++++++
>  8 files changed, 25 insertions(+), 14 deletions(-)
>
> diff --git a/package/boot/uboot-envtools/files/kirkwood b/package/boot/uboot-envtools/files/kirkwood
> index b5f7ddccb7..10dde84c8c 100644
> --- a/package/boot/uboot-envtools/files/kirkwood
> +++ b/package/boot/uboot-envtools/files/kirkwood
> @@ -16,14 +16,14 @@ case "$board" in
>  cloudengines,pogoe02|\
>  cloudengines,pogoplugv4|\
>  iom,ix2-200|\
> -linksys,viper|\
> +linksys,ea4500|\
>  raidsonic,ib-nas62x0|\
>  seagate,dockstar|\
>  zyxel,nsa310b|\
>  zyxel,nsa325)
>         ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
>         ;;
> -linksys,audi)
> +linksys,ea3500)
>         ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x4000"
>         ;;
>  esac
> diff --git a/target/linux/kirkwood/base-files/etc/board.d/01_leds b/target/linux/kirkwood/base-files/etc/board.d/01_leds
> index bba845eae5..7e589e9bfc 100755
> --- a/target/linux/kirkwood/base-files/etc/board.d/01_leds
> +++ b/target/linux/kirkwood/base-files/etc/board.d/01_leds
> @@ -13,7 +13,7 @@ case "$board" in
>  "iom,ix2-200")
>         ucidef_set_led_timer "health" "health" "status:white:rebuild_led" "200" "800"
>         ;;
> -"linksys,viper")
> +"linksys,ea4500")
>         ucidef_set_led_default "pulse" "pulse" "viper:white:pulse" "1"
>         ;;
>  "zyxel,nsa310b")
> 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 df01b0bb1b..3c844f2819 100755
> --- a/target/linux/kirkwood/base-files/etc/board.d/02_network
> +++ b/target/linux/kirkwood/base-files/etc/board.d/02_network
> @@ -24,8 +24,8 @@ case "$board" in
>  "seagate,goflexnet")
>         ucidef_set_interface_lan "eth0" "dhcp"
>         ;;
> -"linksys,audi"|\
> -"linksys,viper")
> +"linksys,ea3500"|\
> +"linksys,ea4500")
>         ucidef_set_interfaces_lan_wan "ethernet1 ethernet2 ethernet3 ethernet4" "internet"
>         ucidef_set_interface_macaddr "wan" $( mtd_get_mac_ascii u_env eth1addr )
>         ;;
> diff --git a/target/linux/kirkwood/base-files/etc/init.d/bootcount b/target/linux/kirkwood/base-files/etc/init.d/bootcount
> index 478f3d0134..b1e5152326 100755
> --- a/target/linux/kirkwood/base-files/etc/init.d/bootcount
> +++ b/target/linux/kirkwood/base-files/etc/init.d/bootcount
> @@ -4,8 +4,8 @@ START=99
>
>  boot() {
>         case $(board_name) in
> -       linksys,audi|\
> -       linksys,viper)
> +       linksys,ea3500|\
> +       linksys,ea4500)
>                 mtd resetbc s_env || true
>                 ;;
>         esac
> diff --git a/target/linux/kirkwood/base-files/lib/upgrade/platform.sh b/target/linux/kirkwood/base-files/lib/upgrade/platform.sh
> index 6d63a0a4b7..4629395347 100644
> --- a/target/linux/kirkwood/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/kirkwood/base-files/lib/upgrade/platform.sh
> @@ -11,8 +11,8 @@ platform_do_upgrade() {
>         local board="$(board_name)"
>
>         case "$board" in
> -       "linksys,audi"|\
> -       "linksys,viper")
> +       linksys,ea3500|\
> +       linksys,ea4500)
>                 platform_do_upgrade_linksys "$1"
>                 ;;
>         *)
> diff --git a/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-linksys-audi.dts b/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-linksys-audi.dts
> index 90250fefc8..5952f57a4a 100644
> --- a/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-linksys-audi.dts
> +++ b/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-linksys-audi.dts
> @@ -16,7 +16,7 @@
>
>  / {
>         model = "Linksys Audi (EA3500)";
> -       compatible = "linksys,audi", "marvell,kirkwood-88f6282", "marvell,kirkwood";
> +       compatible = "linksys,ea3500", "linksys,audi", "marvell,kirkwood-88f6282", "marvell,kirkwood";
>
>         memory@0 {
>                 device_type = "memory";
> diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile
> index 552ee44ee4..c56415bf1c 100644
> --- a/target/linux/kirkwood/image/Makefile
> +++ b/target/linux/kirkwood/image/Makefile
> @@ -78,7 +78,7 @@ define Device/iom_ix2-200
>  endef
>  TARGET_DEVICES += iom_ix2-200
>
> -define Device/linksys_audi
> +define Device/linksys_ea3500
>    DEVICE_VENDOR := Linksys
>    DEVICE_MODEL := EA3500 (Audi)
>    DEVICE_PACKAGES := kmod-mwl8k wpad-basic kmod-gpio-button-hotplug
> @@ -90,11 +90,12 @@ define Device/linksys_audi
>    UBINIZE_OPTS := -E 5
>    IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
>    BOARD_NAME := linksys-audi
> +  SUPPORTED_DEVICES += linksys,audi

You didn't add "SUPPORTED_DEVICES" in mvebu. After movement to DSA,
images have broken config after sysupgrade. Maybe at this moment drop
this line?

>    DEFAULT := n
>  endef
> -TARGET_DEVICES += linksys_audi
> +TARGET_DEVICES += linksys_ea3500
>
> -define Device/linksys_viper
> +define Device/linksys_ea4500
>    DEVICE_VENDOR := Linksys
>    DEVICE_MODEL := E4200v2 / EA4500 (Viper)
>    DEVICE_PACKAGES := kmod-mwl8k wpad-basic kmod-gpio-button-hotplug
> @@ -103,8 +104,9 @@ define Device/linksys_viper
>    UBINIZE_OPTS := -E 5
>    IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
>    BOARD_NAME := linksys-viper
> +  SUPPORTED_DEVICES += linksys,viper

The same issue like in Audi.

>  endef
> -TARGET_DEVICES += linksys_viper
> +TARGET_DEVICES += linksys_ea4500
>
>  define Device/raidsonic_ib-nas62x0
>    DEVICE_VENDOR := RaidSonic
> diff --git a/target/linux/kirkwood/patches-5.4/105-ea4500.patch b/target/linux/kirkwood/patches-5.4/105-ea4500.patch
> index 0d97ad14a2..c2bbe9d240 100644
> --- a/target/linux/kirkwood/patches-5.4/105-ea4500.patch
> +++ b/target/linux/kirkwood/patches-5.4/105-ea4500.patch
> @@ -1,5 +1,14 @@
>  --- a/arch/arm/boot/dts/kirkwood-linksys-viper.dts
>  +++ b/arch/arm/boot/dts/kirkwood-linksys-viper.dts
> +@@ -16,7 +16,7 @@
> +
> + / {
> +       model = "Linksys Viper (E4200v2 / EA4500)";
> +-      compatible = "linksys,viper", "marvell,kirkwood-88f6282", "marvell,kirkwood";
> ++      compatible = "linksys,ea4500", "linksys,viper", "marvell,kirkwood-88f6282", "marvell,kirkwood";
> +
> +       memory {
> +               device_type = "memory";
>  @@ -24,6 +24,10 @@
>         };
>
> --
> 2.20.1


BR,
Pawel Dembicki
Adrian Schmutzler June 14, 2020, 8:12 p.m. UTC | #2
Hi,

> > +  SUPPORTED_DEVICES += linksys,audi
> 
> You didn't add "SUPPORTED_DEVICES" in mvebu. After movement to DSA,
> images have broken config after sysupgrade. Maybe at this moment drop
> this line?

Hmm, adding support for DSA has been already 45 days ago.
So there will be at least a few DSA devices out there that already have adapted the new config (at least for viper, for audi somebody would have to build his own image, so there might be much less), but still have the "audi"/"viper" name. Those would then be annoyed by the need to force upgrade.

On the other side, the users that may be hindered from destroying their network config by the rename without keeping SUPPORTED_DEVICES might be many more; and the early adopters might be more ready to deal with the forced upgrade (where they could actually keep their config) than the others might be with cleaning up a broken network config.

So, all in all I'm inclined to follow this suggestion, unless somebody has a strong point against it.
(I would also drop the BOARD_NAME then, and use DEVICE_DTS instead.)

Thanks for making me aware of this.

Best

Adrian
Paweł Dembicki June 14, 2020, 8:29 p.m. UTC | #3
niedz., 14 cze 2020 o 22:12 <mail@adrianschmutzler.de> napisał(a):
>
> Hi,
>
> > > +  SUPPORTED_DEVICES += linksys,audi
> >
> > You didn't add "SUPPORTED_DEVICES" in mvebu. After movement to DSA,
> > images have broken config after sysupgrade. Maybe at this moment drop
> > this line?
>
> Hmm, adding support for DSA has been already 45 days ago.
> So there will be at least a few DSA devices out there that already have adapted the new config (at least for viper, for audi somebody would have to build his own image, so there might be much less), but still have the "audi"/"viper" name. Those would then be annoyed by the need to force upgrade.
>
> On the other side, the users that may be hindered from destroying their network config by the rename without keeping SUPPORTED_DEVICES might be many more; and the early adopters might be more ready to deal with the forced upgrade (where they could actually keep their config) than the others might be with cleaning up a broken network config.
>

Snapshot users are likely intermediate/expert users. They know, that
snapshots could have surprises.  The problem will start with stable
20.X, when regular people will update their <=19.07 devices.

Your sysupgrade patch is at this moment the only way to make it proper
in future.

> So, all in all I'm inclined to follow this suggestion, unless somebody has a strong point against it.
> (I would also drop the BOARD_NAME then, and use DEVICE_DTS instead.)
>
> Thanks for making me aware of this.
>
> Best
>
> Adrian


BR,
Pawel Dembicki
diff mbox series

Patch

diff --git a/package/boot/uboot-envtools/files/kirkwood b/package/boot/uboot-envtools/files/kirkwood
index b5f7ddccb7..10dde84c8c 100644
--- a/package/boot/uboot-envtools/files/kirkwood
+++ b/package/boot/uboot-envtools/files/kirkwood
@@ -16,14 +16,14 @@  case "$board" in
 cloudengines,pogoe02|\
 cloudengines,pogoplugv4|\
 iom,ix2-200|\
-linksys,viper|\
+linksys,ea4500|\
 raidsonic,ib-nas62x0|\
 seagate,dockstar|\
 zyxel,nsa310b|\
 zyxel,nsa325)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
 	;;
-linksys,audi)
+linksys,ea3500)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x4000"
 	;;
 esac
diff --git a/target/linux/kirkwood/base-files/etc/board.d/01_leds b/target/linux/kirkwood/base-files/etc/board.d/01_leds
index bba845eae5..7e589e9bfc 100755
--- a/target/linux/kirkwood/base-files/etc/board.d/01_leds
+++ b/target/linux/kirkwood/base-files/etc/board.d/01_leds
@@ -13,7 +13,7 @@  case "$board" in
 "iom,ix2-200")
 	ucidef_set_led_timer "health" "health" "status:white:rebuild_led" "200" "800"
 	;;
-"linksys,viper")
+"linksys,ea4500")
 	ucidef_set_led_default "pulse" "pulse" "viper:white:pulse" "1"
 	;;
 "zyxel,nsa310b")
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 df01b0bb1b..3c844f2819 100755
--- a/target/linux/kirkwood/base-files/etc/board.d/02_network
+++ b/target/linux/kirkwood/base-files/etc/board.d/02_network
@@ -24,8 +24,8 @@  case "$board" in
 "seagate,goflexnet")
 	ucidef_set_interface_lan "eth0" "dhcp"
 	;;
-"linksys,audi"|\
-"linksys,viper")
+"linksys,ea3500"|\
+"linksys,ea4500")
 	ucidef_set_interfaces_lan_wan "ethernet1 ethernet2 ethernet3 ethernet4" "internet"
 	ucidef_set_interface_macaddr "wan" $( mtd_get_mac_ascii u_env eth1addr )
 	;;
diff --git a/target/linux/kirkwood/base-files/etc/init.d/bootcount b/target/linux/kirkwood/base-files/etc/init.d/bootcount
index 478f3d0134..b1e5152326 100755
--- a/target/linux/kirkwood/base-files/etc/init.d/bootcount
+++ b/target/linux/kirkwood/base-files/etc/init.d/bootcount
@@ -4,8 +4,8 @@  START=99
 
 boot() {
 	case $(board_name) in
-	linksys,audi|\
-	linksys,viper)
+	linksys,ea3500|\
+	linksys,ea4500)
 		mtd resetbc s_env || true
 		;;
 	esac
diff --git a/target/linux/kirkwood/base-files/lib/upgrade/platform.sh b/target/linux/kirkwood/base-files/lib/upgrade/platform.sh
index 6d63a0a4b7..4629395347 100644
--- a/target/linux/kirkwood/base-files/lib/upgrade/platform.sh
+++ b/target/linux/kirkwood/base-files/lib/upgrade/platform.sh
@@ -11,8 +11,8 @@  platform_do_upgrade() {
 	local board="$(board_name)"
 
 	case "$board" in
-	"linksys,audi"|\
-	"linksys,viper")
+	linksys,ea3500|\
+	linksys,ea4500)
 		platform_do_upgrade_linksys "$1"
 		;;
 	*)
diff --git a/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-linksys-audi.dts b/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-linksys-audi.dts
index 90250fefc8..5952f57a4a 100644
--- a/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-linksys-audi.dts
+++ b/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-linksys-audi.dts
@@ -16,7 +16,7 @@ 
 
 / {
 	model = "Linksys Audi (EA3500)";
-	compatible = "linksys,audi", "marvell,kirkwood-88f6282", "marvell,kirkwood";
+	compatible = "linksys,ea3500", "linksys,audi", "marvell,kirkwood-88f6282", "marvell,kirkwood";
 
 	memory@0 {
 		device_type = "memory";
diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile
index 552ee44ee4..c56415bf1c 100644
--- a/target/linux/kirkwood/image/Makefile
+++ b/target/linux/kirkwood/image/Makefile
@@ -78,7 +78,7 @@  define Device/iom_ix2-200
 endef
 TARGET_DEVICES += iom_ix2-200
 
-define Device/linksys_audi
+define Device/linksys_ea3500
   DEVICE_VENDOR := Linksys
   DEVICE_MODEL := EA3500 (Audi)
   DEVICE_PACKAGES := kmod-mwl8k wpad-basic kmod-gpio-button-hotplug
@@ -90,11 +90,12 @@  define Device/linksys_audi
   UBINIZE_OPTS := -E 5
   IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
   BOARD_NAME := linksys-audi
+  SUPPORTED_DEVICES += linksys,audi
   DEFAULT := n
 endef
-TARGET_DEVICES += linksys_audi
+TARGET_DEVICES += linksys_ea3500
 
-define Device/linksys_viper
+define Device/linksys_ea4500
   DEVICE_VENDOR := Linksys
   DEVICE_MODEL := E4200v2 / EA4500 (Viper)
   DEVICE_PACKAGES := kmod-mwl8k wpad-basic kmod-gpio-button-hotplug
@@ -103,8 +104,9 @@  define Device/linksys_viper
   UBINIZE_OPTS := -E 5
   IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
   BOARD_NAME := linksys-viper
+  SUPPORTED_DEVICES += linksys,viper
 endef
-TARGET_DEVICES += linksys_viper
+TARGET_DEVICES += linksys_ea4500
 
 define Device/raidsonic_ib-nas62x0
   DEVICE_VENDOR := RaidSonic
diff --git a/target/linux/kirkwood/patches-5.4/105-ea4500.patch b/target/linux/kirkwood/patches-5.4/105-ea4500.patch
index 0d97ad14a2..c2bbe9d240 100644
--- a/target/linux/kirkwood/patches-5.4/105-ea4500.patch
+++ b/target/linux/kirkwood/patches-5.4/105-ea4500.patch
@@ -1,5 +1,14 @@ 
 --- a/arch/arm/boot/dts/kirkwood-linksys-viper.dts
 +++ b/arch/arm/boot/dts/kirkwood-linksys-viper.dts
+@@ -16,7 +16,7 @@
+ 
+ / {
+ 	model = "Linksys Viper (E4200v2 / EA4500)";
+-	compatible = "linksys,viper", "marvell,kirkwood-88f6282", "marvell,kirkwood";
++	compatible = "linksys,ea4500", "linksys,viper", "marvell,kirkwood-88f6282", "marvell,kirkwood";
+ 
+ 	memory {
+ 		device_type = "memory";
 @@ -24,6 +24,10 @@
  	};