Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 784599 - sys-kernel/gentoo-kernel{,-bin}: set kernel compression mode to gzip by default
Summary: sys-kernel/gentoo-kernel{,-bin}: set kernel compression mode to gzip by default
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Distribution Kernel Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-20 23:50 UTC by Georgy Yakovlev
Modified: 2022-04-14 06:52 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Georgy Yakovlev archtester gentoo-dev 2021-04-20 23:50:55 UTC
some IRC backstory:

<flow> would you consider disabling zstd (CONFIG_KERNEL_ZSTD=n) in gentoo-kernel, as it makes the kernel unbootable via xen 4.13 (haven't tried 4.14)
<@gyakovlev> flow: gentoo-kernel or gentoo-kernel-bin ?
<@gyakovlev> for gentoo-kernel (non-bin) you can toggle even single options on/off without maintaining full config or savedconfig.
<@gyakovlev> https://wiki.gentoo.org/wiki/Project:Distribution_Kernel#Using_.2Fetc.2Fkernel.2Fconfig.d
<flow> gyakovlev: yep /etc/kernel/config.d/disable-zstd.conf is what I did
<flow> I'd argue for both
<@gyakovlev> I have a feeling that xen is rather niche usecase, and in-kernel zstd is used by initramfs and btrfs afaik ( I may be wrong though ), so that's a hard question.
<@gyakovlev> flow: quick googling tells me that it fails to boot only if kernel compressed by zstd, not option enabled.
<@gyakovlev> so maybe a portage hook that uncompresses bzimage and re-compresses it with gzip will do the trick?
<@gyakovlev> I have similar hook to uncompress kernel on arm64
<@gyakovlev> because systemd-boot does not support compressed images on arm64 EFI at all
<flow> gyakovlev: sorry, i wasn't clear, it's about how the kernel is compressed, yet disabling the option makes it bootable
<flow> not sure how those things interact
<@gyakovlev> xen's elf loader does not support zstd compression, that's how.
<@gyakovlev> but you don't need to disable whole zstd support to not compress kernel with zstd, I think.
<@gyakovlev> it's like cutting of an arm because a finger hurts =)
<@gyakovlev> s/of/off/
<@gyakovlev> flow: nvm, I confused 2 options. CONFIG_KERNEL_ZSTD specifies kernel compression format.
<@gyakovlev> I was thinking CRYPTO_ZSTD (which enables algorithm itself )
<@gyakovlev> I'd personally set CONFIG_KERNEL_GZIP, as the most compatible. and compressor available everywhere. I'll open a bug for that.



I think default kernel compression method should be gzip, as it's the most compatible one, can be booted by almost anything, and compressor/decompressor is always available.
so, maybe lets adjust configs to use CONFIG_KERNEL_GZIP=y ?

WDYT?
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-04-21 06:46:53 UTC
<@mgorny> gyakovlev: does that work on arm64 too or still need uncompressed?
Comment 2 Georgy Yakovlev archtester gentoo-dev 2021-04-21 07:08:12 UTC
(In reply to Michał Górny from comment #1)
> <@mgorny> gyakovlev: does that work on arm64 too or still need uncompressed?

arm64 can be booted so many ways...

my specific setup uses systemd-boot on EFI, and it wants uncompressed linux image.
but that's just my machine with my efi implementation.

most other machines use grub or uboot, or rpi loader: all support gzip just fine.

file /boot/*/*/linux
/boot/***/5.10.15/linux: Linux kernel ARM64 boot executable Image, little-endian, 4K pages

don't think it's reasonable to keep image uncompressed for arm64 just because of my setup.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-04-21 07:16:20 UTC
I suppose it makes sense then.  I'll make the change for the next bump, if I don't forget ;-).
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-04-21 17:36:24 UTC
Changed in 5.4.114/5.10.32/5.11.16.