diff mbox series

[OpenWrt-Devel,3/5] build: image: Add variable for gzip-ext4-padded-squashfs

Message ID 1553868440-26476-4-git-send-email-ynezz@true.cz
State Changes Requested
Headers show
Series x86: Fix small disk space in squashfs overlay | expand

Commit Message

Petr Štetiar March 29, 2019, 2:07 p.m. UTC
This common code could be shared by at least 3 targets (malta, armvirt
and x86) so let's factor it out to separate variable.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
---
 include/image.mk | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
diff mbox series

Patch

diff --git a/include/image.mk b/include/image.mk
index 8b84c8c..7eb7f23 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -300,6 +300,27 @@  define Image/Manifest
 		$(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest
 endef
 
+define Image/gzip-ext4-padded-squashfs
+
+  define Image/Build/squashfs
+    $(call Image/pad-root-squashfs)
+  endef
+
+  define Image/Build/gzip
+    gzip -f9n $(BIN_DIR)/$(IMG_ROOTFS)-$(1).img
+  endef
+
+  ifneq ($(CONFIG_TARGET_IMAGES_GZIP),)
+    define Image/Build/gzip/ext4
+	$(call Image/Build/gzip,ext4)
+    endef
+    define Image/Build/gzip/squashfs
+	$(call Image/Build/gzip,squashfs)
+    endef
+  endif
+
+endef
+
 ifdef CONFIG_TARGET_ROOTFS_TARGZ
   define Image/Build/targz
 	$(TAR) -cp --numeric-owner --owner=0 --group=0 --sort=name \