endchoice
+#
+# Kernel compression format
+#
+
+choice
+ prompt "Kernel compression format"
+ help
+ This selection will just ensure that the correct host tools are build.
+ The actual compression for the kernel should be selected in the
+ kernel configuration menu.
+
+config BR2_LINUX_KERNEL_GZIP
+ bool "gzip compression"
+
+config BR2_LINUX_KERNEL_LZ4
+ bool "lz4 compression"
+
+config BR2_LINUX_KERNEL_LZMA
+ bool "lzma compression"
+
+config BR2_LINUX_KERNEL_LZO
+ bool "lzo compression"
+
+config BR2_LINUX_KERNEL_XZ
+ bool "xz compression"
+
+endchoice
+
config BR2_LINUX_KERNEL_IMAGE_TARGET_NAME
string "Kernel image target name"
depends on BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM
LINUX_PATCH = $(filter ftp://% http://% https://%,$(LINUX_PATCHES))
LINUX_INSTALL_IMAGES = YES
-LINUX_DEPENDENCIES += host-kmod host-lzop
+LINUX_DEPENDENCIES += host-kmod
+
+# host tools needed for kernel compression
+ifeq ($(BR2_LINUX_KERNEL_LZ4),y)
+LINUX_DEPENDENCIES += host-lz4
+else ifeq ($(BR2_LINUX_KERNEL_LZMA),y)
+LINUX_DEPENDENCIES += host-lzma
+else ifeq ($(BR2_LINUX_KERNEL_LZO),y)
+LINUX_DEPENDENCIES += host-lzop
+else ifeq ($(BR2_LINUX_KERNEL_XZ),y)
+LINUX_DEPENDENCIES += host-xz
+endif
+LINUX_COMPRESSION_OPT_$(BR2_LINUX_KERNEL_GZIP) = CONFIG_KERNEL_GZIP
+LINUX_COMPRESSION_OPT_$(BR2_LINUX_KERNEL_LZ4) = CONFIG_KERNEL_LZ4
+LINUX_COMPRESSION_OPT_$(BR2_LINUX_KERNEL_LZMA) = CONFIG_KERNEL_LZMA
+LINUX_COMPRESSION_OPT_$(BR2_LINUX_KERNEL_LZO) = CONFIG_KERNEL_LZO
+LINUX_COMPRESSION_OPT_$(BR2_LINUX_KERNEL_XZ) = CONFIG_KERNEL_XZ
ifeq ($(BR2_LINUX_KERNEL_UBOOT_IMAGE),y)
LINUX_DEPENDENCIES += host-uboot-tools
define LINUX_KCONFIG_FIXUP_CMDS
$(if $(LINUX_NEEDS_MODULES),
$(call KCONFIG_ENABLE_OPT,CONFIG_MODULES,$(@D)/.config))
+ $(call KCONFIG_ENABLE_OPT,$(LINUX_COMPRESSION_OPT_y),$(@D)/.config)
+ $(foreach opt, $(LINUX_COMPRESSION_OPT_),
+ $(call KCONFIG_DISABLE_OPT,$(opt),$(@D)/.config)
+ )
$(if $(BR2_arm)$(BR2_armeb),
$(call KCONFIG_ENABLE_OPT,CONFIG_AEABI,$(@D)/.config))
$(if $(BR2_TARGET_ROOTFS_CPIO),