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 --- include/image-commands.mk | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/image-commands.mk') diff --git a/include/image-commands.mk b/include/image-commands.mk index 169c1919e7..70c09ad90c 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -168,6 +168,16 @@ define Build/gzip @mv $@.new $@ endef +define Build/zip + mkdir $@.tmp + mv $@ $@.tmp/$(1) + + zip -j -X \ + $(if $(SOURCE_DATE_EPOCH),--mtime="$(SOURCE_DATE_EPOCH)") \ + $@ $@.tmp/$(if $(1),$(1),$@) + rm -rf $@.tmp +endef + define Build/jffs2 rm -rf $(KDIR_TMP)/$(DEVICE_NAME)/jffs2 && \ mkdir -p $(KDIR_TMP)/$(DEVICE_NAME)/jffs2/$$(dirname $(1)) && \ -- cgit v1.2.3