diff --git a/overlay.d/06el9/usr/lib/dracut/dracut.conf.d/coreos-zstd.conf b/overlay.d/06el9/usr/lib/dracut/dracut.conf.d/coreos-zstd.conf new file mode 100644 index 0000000000..9a9c0678d8 --- /dev/null +++ b/overlay.d/06el9/usr/lib/dracut/dracut.conf.d/coreos-zstd.conf @@ -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" diff --git a/tests/kola/files/initrd/compression b/tests/kola/files/initrd/compression new file mode 100755 index 0000000000..5944a3b216 --- /dev/null +++ b/tests/kola/files/initrd/compression @@ -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