From 26a016731d1fc1e2bd6b5f8d3af0fdbd631363ff Mon Sep 17 00:00:00 2001 From: Mathias Kresin Date: Sat, 12 Jan 2019 20:18:52 +0100 Subject: 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 --- target/linux/ramips/image/mt76x8.mk | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'target/linux') 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 -- cgit v1.2.3