diff mbox series

[OpenWrt-Devel,19.07] ar71xx: fix sysupgrade to ath79 for wndr3700v2 and wndr3800

Message ID 20190930195425.28617-1-ynezz@true.cz
State Rejected
Delegated to: Petr Štetiar
Headers show
Series [OpenWrt-Devel,19.07] ar71xx: fix sysupgrade to ath79 for wndr3700v2 and wndr3800 | expand

Commit Message

Petr Štetiar Sept. 30, 2019, 7:54 p.m. UTC
ar71xx has just one board name wndr3700 for wndr 3700, 3700v2 and 3800
which is causing issues with sysupgrades to ath79 as there are separate
images for every board, so fix it by using proper board name on ar71xx
as well.

Ref: FS#2510
Signed-off-by: Petr Štetiar <ynezz@true.cz>
---
 target/linux/ar71xx/base-files/etc/board.d/01_leds            | 4 +++-
 target/linux/ar71xx/base-files/etc/diag.sh                    | 2 ++
 .../linux/ar71xx/base-files/etc/uci-defaults/04_led_migration | 2 ++
 target/linux/ar71xx/base-files/lib/ar71xx.sh                  | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh        | 2 ++
 5 files changed, 12 insertions(+), 1 deletion(-)

Comments

Adrian Schmutzler Sept. 30, 2019, 8:58 p.m. UTC | #1
Hi Petr,


> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org]
> On Behalf Of Petr Štetiar
> Sent: Montag, 30. September 2019 21:54
> To: openwrt-devel@lists.openwrt.org
> Cc: Petr Štetiar <ynezz@true.cz>
> Subject: [OpenWrt-Devel] [PATCH 19.07] ar71xx: fix sysupgrade to ath79 for
> wndr3700v2 and wndr3800
> 
> ar71xx has just one board name wndr3700 for wndr 3700, 3700v2 and 3800
> which is causing issues with sysupgrades to ath79 as there are separate
> images for every board, so fix it by using proper board name on ar71xx as
> well.
> 

no offense, but do you really want to start this?

ar71xx has so many similar cases like this, which nobody ever cared about, maybe it would be easier to just deal with this in ath79 by setting SUPPORTED_DEVICES?

On the other hand, if you really think it's worth it, I could provide several patches for similar cases with TP-Link devices (TL-WR841, WDR3600/4300...).

Best

Adrian
Petr Štetiar Oct. 1, 2019, 4:50 a.m. UTC | #2
mail@adrianschmutzler.de <mail@adrianschmutzler.de> [2019-09-30 22:58:22]:

Hi,

> ar71xx has so many similar cases like this, which nobody ever cared about,

well this case was properly reported and I got simply interested because of
the proposed `sysupgrade -F` "fix" in that bug report.

> maybe it would be easier to just deal with this in ath79 by setting
> SUPPORTED_DEVICES?

I've looked at this option first, then seen different NETGEAR_KERNEL_MAGIC and
NETGEAR_HW_ID for those device and I've thought, that fixing it with
SUPPORTED_DEVICES would just make the mess worse.

> On the other hand, if you really think it's worth it, 

I think, that we should avoid promoting `sysupgrade -F` as a standard upgrade
procedure for the obvious reasons.

-- ynezz
Adrian Schmutzler Oct. 1, 2019, 10:07 a.m. UTC | #3
Hi,

> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org] On Behalf Of Petr Štetiar
> Sent: Dienstag, 1. Oktober 2019 06:50
> To: mail@adrianschmutzler.de
> Cc: openwrt-devel@lists.openwrt.org
> Subject: Re: [OpenWrt-Devel] [PATCH 19.07] ar71xx: fix sysupgrade to ath79 for wndr3700v2 and wndr3800
> 
> mail@adrianschmutzler.de <mail@adrianschmutzler.de> [2019-09-30 22:58:22]:
> 
> Hi,
> 
> > ar71xx has so many similar cases like this, which nobody ever cared about,
> 
> well this case was properly reported and I got simply interested because of
> the proposed `sysupgrade -F` "fix" in that bug report.
> 
> > maybe it would be easier to just deal with this in ath79 by setting
> > SUPPORTED_DEVICES?
> 
> I've looked at this option first, then seen different NETGEAR_KERNEL_MAGIC and
> NETGEAR_HW_ID for those device and I've thought, that fixing it with
> SUPPORTED_DEVICES would just make the mess worse.

I see the point, I just wasn't expecting an attempt to fix this in the very last days of ar71xx.

Nevertheless, to support older devices, you would still have to add the "wndr3700" string to wndr3700v2 and wndr3800 in ath79 ...

> 
> > On the other hand, if you really think it's worth it,
> 
> I think, that we should avoid promoting `sysupgrade -F` as a standard upgrade
> procedure for the obvious reasons.

Definitely. However, I just added the "correct" name in ath79 for such cases, i.e. TP-Link WDR3600 having
SUPPORTED_DEVICES += tl-wdr4300
etc.

I will have a look whether similar fixes to yours for the TP-Link devices with similar setup are reasonable or not ...

Best

Adrian

> 
> -- ynezz
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Vincent Wiemann Oct. 4, 2019, 12:27 a.m. UTC | #4
Hi,


On 01.10.19 12:07, Adrian Schmutzler wrote:
> Hi,
> 
>> -----Original Message-----
>> From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org] On Behalf Of Petr Štetiar
>> Sent: Dienstag, 1. Oktober 2019 06:50
>> To: mail@adrianschmutzler.de
>> Cc: openwrt-devel@lists.openwrt.org
>> Subject: Re: [OpenWrt-Devel] [PATCH 19.07] ar71xx: fix sysupgrade to ath79 for wndr3700v2 and wndr3800
>>
>> mail@adrianschmutzler.de <mail@adrianschmutzler.de> [2019-09-30 22:58:22]:
>>
>> Hi,
>>
>>> ar71xx has so many similar cases like this, which nobody ever cared about,
>>
>> well this case was properly reported and I got simply interested because of
>> the proposed `sysupgrade -F` "fix" in that bug report.
>>
>>> maybe it would be easier to just deal with this in ath79 by setting
>>> SUPPORTED_DEVICES?
>>
>> I've looked at this option first, then seen different NETGEAR_KERNEL_MAGIC and
>> NETGEAR_HW_ID for those device and I've thought, that fixing it with
>> SUPPORTED_DEVICES would just make the mess worse.
> 
> I see the point, I just wasn't expecting an attempt to fix this in the very last days of ar71xx.
> 
> Nevertheless, to support older devices, you would still have to add the "wndr3700" string to wndr3700v2 and wndr3800 in ath79 ...
> 
>>
>>> On the other hand, if you really think it's worth it,
>>
>> I think, that we should avoid promoting `sysupgrade -F` as a standard upgrade
>> procedure for the obvious reasons.
> 
> Definitely. However, I just added the "correct" name in ath79 for such cases, i.e. TP-Link WDR3600 having
> SUPPORTED_DEVICES += tl-wdr4300
> etc.
> 
> I will have a look whether similar fixes to yours for the TP-Link devices with similar setup are reasonable or not ...
> 
> Best
> 
> Adrian
> 
>>
>> -- ynezz

I think both of your approaches work well together.
A similar case where I have trouble with this scenario are the Ubiquiti AirMax devices.
At the moment different models with different antennas share common model definitions
which makes it hard to e.g. introduce antenna_gain-definitions in DTS.
Thus it would be nice to have separate definitions for each model in ath79
even if they share the same board. A migration script in ath79 could help changing the
model definition afterwards so that e.g. a Luci Updater could find the proper image.

Are there any critical hardware differences between the devices in question?
Why do they need to be treated differently in OpenWrt?
If not the best thing could just be to do changes in ath79 only as Adrian suggested.

Regards,

Vincent Wiemann
Adrian Schmutzler Nov. 13, 2019, 5:26 p.m. UTC | #5
Hi Petr,

> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org] On
> Behalf Of Adrian Schmutzler
> Sent: Dienstag, 1. Oktober 2019 12:07
> To: 'Petr Štetiar' <ynezz@true.cz>
> Cc: openwrt-devel@lists.openwrt.org
> Subject: Re: [OpenWrt-Devel] [PATCH 19.07] ar71xx: fix sysupgrade to ath79 for
> wndr3700v2 and wndr3800
> 

just stumbled over this "old" patch again.

I think it would be good to merge it soon (before a -rc2 comes up) or adjust the ath79 SUPPORTED_DEVICES otherwise.

I think we should establish a forceless upgrade path (and some user testing for the changed board names) before 19.07.0 is released.

Best

Adrian
diff mbox series

Patch

diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index 8e49cb9fe253..26e685be1cb9 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -999,7 +999,9 @@  wam250)
 wndap360)
 	ucidef_set_led_power "power" "POWER GREEN" "netgear:green:power" "1"
 	;;
-wndr3700)
+wndr3700|\
+wndr3700v2|\
+wndr3800)
 	ucidef_set_led_default "wan" "WAN LED (green)" "netgear:green:wan" "0"
 	ucidef_set_led_usbport "usb" "USB" "netgear:green:usb" "usb1-port1"
 	;;
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 8ff75627a538..19adf8fa96a9 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -527,7 +527,9 @@  get_status_led() {
 	r6100|\
 	wndap360|\
 	wndr3700|\
+	wndr3700v2|\
 	wndr3700v4|\
+	wndr3800|\
 	wndr4300|\
 	wnr2000|\
 	wnr2000-v3|\
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/04_led_migration b/target/linux/ar71xx/base-files/etc/uci-defaults/04_led_migration
index 4dd224b549a3..3e2259b76e84 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/04_led_migration
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/04_led_migration
@@ -60,6 +60,8 @@  oolite-v1)
 	;;
 wndap360|\
 wndr3700|\
+wndr3700v2|\
+wndr3800|\
 wnr2000|\
 wnr2200)
 	migrate_leds "${board}:=netgear:"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 894835b14d79..d85801956054 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -46,13 +46,16 @@  wndr3700_board_detect() {
 				machine="NETGEAR WNDRMAC"
 			else
 				machine="NETGEAR WNDR3700v2"
+				name="wndr3700v2"
 			fi
 			;;
 		'29763654+16+64'*)
 			machine="NETGEAR ${model_stripped:14}"
+			name="wndr3700v2"
 			;;
 		'29763654+16+128'*)
 			machine="NETGEAR ${model_stripped:15}"
+			name="wndr3800"
 			;;
 		*)
 			# Unknown ID
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 91bffcb8c1fd..86b9ab932f68 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -677,6 +677,8 @@  platform_check_image() {
 		return 1
 		;;
 	wndr3700|\
+	wndr3700v2|\
+	wndr3800|\
 	wnr1000-v2|\
 	wnr2000-v3|\
 	wnr612-v2|\