[source] ramips: append metadata to images

LEDE Commits lede-commits at lists.infradead.org
Sat Nov 19 02:26:57 PST 2016


nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/478f1f6b167c6b1c91f5915e9567814350865c4c

commit 478f1f6b167c6b1c91f5915e9567814350865c4c
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Nov 17 13:02:26 2016 +0100

    ramips: append metadata to images
    
    metadata checks are not enforced yet, because some images are still
    being built by legacy code
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/ramips/image/Makefile  |  4 +++-
 target/linux/ramips/image/mt7620.mk | 18 ++++++++++--------
 target/linux/ramips/image/mt7621.mk |  8 ++++----
 target/linux/ramips/image/mt7688.mk |  1 +
 target/linux/ramips/image/rt288x.mk |  4 ++--
 target/linux/ramips/image/rt305x.mk |  6 ++++++
 target/linux/ramips/image/rt3883.mk | 14 +++++++-------
 7 files changed, 33 insertions(+), 22 deletions(-)

diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index ea7ff7e..42cd63b 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -37,7 +37,9 @@ define Device/Default
   KERNEL := $(KERNEL_DTB) | uImage lzma
   IMAGES := sysupgrade.bin
   IMAGE_SIZE := $(ralink_default_fw_size_8M)
-  IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
+  SUPPORTED_DEVICES = $(1)
+  sysupgrade_bin := append-kernel | append-rootfs | pad-rootfs
+  IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
 endef
 
 define Build/patch-dtb
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index e669b8c..f03c803 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -45,7 +45,7 @@ define Device/ArcherC20i
   DTS := ArcherC20i
   KERNEL := $(KERNEL_DTB)
   KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-header ArcherC20i -c
-  IMAGE/sysupgrade.bin := append-kernel | tplink-header ArcherC20i -j -r $(KDIR)/root.squashfs
+  IMAGE/sysupgrade.bin := append-kernel | tplink-header ArcherC20i -j -r $(KDIR)/root.squashfs | append-metadata
   DEVICE_TITLE := TP-Link ArcherC20i
 endef
 TARGET_DEVICES += ArcherC20i
@@ -54,7 +54,7 @@ define Device/ArcherC50
   DTS := ArcherC50
   KERNEL := $(KERNEL_DTB)
   KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-header ArcherC50 -c
-  IMAGE/sysupgrade.bin := append-kernel | tplink-header ArcherC50 -j -r $(KDIR)/root.squashfs
+  IMAGE/sysupgrade.bin := append-kernel | tplink-header ArcherC50 -j -r $(KDIR)/root.squashfs | append-metadata
   DEVICE_TITLE := TP-Link ArcherC50
 endef
 TARGET_DEVICES += ArcherC50
@@ -65,7 +65,7 @@ define Device/ex2700
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   IMAGES += factory.bin
   KERNEL := $(KERNEL_DTB) | uImage lzma | pad-kernel-ex2700
-  IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | netgear-header -B EX2700 -H 29764623+4+0+32+2x2+0
+  IMAGE/factory.bin := $$(sysupgrade_bin) | netgear-header -B EX2700 -H 29764623+4+0+32+2x2+0
   DEVICE_TITLE := Netgear EX2700
 endef
 TARGET_DEVICES += ex2700
@@ -75,7 +75,8 @@ define Device/wt3020-4M
   BLOCKSIZE := 4k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   IMAGES += factory.bin
-  IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | poray-header -B WT3020 -F 4M
+  SUPPORTED_DEVICES := wt3020
+  IMAGE/factory.bin := $$(sysupgrade_bin) | poray-header -B WT3020 -F 4M
   DEVICE_TITLE := Nexx WT3020 (4MB)
 endef
 TARGET_DEVICES += wt3020-4M
@@ -83,7 +84,8 @@ TARGET_DEVICES += wt3020-4M
 define Device/wt3020-8M
   DTS := WT3020-8M
   IMAGES += factory.bin
-  IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | poray-header -B WT3020 -F 8M
+  SUPPORTED_DEVICES := wt3020
+  IMAGE/factory.bin := $$(sysupgrade_bin) | poray-header -B WT3020 -F 8M
   DEVICE_TITLE := Nexx WT3020 (8MB)
 endef
 TARGET_DEVICES += wt3020-8M
@@ -92,7 +94,7 @@ define Device/wrh-300cr
   DTS := WRH-300CR
   IMAGE_SIZE := $(ralink_default_fw_size_16M)
   IMAGES += factory.bin
-  IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | elecom-header
+  IMAGE/factory.bin := $$(sysupgrade_bin) | elecom-header
   DEVICE_TITLE := Elecom WRH-300CR 
   DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci
 endef
@@ -101,7 +103,7 @@ TARGET_DEVICES += wrh-300cr
 define Device/e1700
   DTS := E1700
   IMAGES += factory.bin
-  IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | umedia-header 0x013326
+  IMAGE/factory.bin := $$(sysupgrade_bin) | umedia-header 0x013326
   DEVICE_TITLE := Linksys E1700
 endef
 TARGET_DEVICES += e1700
@@ -411,7 +413,7 @@ define Device/dch-m225
   IMAGE/sysupgrade.bin := \
 	append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \
 	seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
-	pad-rootfs | check-size $$$$(IMAGE_SIZE)
+	pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
   IMAGE/factory.bin := \
 	append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
 	append-rootfs | pad-rootfs -x 64 | \
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 04b06ec..647df7a 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -49,7 +49,7 @@ TARGET_DEVICES += re6500
 
 define Device/wsr-1166
   DTS := WSR-1166
-  IMAGE/sysupgrade.bin := trx | pad-rootfs
+  IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata
   IMAGE_SIZE := $(ralink_default_fw_size_16M)
   DEVICE_TITLE := Buffalo WSR-1166
 endef
@@ -64,7 +64,7 @@ define Device/dir-860l-b1
   IMAGE/sysupgrade.bin := \
 	append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \
 	seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
-	pad-rootfs | check-size $$$$(IMAGE_SIZE)
+	pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
   IMAGE/factory.bin := \
 	append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
 	append-rootfs | pad-rootfs -x 64 | \
@@ -164,7 +164,7 @@ define Device/wf-2881
   IMAGE_SIZE := 129280k
   KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma
   UBINIZE_OPTS := -E 5
-  IMAGE/sysupgrade.bin := append-kernel | append-ubi | check-size $$$$(IMAGE_SIZE)
+  IMAGE/sysupgrade.bin := append-kernel | append-ubi | append-metadata | check-size $$$$(IMAGE_SIZE)
   DEVICE_TITLE := NETIS WF-2881
   DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport
 endef
@@ -177,7 +177,7 @@ define Device/ubnt-erx
   KERNEL := $(KERNEL_DTB) | uImage lzma
   IMAGES := sysupgrade.tar
   KERNEL_INITRAMFS := $$(KERNEL) | ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
-  IMAGE/sysupgrade.tar := sysupgrade-tar
+  IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
   DEVICE_TITLE := Ubiquiti EdgeRouter X
   DEVICE_PACKAGES := -kmod-mt76 -kmod-rt2x00-lib -kmod-mac80211 -kmod-cfg80211 -wpad-mini -iwinfo
 endef
diff --git a/target/linux/ramips/image/mt7688.mk b/target/linux/ramips/image/mt7688.mk
index 406af69..f117102 100644
--- a/target/linux/ramips/image/mt7688.mk
+++ b/target/linux/ramips/image/mt7688.mk
@@ -5,6 +5,7 @@
 define Device/LinkIt7688
   DTS := LINKIT7688
   IMAGE_SIZE := $(ralink_default_fw_size_32M)
+  SUPPORTED_DEVICES := linkits7688 linkits7688d
   DEVICE_TITLE := MediaTek LinkIt Smart 7688
   DEVICE_PACKAGES:= kmod-usb2 kmod-usb-ohci uboot-envtools
 endef
diff --git a/target/linux/ramips/image/rt288x.mk b/target/linux/ramips/image/rt288x.mk
index 7e7652e..d9dd3ae 100644
--- a/target/linux/ramips/image/rt288x.mk
+++ b/target/linux/ramips/image/rt288x.mk
@@ -20,7 +20,7 @@ define Device/ar670w
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   KERNEL := $(KERNEL_DTB)
   IMAGES += factory.bin
-  IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | gemtek-header ar725w
+  IMAGE/factory.bin := $$(sysupgrade_bin) | gemtek-header ar725w
 endef
 TARGET_DEVICES += ar670w
 
@@ -28,7 +28,7 @@ define Device/ar725w
   DTS := AR725W
   DEVICE_TITLE := Gemtek AR725W
   IMAGES += factory.bin
-  IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | gemtek-header ar725w
+  IMAGE/factory.bin := $$(sysupgrade_bin) | gemtek-header ar725w
 endef
 TARGET_DEVICES += ar725w
 
diff --git a/target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk
index 6bb9351..8f2157c 100644
--- a/target/linux/ramips/image/rt305x.mk
+++ b/target/linux/ramips/image/rt305x.mk
@@ -5,6 +5,7 @@
 define Device/asl26555-8M
   DTS := ASL26555-8M
   IMAGE_SIZE := 7744k
+  SUPPORTED_DEVICES := asl26555
   DEVICE_TITLE := Alpha ASL26555 
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb-ledtrig-usbport
 endef
@@ -14,6 +15,7 @@ TARGET_DEVICES += asl26555-8M
 define Device/asl26555-16M
   DTS := ASL26555-16M
   IMAGE_SIZE := 15872k
+  SUPPORTED_DEVICES := asl26555
   DEVICE_TITLE := Alpha ASL26555 16M
   DEVICE_PACKAGES :=
 endef
@@ -23,6 +25,7 @@ TARGET_DEVICES += asl26555-16M
 define Device/nixcore-8M
   DTS := NIXCORE-8M
   IMAGE_SIZE := 7872k
+  SUPPORTED_DEVICES := nixcore-x1
   DEVICE_TITLE := NixcoreX1 8M
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-i2c-core kmod-i2c-ralink kmod-spi-dev
 endef
@@ -32,6 +35,7 @@ TARGET_DEVICES += nixcore-8M
 define Device/nixcore-16M
   DTS := NIXCORE-16M
   IMAGE_SIZE := 16064k
+  SUPPORTED_DEVICES := nixcore-x1
   DEVICE_TITLE := NixcoreX1 16M
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-i2c-core kmod-i2c-ralink kmod-spi-dev
 endef
@@ -41,6 +45,7 @@ TARGET_DEVICES += nixcore-16M
 define Device/vocore-8M
   DTS := VOCORE-8M
   IMAGE_SIZE := 7872k
+  SUPPORTED_DEVICES := vocore
   DEVICE_TITLE :=  VoCore 8M
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 \
 		kmod-i2c-core kmod-i2c-ralink \
@@ -52,6 +57,7 @@ TARGET_DEVICES += vocore-8M
 define Device/vocore-16M
   DTS := VOCORE-16M
   IMAGE_SIZE := 16064k
+  SUPPORTED_DEVICES := vocore
   DEVICE_TITLE := VoCore 16M
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 \
 		kmod-i2c-core kmod-i2c-ralink \
diff --git a/target/linux/ramips/image/rt3883.mk b/target/linux/ramips/image/rt3883.mk
index 89b215d..3eac274 100644
--- a/target/linux/ramips/image/rt3883.mk
+++ b/target/linux/ramips/image/rt3883.mk
@@ -7,7 +7,7 @@ define Device/br-6475nd
   BLOCKSIZE := 64k
   IMAGE_SIZE := 7744k
   IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \
-	edimax-header -s CSYS -m RN54 -f 0x70000 -S 0x01100000 | pad-rootfs
+	edimax-header -s CSYS -m RN54 -f 0x70000 -S 0x01100000 | pad-rootfs | append-metadata
   DEVICE_TITLE := Edimax BR-6475nD
   DEVICE_PACKAGES := swconfig
 endef
@@ -21,12 +21,12 @@ define Device/cy-swr1100
   IMAGE/sysupgrade.bin := \
 	append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \
 	seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
-	pad-rootfs | check-size $$$$(IMAGE_SIZE)
+	pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
   IMAGE/factory.bin := \
 	append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
 	append-rootfs | pad-rootfs -x 64 | \
 	seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
-	seama-seal -m "signature=wrgnd10_samsung_ss815" | \
+	seama-seal -m "signature=wrgnd10_samsung_ss815" | append-metadata | \
 	check-size $$$$(IMAGE_SIZE)
   DEVICE_TITLE := Samsung CY-SWR1100
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig
@@ -42,7 +42,7 @@ define Device/dir-645
   IMAGE/sysupgrade.bin := \
 	append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \
 	seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
-	pad-rootfs | check-size $$$$(IMAGE_SIZE)
+	pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
   IMAGE/factory.bin := \
 	append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
 	append-rootfs | pad-rootfs -x 64 | \
@@ -69,7 +69,7 @@ define Device/tew-691gr
   DTS := TEW-691GR
   BLOCKSIZE := 64k
   IMAGES += factory.bin
-  IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | umedia-header 0x026910
+  IMAGE/factory.bin := $$(sysupgrade_bin) | umedia-header 0x026910
   DEVICE_TITLE := TRENDnet TEW-691GR
   DEVICE_PACKAGES := swconfig
 endef
@@ -80,7 +80,7 @@ define Device/tew-692gr
   DTS := TEW-692GR
   BLOCKSIZE := 64k
   IMAGES += factory.bin
-  IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | umedia-header 0x026920
+  IMAGE/factory.bin := $$(sysupgrade_bin) | umedia-header 0x026920
   DEVICE_TITLE := TRENDnet TEW-692GR
   DEVICE_PACKAGES := swconfig
 endef
@@ -93,7 +93,7 @@ define Device/wlr-6000
   IMAGE_SIZE := 7244k
   IMAGES += factory.dlf
   IMAGE/factory.dlf := \
-	$$(IMAGE/sysupgrade.bin) | senao-header -r 0x0202 -p 0x41 -t 2
+	$$(sysupgrade_bin) | senao-header -r 0x0202 -p 0x41 -t 2
   DEVICE_TITLE := Sitecom WLR-6000
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig
 endef



More information about the lede-commits mailing list