aboutsummaryrefslogtreecommitdiffstats
path: root/include
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 /include
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 'include')
-rw-r--r--include/image-commands.mk10
1 files changed, 10 insertions, 0 deletions
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)) && \