image.mk: add generic function for gzipping images if enabled
authorFelix Fietkau <nbd@nbd.name>
Fri, 13 Jan 2017 15:19:00 +0000 (16:19 +0100)
committerFelix Fietkau <nbd@nbd.name>
Fri, 13 Jan 2017 15:59:28 +0000 (16:59 +0100)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
include/image.mk

index 4bd923fea82cda7c9eed3309a4949dcf76a58a11..81519cd1834907c83f19e123aa0282768c91dd84 100644 (file)
@@ -147,6 +147,13 @@ define Image/BuildKernel/MkFIT
        PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/fit-$(1).its $(KDIR)/fit-$(1)$(7).itb
 endef
 
+ifdef CONFIG_TARGET_IMAGES_GZIP
+  define Image/Gzip
+       rm -f $(1).gz
+       gzip -9n $(1)
+  endef
+endif
+
 # $(1) source dts file
 # $(2) target dtb file
 # $(3) extra CPP flags