aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorMathias Kresin <dev@kresin.me>2019-01-12 20:18:52 +0100
committerMathias Kresin <dev@kresin.me>2019-01-15 19:11:54 +0100
commit26a016731d1fc1e2bd6b5f8d3af0fdbd631363ff (patch)
treeeb705752de643f8761b500a97bb1e725240ff65b /target/linux
parent18c9faa03211e29252413671610a93c00dcc7ad1 (diff)
downloadupstream-26a016731d1fc1e2bd6b5f8d3af0fdbd631363ff.tar.gz
upstream-26a016731d1fc1e2bd6b5f8d3af0fdbd631363ff.tar.bz2
upstream-26a016731d1fc1e2bd6b5f8d3af0fdbd631363ff.zip
firmware-utils: mksercommfw: overhaul image creation
Move the zip compression into a build recipe. Pad the image using the existing build recipes as well to remove duplicate functionality Change the code to append header and footer in two steps. Allow to use a fixed filename as the netgear update image does. Use a fixed timestamp within the zip archive to make the images reproducible. Due to the changes we are now compatible to the gnu89 c standard used by default on the buildbots and we don't need to force a more recent standard anymore. Beside all changes, the footer still looks wrong in compare to the netgear update image. Signed-off-by: Mathias Kresin <dev@kresin.me>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/ramips/image/mt76x8.mk23
1 files changed, 14 insertions, 9 deletions
diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk
index 3a2d8e3a5e..be3aeb1093 100644
--- a/target/linux/ramips/image/mt76x8.mk
+++ b/target/linux/ramips/image/mt76x8.mk
@@ -2,17 +2,22 @@
# MT76x8 Profiles
#
-DEVICE_VARS += SERCOMM_KERNEL_OFFSET SERCOMM_HWID SERCOMM_HWVER SERCOMM_SWVER
+DEVICE_VARS += SERCOMM_HWID SERCOMM_HWVER SERCOMM_SWVER
-define Build/mksercommfw
+define Build/sercom-seal
$(STAGING_DIR_HOST)/bin/mksercommfw \
- $@ \
- $(SERCOMM_KERNEL_OFFSET) \
- $(SERCOMM_HWID) \
- $(SERCOMM_HWVER) \
- $(SERCOMM_SWVER)
+ -i $@ \
+ -b $(SERCOMM_HWID) \
+ -r $(SERCOMM_HWVER) \
+ -v $(SERCOMM_SWVER) \
+ $(1)
endef
+define Build/sercom-footer
+ $(call Build/sercom-seal,-f)
+endef
+
+
define Device/tplink
TPLINK_FLASHLAYOUT :=
TPLINK_HWID :=
@@ -116,14 +121,14 @@ define Device/netgear_r6120
IMAGE_SIZE := $(ralink_default_fw_size_16M)
DEVICE_TITLE := Netgear AC1200 R6120
DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci
- SERCOMM_KERNEL_OFFSET := 0x90000
SERCOMM_HWID := CGQ
SERCOMM_HWVER := A001
SERCOMM_SWVER := 0x0040
IMAGES += factory.img
IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE)| append-rootfs | pad-rootfs
IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | check-size $$$$(IMAGE_SIZE)
- IMAGE/factory.img := $$(IMAGE/default) | mksercommfw
+ IMAGE/factory.img := pad-extra 576k | $$(IMAGE/default) | \
+ sercom-footer | pad-to 128 | zip R6120.bin | sercom-seal
endef
TARGET_DEVICES += netgear_r6120