[OpenWrt-Devel] [PATCH] ath79: drop SUPPORTED_DEVICES for all TP-LINK routers

Chuanhong Guo gch981213 at gmail.com
Sun Aug 19 09:47:06 EDT 2018


These lines are coming from ar71xx to allow using sysupgrade to
switch from ar71xx to ath79. But a sysupgrade with config preserved
won't work since some of the config files are incompatible.

This commit removed all SUPPORTED_DEVICES for TP-LINK routers.
For those who want to use sysupgrade to switch target on TP-LINK
router you could use the generated factory firmware instead. This
works because:
1. ar71xx doesn't require a image metadata so using a firmware without
   OpenWrt metadata will skip fwtool checking.
2. The differences between factory and sysupgrade image is the metadata
   and the tail padding.
3. Using factory firmware for TP-LINK devices here automatically disallows
   preserving config files because sysupgrade.tar won't be appended after
   0xdeadc0de jffs2 mark.
4. ar71xx still check the device model in TP-LINK firmware header so an
   invalid image won't pass sysupgrade checking.

PISEN WMM003N is never supported by ar71xx, this commit also removed
SUPPORTED_DEVICES for it because it's completely useless.

Signed-off-by: Chuanhong Guo <gch981213 at gmail.com>
---

I personally don't like these SUPPORTED_DEVICES because it's used to create
compatibility with a target that will finally be obsolete. These lines will
be useless when ar71xx is replaced by ath79. They are also somehow misleading
as we've seen many contributors adding a SUPPORTED_DEVICES line with a string
that never exists in ar71xx. (I used "somehow" here because it's not
misleading to me but I just saw these mistakes made by others.)
Use factory firmware to do the sysupgrade from ar71xx to ath79 for TP-LINK
routers will pass firmware checking in ar71xx and automatically gain the
ability to prohibit config preserving so I think at least removing them for
TP-LINK routers is reasonable.

 target/linux/ath79/image/generic-tp-link.mk | 7 -------
 target/linux/ath79/image/generic.mk         | 1 -
 target/linux/ath79/image/tiny-tp-link.mk    | 9 ---------
 3 files changed, 17 deletions(-)

diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk
index 4c85099a1a..dceb2130f2 100644
--- a/target/linux/ath79/image/generic-tp-link.mk
+++ b/target/linux/ath79/image/generic-tp-link.mk
@@ -35,7 +35,6 @@ define Device/tplink_tl-wdr3600
   DEVICE_TITLE := TP-LINK TL-WDR3600
   DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
   TPLINK_HWID := 0x36000001
-  SUPPORTED_DEVICES += tl-wdr3600
 endef
 TARGET_DEVICES += tplink_tl-wdr3600
 
@@ -45,7 +44,6 @@ define Device/tplink_tl-wdr4300
   DEVICE_TITLE := TP-LINK TL-WDR4300
   DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
   TPLINK_HWID := 0x43000001
-  SUPPORTED_DEVICES += tl-wdr4300
 endef
 TARGET_DEVICES += tplink_tl-wdr4300
 
@@ -64,7 +62,6 @@ define Device/tplink_tl-wr1043nd-v1
   DEVICE_TITLE := TP-LINK TL-WR1043N/ND v1
   DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
   TPLINK_HWID := 0x10430001
-  SUPPORTED_DEVICES += tl-wr1043nd
 endef
 TARGET_DEVICES += tplink_tl-wr1043nd-v1
 
@@ -74,7 +71,6 @@ define Device/tplink_tl-wr1043nd-v2
   DEVICE_TITLE := TP-LINK TL-WR1043N/ND v2
   DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
   TPLINK_HWID := 0x10430002
-  SUPPORTED_DEVICES += tl-wr1043nd-v2
 endef
 TARGET_DEVICES += tplink_tl-wr1043nd-v2
 
@@ -84,7 +80,6 @@ define Device/tplink_tl-wr1043nd-v3
   DEVICE_TITLE := TP-LINK TL-WR1043N/ND v3
   DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
   TPLINK_HWID := 0x10430003
-  SUPPORTED_DEVICES += tl-wr1043nd-v3
 endef
 TARGET_DEVICES += tplink_tl-wr1043nd-v3
 
@@ -100,7 +95,6 @@ define Device/tplink_tl-wr1043nd-v4
   IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \
     append-metadata | check-size $$$$(IMAGE_SIZE)
   IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
-  SUPPORTED_DEVICES += tl-wr1043nd-v4
 endef
 TARGET_DEVICES += tplink_tl-wr1043nd-v4
 
@@ -113,6 +107,5 @@ define Device/tplink_tl-wr2543-v1
   IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade -v 3.13.99 | \
     append-metadata | check-size $$$$(IMAGE_SIZE)
   IMAGE/factory.bin := append-rootfs | mktplinkfw factory -v 3.13.99
-  SUPPORTED_DEVICES += tl-wr2543-v1
 endef
 TARGET_DEVICES += tplink_tl-wr2543-v1
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index b3eaee48b7..f211db981a 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -185,7 +185,6 @@ define Device/pisen_wmm003n
   DEVICE_TITLE := Pisen WMM003N (Cloud Easy Power)
   DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-chipidea2
   TPLINK_HWID := 0x07030101
-  SUPPORTED_DEVICES += wmm003n
   IMAGES := sysupgrade.bin
 endef
 TARGET_DEVICES += pisen_wmm003n
diff --git a/target/linux/ath79/image/tiny-tp-link.mk b/target/linux/ath79/image/tiny-tp-link.mk
index 6ccc9d7dba..baa0005f9c 100644
--- a/target/linux/ath79/image/tiny-tp-link.mk
+++ b/target/linux/ath79/image/tiny-tp-link.mk
@@ -7,7 +7,6 @@ define Device/tplink_tl-mr10u
   DEVICE_TITLE := TP-Link TL-MR10U
   DEVICE_PACKAGES := kmod-usb-chipidea2
   TPLINK_HWID := 0x00100101
-  SUPPORTED_DEVICES += tl-mr10u
 endef
 TARGET_DEVICES += tplink_tl-mr10u
 
@@ -17,7 +16,6 @@ define Device/tplink_tl-mr3020-v1
   DEVICE_TITLE := TP-LINK TL-MR3020 v1
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea2 kmod-usb-ledtrig-usbport
   TPLINK_HWID := 0x30200001
-  SUPPORTED_DEVICES += tl-mr3020-v1
 endef
 TARGET_DEVICES += tplink_tl-mr3020-v1
 
@@ -27,7 +25,6 @@ define Device/tplink_tl-mr3040-v2
   DEVICE_TITLE := TP-LINK TL-MR3040 v2
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea2 kmod-usb-ledtrig-usbport
   TPLINK_HWID := 0x30400002
-  SUPPORTED_DEVICES += tl-mr3040-v2
 endef
 TARGET_DEVICES += tplink_tl-mr3040-v2
 
@@ -37,7 +34,6 @@ define Device/tplink_tl-mr3220-v1
   DEVICE_TITLE := TP-Link TL-MR3220 v1
   TPLINK_HWID := 0x32200001
   DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
-  SUPPORTED_DEVICES += tl-mr3220-v1
 endef
 TARGET_DEVICES += tplink_tl-mr3220-v1
 
@@ -47,7 +43,6 @@ define Device/tplink_tl-mr3420-v1
   DEVICE_TITLE := TP-Link TL-MR3420 v1
   TPLINK_HWID := 0x34200001
   DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
-  SUPPORTED_DEVICES += tl-mr3420-v1
 endef
 TARGET_DEVICES += tplink_tl-mr3420-v1
 
@@ -57,7 +52,6 @@ define Device/tplink_tl-wr703n
   DEVICE_TITLE := TP-Link TL-WR703N
   DEVICE_PACKAGES := kmod-usb-chipidea2
   TPLINK_HWID := 0x07030101
-  SUPPORTED_DEVICES += tl-wr703n
 endef
 TARGET_DEVICES += tplink_tl-wr703n
 
@@ -82,7 +76,6 @@ define Device/tplink_tl-wr740nd-v4
   ATH_SOC := ar9331
   DEVICE_TITLE := TP-LINK TL-WR740N/ND v4
   TPLINK_HWID := 0x07400004
-  SUPPORTED_DEVICES += tl-wr740n-v4
 endef
 TARGET_DEVICES += tplink_tl-wr740nd-v4
 
@@ -99,7 +92,6 @@ define Device/tplink_tl-wr741nd-v4
   ATH_SOC := ar9331
   DEVICE_TITLE := TP-LINK TL-WR741N/ND v4
   TPLINK_HWID := 0x07410004
-  SUPPORTED_DEVICES += tl-wr741n-v4
 endef
 TARGET_DEVICES += tplink_tl-wr741nd-v4
 
@@ -124,7 +116,6 @@ define Device/tplink_tl-wr841-v7
   ATH_SOC := ar7241
   DEVICE_TITLE := TP-LINK TL-WR841N/ND v7
   TPLINK_HWID := 0x08410007
-  SUPPORTED_DEVICES += tl-wr841-v7
 endef
 TARGET_DEVICES += tplink_tl-wr841-v7
 
-- 
2.17.1


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



More information about the openwrt-devel mailing list