From 030cffc0697deaf0b52f37a718fc6aa8debb2325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Ravier?= Date: Tue, 11 Jun 2024 18:48:09 +0200 Subject: [PATCH] Compress initramfs with zstd See: https://gitlab.com/fedora/ostree/sig/-/issues/34 --- common.yaml | 2 ++ initramfs-zstd.yaml | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 initramfs-zstd.yaml diff --git a/common.yaml b/common.yaml index d60d99e..20ba4f1 100644 --- a/common.yaml +++ b/common.yaml @@ -17,6 +17,8 @@ include: - sysroot-ro.yaml # Workaround for https://github.com/fedora-silverblue/issue-tracker/issues/587 - grub2-workaround.yaml + # Compress initramfs with zstd + - initramfs-zstd.yaml # systemd-pcrphase module fails on ppc64le: # https://gitlab.com/fedora/ostree/sig/-/issues/44 diff --git a/initramfs-zstd.yaml b/initramfs-zstd.yaml new file mode 100644 index 0000000..3d1b1b1 --- /dev/null +++ b/initramfs-zstd.yaml @@ -0,0 +1,21 @@ +# Initramfs compression with zstd +packages: + - zstd + +postprocess: + - | + #!/usr/bin/env bash + set -xeuo pipefail + + install -dm 0755 -o 0 -g 0 /usr/lib/dracut/dracut.conf.d + + - | + #!/usr/bin/env bash + set -xeuo pipefail + + cat > /usr/lib/dracut/dracut.conf.d/20-atomic-zstd.conf << 'EOF' + # 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. + compress="zstd -19 -q -T0" + EOF