Skip to content

Commit 4c7be57

Browse files
committed
arm64: allow installing compressed image by default
On arm64 we build compressed images, but "make install" by default will install the old non-compressed one. To actually get the compressed image install, you need to use "make zinstall", which is not the usual way to install a kernel. Which may not sound like much of an issue, but when you deal with multiple architectures (and years of your fingers knowing the regular "make install" incantation), this inconsistency is pretty annoying. But as Will Deacon says: "Sadly, bootloaders being as top quality as you might expect, I don't think we're in a position to rely on decompressor support across the board. Our Image.gz is literally just that -- we don't have a built-in decompressor (nor do I think we want to rush into that again after the fun we had on arm32) and the recent EFI zboot support solves that problem for platforms using EFI. Changing the default 'install' target terrifies me. There are bound to be folks with embedded boards who've scripted this and we could really ruin their day if we quietly give them a compressed kernel that their bootloader doesn't know how to handle :/" So make this conditional on a new "COMPRESSED_INSTALL" option. Cc: Catalin Marinas <[email protected]> Acked-by: Will Deacon <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 51c4767 commit 4c7be57

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

arch/arm64/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2337,6 +2337,17 @@ config EFI
23372337
allow the kernel to be booted as an EFI application. This
23382338
is only useful on systems that have UEFI firmware.
23392339

2340+
config COMPRESSED_INSTALL
2341+
bool "Install compressed image by default"
2342+
help
2343+
This makes the regular "make install" install the compressed
2344+
image we built, not the legacy uncompressed one.
2345+
2346+
You can check that a compressed image works for you by doing
2347+
"make zinstall" first, and verifying that everything is fine
2348+
in your environment before making "make install" do this for
2349+
you.
2350+
23402351
config DMI
23412352
bool "Enable support for SMBIOS (DMI) tables"
23422353
depends on EFI

arch/arm64/Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,13 @@ $(BOOT_TARGETS): vmlinux
182182
Image.%: Image
183183
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
184184

185-
install: KBUILD_IMAGE := $(boot)/Image
185+
ifeq ($(CONFIG_COMPRESSED_INSTALL),y)
186+
DEFAULT_KBUILD_IMAGE = $(KBUILD_IMAGE)
187+
else
188+
DEFAULT_KBUILD_IMAGE = $(boot)/Image
189+
endif
190+
191+
install: KBUILD_IMAGE := $(DEFAULT_KBUILD_IMAGE)
186192
install zinstall:
187193
$(call cmd,install)
188194

@@ -229,7 +235,7 @@ define archhelp
229235
echo '* Image.gz - Compressed kernel image (arch/$(ARCH)/boot/Image.gz)'
230236
echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
231237
echo ' image.fit - Flat Image Tree (arch/$(ARCH)/boot/image.fit)'
232-
echo ' install - Install uncompressed kernel'
238+
echo ' install - Install kernel (compressed if COMPRESSED_INSTALL set)'
233239
echo ' zinstall - Install compressed kernel'
234240
echo ' Install using (your) ~/bin/installkernel or'
235241
echo ' (distribution) /sbin/installkernel or'

0 commit comments

Comments
 (0)