-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
overlay: compress initrd with zstd -19 on FCOS and RHCOS/SCOS 9
On my system, relative to gzip -9, it roughly halves decompression time at boot while also reducing initrd size. RHCOS 8 can't inherit this because the RHEL 8 kernel doesn't enable CONFIG_RD_ZSTD. This requires coreos-installer to support decoding zstd (for `coreos-installer pxe customize`), which is coreos/coreos-installer#920. For coreos/fedora-coreos-tracker#1247.
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
overlay.d/06el9/usr/lib/dracut/dracut.conf.d/coreos-zstd.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Compress initrd with zstd. dracut defaults to -15, but we want the | ||
# maximum reasonable compression, so override the command line to use | ||
# dracut's defaults along with -19. | ||
# | ||
# We can't use this in RHCOS 8 because the kernel doesn't enable | ||
# CONFIG_RD_ZSTD. | ||
|
||
compress="zstd -19 -q -T0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
## kola: | ||
## exclusive: false | ||
# | ||
# If dracut can't find the configured compressor, it warns and falls back to | ||
# gzip (!). Fail if the initrd isn't compressed with zstd. | ||
|
||
set -xeuo pipefail | ||
|
||
. $KOLA_EXT_DATA/commonlib.sh | ||
|
||
# Check initrd for zstd magic number | ||
if is_rhcos8; then | ||
ok "Skipping initrd zstd compression test on RHCOS 8" | ||
else | ||
if ! LANG=C grep -aUPq "\x28\xb5\x2f\xfd" /boot/ostree/*/init*; then | ||
fatal "Didn't find zstd compression in initrd" | ||
fi | ||
ok "Found zstd compression in initrd" | ||
fi |