diff --git a/build_patches/openwrt/0009-ar71xx-image-simplify-TP-Link-devices-definitions.patch b/build_patches/openwrt/0009-ar71xx-image-simplify-TP-Link-devices-definitions.patch
new file mode 100644
index 0000000..eea18a0
--- /dev/null
+++ b/build_patches/openwrt/0009-ar71xx-image-simplify-TP-Link-devices-definitions.patch
@@ -0,0 +1,306 @@
+From b45344ff33b73b42a00ed1b94ae8c99447b6bf32 Mon Sep 17 00:00:00 2001
+From: Adrian Schmutzler <freifunk@adrianschmutzler.de>
+Date: Sat, 18 Nov 2017 13:59:35 +0100
+Subject: [PATCH 1/5] ar71xx: image: simplify TP-Link devices definitions
+
+Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
+
+Adjusted to branch lede-17.01 (manually!):
+
+Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
+---
+ target/linux/ar71xx/image/tp-link.mk | 108 ++++++++++-------------------------
+ 1 file changed, 30 insertions(+), 78 deletions(-)
+
+diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk
+index 32d16f9..e98a012 100644
+--- a/target/linux/ar71xx/image/tp-link.mk
++++ b/target/linux/ar71xx/image/tp-link.mk
+@@ -103,7 +103,15 @@ $(Device/tplink)
+   IMAGE_SIZE := 15872k
+ endef
+ 
++define Device/archer-cxx
++  KERNEL := kernel-bin | patch-cmdline | lzma | uImageArcher lzma
++  IMAGES := sysupgrade.bin factory.bin
++  IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade
++  IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
++endef
++
+ define Device/archer-c25-v1
++  $(Device/archer-cxx)
+   DEVICE_TITLE := TP-LINK Archer C25 v1
+   DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9887
+   BOARDNAME := ARCHER-C25-V1
+@@ -111,10 +119,6 @@ define Device/archer-c25-v1
+   DEVICE_PROFILE := ARCHERC25V1
+   IMAGE_SIZE := 7808k
+   LOADER_TYPE := elf
+-  KERNEL := kernel-bin | patch-cmdline | lzma | uImageArcher lzma
+-  IMAGES := sysupgrade.bin factory.bin
+-  IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade
+-  IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
+   MTDPARTS := spi0.0:128k(factory-uboot)ro,64k(u-boot)ro,1536k(kernel),6272k(rootfs),128k(config)ro,64k(art)ro,7808k@0x30000(firmware)
+ endef
+ TARGET_DEVICES += archer-c25-v1
+@@ -137,7 +141,6 @@ endef
+ define Device/cpe210-220
+ $(Device/cpe510-520)
+   DEVICE_TITLE := TP-LINK CPE210/220
+-  DEVICE_PACKAGES := rssileds
+   BOARDNAME := CPE210
+   TPLINK_BOARD_NAME := CPE210
+ endef
+@@ -145,7 +148,6 @@ endef
+ define Device/wbs210
+ $(Device/cpe510-520)
+   DEVICE_TITLE := TP-LINK WBS210
+-  DEVICE_PACKAGES := rssileds
+   BOARDNAME := WBS210
+   TPLINK_BOARD_NAME := WBS210
+ endef
+@@ -153,7 +155,6 @@ endef
+ define Device/wbs510
+ $(Device/cpe510-520)
+   DEVICE_TITLE := TP-LINK WBS510
+-  DEVICE_PACKAGES := rssileds
+   BOARDNAME := WBS510
+   TPLINK_BOARD_NAME := WBS510
+ endef
+@@ -190,16 +191,6 @@ define Device/eap120
+ endef
+ TARGET_DEVICES += eap120
+ 
+-define Device/tl-wdr4300-v1
+-$(Device/tplink-8mlzma)
+-  DEVICE_TITLE := TP-LINK TL-WDR4300 v1
+-  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
+-  BOARDNAME := TL-WDR4300
+-  DEVICE_PROFILE := TLWDR4300
+-  TPLINK_HWID := 0x43000001
+-  IMAGE/factory.bin := append-rootfs | mktplinkfw factory -C US
+-endef
+-
+ define Device/tl-wdr3500-v1
+ $(Device/tplink-8mlzma)
+   DEVICE_TITLE := TP-LINK TL-WDR3500 v1
+@@ -210,30 +201,29 @@ $(Device/tplink-8mlzma)
+ endef
+ 
+ define Device/tl-wdr3600-v1
+-$(Device/tplink-8mlzma)
++$(Device/tl-wdr3500-v1)
+   DEVICE_TITLE := TP-LINK TL-WDR3600 v1
+-  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
+   BOARDNAME := TL-WDR4300
+-  DEVICE_PROFILE := TLWDR4300
+   TPLINK_HWID := 0x36000001
+   IMAGE/factory.bin := append-rootfs | mktplinkfw factory -C US
+ endef
+ 
++define Device/tl-wdr4300-v1
++$(Device/tl-wdr3600-v1)
++  DEVICE_TITLE := TP-LINK TL-WDR4300 v1
++  TPLINK_HWID := 0x43000001
++endef
++
+ define Device/tl-wdr4300-v1-il
+-$(Device/tplink-8mlzma)
++$(Device/tl-wdr3500-v1)
+   DEVICE_TITLE := TP-LINK TL-WDR4300 v1 IL
+-  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
+   BOARDNAME := TL-WDR4300
+-  DEVICE_PROFILE := TLWDR4300
+   TPLINK_HWID := 0x43008001
+ endef
+ 
+ define Device/tl-wdr4310-v1
+-$(Device/tplink-8mlzma)
++$(Device/tl-wdr4300-v1-il)
+   DEVICE_TITLE := TP-LINK TL-WDR4310 v1
+-  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
+-  BOARDNAME := TL-WDR4300
+-  DEVICE_PROFILE = TLWDR4300
+   TPLINK_HWID := 0x43100001
+ endef
+ 
+@@ -339,13 +329,9 @@ define Device/tl-mr11u-v1
+ endef
+ 
+ define Device/tl-mr11u-v2
+-    $(Device/tplink-4mlzma)
++    $(Device/tl-mr11u-v1)
+     DEVICE_TITLE := TP-LINK TL-MR11U v2
+-    DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
+-    BOARDNAME := TL-MR11U
+-    DEVICE_PROFILE := TLMR11U
+     TPLINK_HWID := 0x00110102
+-    CONSOLE := ttyATH0,115200
+ endef
+ 
+ define Device/tl-mr12u-v1
+@@ -359,13 +345,10 @@ define Device/tl-mr12u-v1
+ endef
+ 
+ define Device/tl-mr13u-v1
+-    $(Device/tplink-4mlzma)
++    $(Device/tl-mr12u-v1)
+     DEVICE_TITLE := TP-LINK TL-MR13U
+-    DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
+-    BOARDNAME := TL-MR13U
+     DEVICE_PROFILE := TLMR13U
+     TPLINK_HWID := 0x00130101
+-    CONSOLE := ttyATH0,115200
+ endef
+ TARGET_DEVICES += tl-mr10u-v1 tl-mr11u-v1 tl-mr11u-v2 tl-mr12u-v1 tl-mr13u-v1
+ 
+@@ -380,23 +363,18 @@ define Device/tl-mr3020-v1
+ endef
+ 
+ define Device/tl-mr3040-v1
+-    $(Device/tplink-4mlzma)
++    $(Device/tl-mr3020-v1)
+     DEVICE_TITLE := TP-LINK TL-MR3040
+-    DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
+     BOARDNAME := TL-MR3040
+     DEVICE_PROFILE := TLMR3040
+     TPLINK_HWID := 0x30400001
+-    CONSOLE := ttyATH0,115200
+ endef
+ 
+ define Device/tl-mr3040-v2
+-    $(Device/tplink-4mlzma)
++    $(Device/tl-mr3040-v1)
+     DEVICE_TITLE := TP-LINK TL-MR3040
+-    DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
+     BOARDNAME := TL-MR3040-v2
+-    DEVICE_PROFILE := TLMR3040
+     TPLINK_HWID := 0x30400002
+-    CONSOLE := ttyATH0,115200
+ endef
+ 
+ define Device/tl-mr3220-v1
+@@ -500,13 +478,9 @@ define Device/tl-wr720n-v3
+ endef
+ 
+ define Device/tl-wr720n-v4
+-    $(Device/tplink-4mlzma)
++    $(Device/tl-wr720n-v3)
+     DEVICE_TITLE := TP-LINK TL-WR720N v4
+-    DEVICE_PACKAGES := kmod-usb-core kmod-usb2
+-    BOARDNAME := TL-WR720N-v3
+-    DEVICE_PROFILE := TLWR720
+     TPLINK_HWID := 0x07200104
+-    CONSOLE := ttyATH0,115200
+ endef
+ TARGET_DEVICES += tl-wr703n-v1 tl-wr710n-v1 tl-wr710n-v2 tl-wr710n-v2.1 tl-wr720n-v3 tl-wr720n-v4
+ 
+@@ -519,10 +493,8 @@ define Device/tl-wr740n-v1
+ endef
+ 
+ define Device/tl-wr740n-v3
+-    $(Device/tplink-4m)
++    $(Device/tl-wr740n-v1)
+     DEVICE_TITLE := TP-LINK TL-WR740N/ND v3
+-    BOARDNAME := TL-WR741ND
+-    DEVICE_PROFILE := TLWR740
+     TPLINK_HWID := 0x07400003
+ endef
+ 
+@@ -536,12 +508,9 @@ define Device/tl-wr740n-v4
+ endef
+ 
+ define Device/tl-wr740n-v5
+-    $(Device/tplink-4mlzma)
++    $(Device/tl-wr740n-v4)
+     DEVICE_TITLE := TP-LINK TL-WR740N/ND v5
+-    BOARDNAME := TL-WR741ND-v4
+-    DEVICE_PROFILE := TLWR740
+     TPLINK_HWID := 0x07400005
+-    CONSOLE := ttyATH0,115200
+ endef
+ 
+ define Device/tl-wr740n-v6
+@@ -561,11 +530,8 @@ define Device/tl-wr741nd-v1
+ endef
+ 
+ define Device/tl-wr741nd-v2
+-    $(Device/tplink-4m)
++    $(Device/tl-wr741nd-v1)
+     DEVICE_TITLE := TP-LINK TL-WR741N/ND v2
+-    BOARDNAME := TL-WR741ND
+-    DEVICE_PROFILE := TLWR741
+-    TPLINK_HWID := 0x07410001
+ endef
+ 
+ define Device/tl-wr741nd-v4
+@@ -578,12 +544,9 @@ define Device/tl-wr741nd-v4
+ endef
+ 
+ define Device/tl-wr741nd-v5
+-    $(Device/tplink-4mlzma)
++    $(Device/tl-wr741nd-v4)
+     DEVICE_TITLE := TP-LINK TL-WR741N/ND v5
+-    BOARDNAME := TL-WR741ND-v4
+-    DEVICE_PROFILE := TLWR741
+     TPLINK_HWID := 0x07400005
+-    CONSOLE := ttyATH0,115200
+ endef
+ 
+ define Device/tl-wr810n
+@@ -605,12 +568,10 @@ define Device/tl-wr743nd-v1
+ endef
+ 
+ define Device/tl-wr743nd-v2
+-    $(Device/tplink-4mlzma)
++    $(Device/tl-wr741nd-v4)
+     DEVICE_TITLE := TP-LINK TL-WR743N/ND v2
+-    BOARDNAME := TL-WR741ND-v4
+     DEVICE_PROFILE := TLWR743
+     TPLINK_HWID := 0x07430002
+-    CONSOLE := ttyATH0,115200
+ endef
+ TARGET_DEVICES += tl-wr740n-v1 tl-wr740n-v3 tl-wr740n-v4 tl-wr740n-v5 tl-wr740n-v6 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr741nd-v5 tl-wr743nd-v1 tl-wr743nd-v2
+ 
+@@ -675,10 +636,8 @@ define Device/tl-wr841-v9
+ endef
+ 
+ define Device/tl-wr841-v10
+-    $(Device/tplink-4mlzma)
++    $(Device/tl-wr841-v9)
+     DEVICE_TITLE := TP-LINK TL-WR841N/ND v10
+-    BOARDNAME := TL-WR841N-v9
+-    DEVICE_PROFILE := TLWR841
+     TPLINK_HWID := 0x08410010
+ endef
+ 
+@@ -753,12 +712,8 @@ define Device/tl-wr941nd-v2
+ endef
+ 
+ define Device/tl-wr941nd-v3
+-    $(Device/tplink-4m)
++    $(Device/tl-wr941nd-v2)
+     DEVICE_TITLE := TP-LINK TL-WR941N/ND v3
+-    BOARDNAME := TL-WR941ND
+-    DEVICE_PROFILE := TLWR941
+-    TPLINK_HWID := 0x09410002
+-    TPLINK_HWREV := 2
+ endef
+ 
+ define Device/tl-wr941nd-v4
+@@ -834,11 +789,8 @@ define Device/tl-wr1043nd-v2
+ endef
+ 
+ define Device/tl-wr1043nd-v3
+-    $(Device/tplink-8mlzma)
++    $(Device/tl-wr1043nd-v2)
+     DEVICE_TITLE := TP-LINK TL-WR1043N/ND v3
+-    DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
+-    BOARDNAME := TL-WR1043ND-v2
+-    DEVICE_PROFILE := TLWR1043
+     TPLINK_HWID := 0x10430003
+ endef
+ 
+-- 
+2.7.4
+
diff --git a/build_patches/openwrt/0010-ar71xx-add-metadata-to-some-TP-Link-images.patch b/build_patches/openwrt/0010-ar71xx-add-metadata-to-some-TP-Link-images.patch
new file mode 100644
index 0000000..22fa65c
--- /dev/null
+++ b/build_patches/openwrt/0010-ar71xx-add-metadata-to-some-TP-Link-images.patch
@@ -0,0 +1,38 @@
+From 3e6ea8b6fd13e07cae9b6c52d182eaf59d32a9c1 Mon Sep 17 00:00:00 2001
+From: Henryk Heisig <hyniu@o2.pl>
+Date: Sat, 1 Jul 2017 00:28:39 +0200
+Subject: [PATCH 2/5] ar71xx: add metadata to some TP-Link images
+
+This commit adds metadata to TP-Link sysupgrade images
+created by tplink-safeloader with uImage kernel header.
+
+Signed-off-by: Henryk Heisig <hyniu@o2.pl>
+---
+ target/linux/ar71xx/image/tp-link.mk | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk
+index e98a012..04d2fa4 100644
+--- a/target/linux/ar71xx/image/tp-link.mk
++++ b/target/linux/ar71xx/image/tp-link.mk
+@@ -106,7 +106,8 @@ endef
+ define Device/archer-cxx
+   KERNEL := kernel-bin | patch-cmdline | lzma | uImageArcher lzma
+   IMAGES := sysupgrade.bin factory.bin
+-  IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade
++  IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \
++	append-metadata | check-size $$$$(IMAGE_SIZE)
+   IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
+ endef
+ 
+@@ -120,6 +121,7 @@ define Device/archer-c25-v1
+   IMAGE_SIZE := 7808k
+   LOADER_TYPE := elf
+   MTDPARTS := spi0.0:128k(factory-uboot)ro,64k(u-boot)ro,1536k(kernel),6272k(rootfs),128k(config)ro,64k(art)ro,7808k@0x30000(firmware)
++  SUPPORTED_DEVICES := archer-c25-v1
+ endef
+ TARGET_DEVICES += archer-c25-v1
+ 
+-- 
+2.7.4
+
diff --git a/build_patches/openwrt/0011-firmware-utils-mktplinkfw-rework-combined-image-opti.patch b/build_patches/openwrt/0011-firmware-utils-mktplinkfw-rework-combined-image-opti.patch
index ee54c85..eedf9d1 100644
--- a/build_patches/openwrt/0011-firmware-utils-mktplinkfw-rework-combined-image-opti.patch
+++ b/build_patches/openwrt/0011-firmware-utils-mktplinkfw-rework-combined-image-opti.patch
@@ -37,7 +37,7 @@ Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
  2 files changed, 44 insertions(+), 62 deletions(-)
 
 diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk
-index 32d16f9..2557858 100644
+index 04d2fa4..d334120 100644
 --- a/target/linux/ar71xx/image/tp-link.mk
 +++ b/target/linux/ar71xx/image/tp-link.mk
 @@ -26,11 +26,11 @@ endef
@@ -55,7 +55,7 @@ index 32d16f9..2557858 100644
  		-c
  	@mv $@.new $@
  endef
-@@ -849,7 +849,6 @@ define Device/tl-wr1043nd-v4
+@@ -803,7 +803,6 @@ define Device/tl-wr1043nd-v4
      BOARDNAME := TL-WR1043ND-v4
      DEVICE_PROFILE := TLWR1043
      TPLINK_HWID :=  0x10430004
diff --git a/build_patches/openwrt/0012-build-move-mktplinkfw-combined-command-to-image-comm.patch b/build_patches/openwrt/0012-build-move-mktplinkfw-combined-command-to-image-comm.patch
index 4c29e3b..f8f7c7c 100644
--- a/build_patches/openwrt/0012-build-move-mktplinkfw-combined-command-to-image-comm.patch
+++ b/build_patches/openwrt/0012-build-move-mktplinkfw-combined-command-to-image-comm.patch
@@ -38,7 +38,7 @@ index 04fa853..9e56ab8 100644
  	sh $(TOPDIR)/scripts/sysupgrade-tar.sh \
  		--board $(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \
 diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk
-index 2557858..685b09e 100644
+index d334120..11da6d1 100644
 --- a/target/linux/ar71xx/image/tp-link.mk
 +++ b/target/linux/ar71xx/image/tp-link.mk
 @@ -21,20 +21,6 @@ define Build/mktplinkfw
@@ -80,7 +80,7 @@ index 2557858..685b09e 100644
  endef
  
  define Device/tplink-4m
-@@ -249,7 +235,7 @@ $(Device/tplink-8mlzma)
+@@ -241,7 +227,7 @@ $(Device/tplink-8mlzma)
    DEVICE_TITLE := TP-LINK TL-WDR6500v2
    DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x
    KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma
@@ -89,7 +89,7 @@ index 2557858..685b09e 100644
    BOARDNAME = TL-WDR6500-v2
    DEVICE_PROFILE = TLWDR6500V2
    TPLINK_HWID := 0x65000002
-@@ -852,7 +838,7 @@ define Device/tl-wr1043nd-v4
+@@ -806,7 +792,7 @@ define Device/tl-wr1043nd-v4
      MTDPARTS := spi0.0:128k(u-boot)ro,1536k(kernel),14016k(rootfs),128k(product-info)ro,320k(config)ro,64k(partition-table)ro,128k(logs)ro,64k(ART)ro,15552k@0x20000(firmware)
      IMAGE_SIZE := 15552k
      TPLINK_BOARD_NAME := TLWR1043NDV4
