linux: add support for Image.gz kernel format
authorPeter Korsgaard <peter@korsgaard.com>
Fri, 22 Jan 2021 10:39:49 +0000 (11:39 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sat, 23 Jan 2021 20:27:13 +0000 (21:27 +0100)
arm64 / riscv supports building a gzip compressed 'Image' format kernel,
which is sometimes useful. From arch/arm64/Makefile:

all: Image.gz

Image: vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@

Image.%: Image
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@

(and similar logic for riscv)

Future architectures may or may not copy this logic, so for robustness add
an explicit Image.gz format rather than copying both Image and Image.gz when
the Image format is used.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
linux/Config.in
linux/linux.mk

index 4010a9def818088cc63640ae1f2ac1e5b1068e76..7cef0f3655760670a06a28613cf1176c49df01ad 100644 (file)
@@ -263,6 +263,10 @@ config BR2_LINUX_KERNEL_IMAGE
        bool "Image"
        depends on BR2_aarch64 || BR2_riscv
 
+config BR2_LINUX_KERNEL_IMAGEGZ
+       bool "Image.gz"
+       depends on BR2_aarch64 || BR2_riscv
+
 config BR2_LINUX_KERNEL_LINUX_BIN
        bool "linux.bin"
        depends on BR2_microblaze
index c2ea0008d7449df1540a6c37295628f7f5dd251d..a212f42c284e286fc0af3f23505e2878564ecd40 100644 (file)
@@ -204,6 +204,8 @@ else ifeq ($(BR2_LINUX_KERNEL_SIMPLEIMAGE),y)
 LINUX_IMAGE_NAME = simpleImage.$(firstword $(LINUX_DTS_NAME))
 else ifeq ($(BR2_LINUX_KERNEL_IMAGE),y)
 LINUX_IMAGE_NAME = Image
+else ifeq ($(BR2_LINUX_KERNEL_IMAGEGZ),y)
+LINUX_IMAGE_NAME = Image.gz
 else ifeq ($(BR2_LINUX_KERNEL_LINUX_BIN),y)
 LINUX_IMAGE_NAME = linux.bin
 else ifeq ($(BR2_LINUX_KERNEL_VMLINUX_BIN),y)