Skip to contentSkip to conversation

linux: add support for Image.gz kernel format

PATCH New Peter Korsgaard 2 participants 2 messages Jan 22, 2021 – Jan 23, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux: add support for Image.gz kernel format

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.

---
 linux/Config.in | 4 ++++
 linux/linux.mk  | 2 ++
 2 files changed, 6 insertions(+)
linux/Config.in +4 -0
index 4010a9def8..7cef0f3655 100644
@@ -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
linux/linux.mk +2 -0
index c2ea0008d7..a212f42c28 100644
@@ -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)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 linux: add support for Image.gz kernel format

Quoted 17 lines · On Fri, 22 Jan 2021 11:39:49 +0100 Peter Korsgaard <[email protected]> wrote:

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.

Quoted 5 lines
---
 linux/Config.in | 4 ++++
 linux/linux.mk  | 2 ++
 2 files changed, 6 insertions(+)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com