X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/429edf765e26257c39e4ecc8a6a50c3fbd4cc9f7..5e670215a9f99612d222307fcaa855f275661373:/target/linux/x86/image/Makefile diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile index 185da1096..26e34ff6d 100644 --- a/target/linux/x86/image/Makefile +++ b/target/linux/x86/image/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2010 OpenWrt.org +# Copyright (C) 2006-2012 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -167,6 +167,28 @@ ifneq ($(CONFIG_X86_VMDK_IMAGES),) endef endif +define Image/Build/gzip + gzip -f9 $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img + gzip -f9 $(BIN_DIR)/$(IMG_PREFIX)-rootfs-$(1).img +endef + +ifneq ($(CONFIG_TARGET_IMAGES_GZIP),) + define Image/Build/gzip/ext4 + $(call Image/Build/gzip,ext4) + endef + ifneq ($(CONFIG_TARGET_IMAGES_PAD),) + define Image/Build/gzip/squashfs + $(call Image/Build/gzip,squashfs) + endef + define Image/Build/gzip/jffs2-64k + $(call Image/Build/gzip,jffs2-64k) + endef + define Image/Build/gzip/jffs2-128k + $(call Image/Build/gzip,jffs2-128k) + endef + endif +endif + define Image/BuildKernel $(CP) $(KDIR)/bzImage $(BIN_DIR)/$(IMG_PREFIX)-vmlinuz ifneq ($(CONFIG_X86_ETHERBOOT_IMAGES),) @@ -194,10 +216,7 @@ define Image/Build endif $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-rootfs-$(1).img $(CP) $(KDIR)/bzImage $(BIN_DIR)/$(IMG_PREFIX)-vmlinuz - ifneq (,$findstring($(1),ext4 jffs2)) - gzip -f9 $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img - gzip -f9 $(BIN_DIR)/$(IMG_PREFIX)-rootfs-$(1).img - endif + $(call Image/Build/gzip/$(1)) endef $(eval $(call BuildImage))