[source] ramips: move common tplink image build code into own recipe

LEDE Commits lede-commits at lists.infradead.org
Sat Dec 23 06:37:23 PST 2017


mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/8ca650b8ce22fe2175cf15cfdd0e25206dd77481

commit 8ca650b8ce22fe2175cf15cfdd0e25206dd77481
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sun Dec 17 10:44:41 2017 +0100

    ramips: move common tplink image build code into own recipe
    
    Move common tplink image build code into own recipe. Include the common
    parts instead of including a full build recipe and overwriting former set
    varaibles.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ramips/image/mt76x8.mk | 28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)

diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk
index 7829353..e11a89b 100644
--- a/target/linux/ramips/image/mt76x8.mk
+++ b/target/linux/ramips/image/mt76x8.mk
@@ -2,8 +2,23 @@
 # MT76x8 Profiles
 #
 
+define Device/tplink
+  TPLINK_FLASHLAYOUT :=
+  TPLINK_HWID :=
+  TPLINK_HWREV :=
+  TPLINK_HWREVADD :=
+  TPLINK_HVERSION :=
+  KERNEL := $(KERNEL_DTB)
+  KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header -e
+  IMAGES += tftp-recovery.bin
+  IMAGE/factory.bin := tplink-v2-image -e
+  IMAGE/tftp-recovery.bin := pad-extra 128k | $$(IMAGE/factory.bin)
+  IMAGE/sysupgrade.bin := tplink-v2-image -s -e | append-metadata | \
+	check-size $$$$(IMAGE_SIZE)
+endef
 DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD TPLINK_HVERSION
 
+
 define Device/duzun-dm06
   DTS := DUZUN-DM06
   DEVICE_TITLE := DuZun DM06
@@ -83,6 +98,7 @@ endef
 TARGET_DEVICES += pbr-d1
 
 define Device/tl-wr840n-v4
+  $(Device/tplink)
   DTS := TL-WR840NV4
   IMAGE_SIZE := 7808k
   DEVICE_TITLE := TP-Link TL-WR840N v4
@@ -91,13 +107,6 @@ define Device/tl-wr840n-v4
   TPLINK_HWREV := 0x1
   TPLINK_HWREVADD := 0x4
   TPLINK_HVERSION := 3
-  KERNEL := $(KERNEL_DTB)
-  KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header -e
-  IMAGES += tftp-recovery.bin
-  IMAGE/factory.bin := tplink-v2-image -e
-  IMAGE/tftp-recovery.bin := pad-extra 128k | $$(IMAGE/factory.bin)
-  IMAGE/sysupgrade.bin := tplink-v2-image -s -e | append-metadata | \
-	check-size $$$$(IMAGE_SIZE)
 endef
 TARGET_DEVICES += tl-wr840n-v4
 
@@ -118,12 +127,15 @@ endef
 TARGET_DEVICES += tl-wr840n-v5
 
 define Device/tl-wr841n-v13
-  $(Device/tl-wr840n-v4)
+  $(Device/tplink)
   DTS := TL-WR841NV13
+  IMAGE_SIZE := 7808k
   DEVICE_TITLE := TP-Link TL-WR841N v13
+  TPLINK_FLASHLAYOUT := 8Mmtk
   TPLINK_HWID := 0x08410013
   TPLINK_HWREV := 0x268
   TPLINK_HWREVADD := 0x13
+  TPLINK_HVERSION := 3
 endef
 TARGET_DEVICES += tl-wr841n-v13
 



More information about the lede-commits mailing list