ublue-os / main

OCI base images of Fedora with batteries included
https://universal-blue.org/images/main/
Apache License 2.0
481 stars 37 forks source link

dracut falls back to `pigz` instead of `zstd` in kernel-skew case #606

Closed m0gg closed 1 month ago

m0gg commented 1 month ago

During build - when rpm-ostree installing the kernels from ublue-os/main-kernel - dracut falls back to use pigz for initrd compression due to the absence of zstd binary.

The resulting included initrd is then gzip compressed:

$ podman -r run -i --rm localhost/base-build:40-main lsinitrd /usr/lib/modules/6.9.7-200.fc40.x86_64/initramfs.img | head -n 20
Image: /usr/lib/modules/6.9.7-200.fc40.x86_64/initramfs.img: 139M
========================================================================
Early CPIO image
========================================================================
drwxr-xr-x   2 root     root            0 Jan  1  1970 .
-rw-r--r--   1 root     root            2 Jan  1  1970 early_cpio
drwxr-xr-x   2 root     root            0 Jan  1  1970 kernel
drwxr-xr-x   2 root     root            0 Jan  1  1970 kernel/x86
drwxr-xr-x   2 root     root            0 Jan  1  1970 kernel/x86/microcode
-rw-r--r--   1 root     root        76166 Jan  1  1970 kernel/x86/microcode/AuthenticAMD.bin
-rw-r--r--   1 root     root     12575744 Jan  1  1970 kernel/x86/microcode/GenuineIntel.bin
========================================================================

gzip: stdin: decompression OK, trailing garbage ignored
Version:

Arguments:  --no-hostonly --kver '6.9.7-200.fc40.x86_64' --reproducible -v --add 'ostree' -f

gzip: stdin: decompression OK, trailing garbage ignored

dracut modules:
systemd
systemd-initrd
systemd-sysuser

If i'm not mistaken, this would be relevant for at least bootc install?

m0gg commented 1 month ago

Okay, quick check with changes from bootc branch (d709a9093d36532c50b18017233b67bed850db43) reveals it does affect bootc install

sudo podman run -it --rm --privileged \
  --pid=host -v /var/lib/containers:/var/lib/containers --security-opt label=type:unconfined_t \
  --tmpfs /tmp --tmpfs /var/tmp \
  -v /dev:/dev \
  -v $(pwd):/dest -w /dest \
  localhost/base-build:40-main bash -c "rpm-ostree install gdisk; truncate -s 21474836480 fedora-bootc.img; \
    bootc install to-disk --via-loopback --filesystem btrfs --wipe --target-transport containers-storage fedora-bootc.img"
qemu-system-x86_64 -accel kvm -M q35 -bios /usr/share/edk2-ovmf/OVMF_CODE.fd -m 4096 -smp 4 -cpu host -snapshot -hda fedora-bootc.img -vga virtio -usbdevice tablet
m2Giles commented 1 month ago

we can include the zstd binary during the kernel swap stage.

just add --install=zstd and that will install at same time.

m0gg commented 1 month ago

Closed. Should not matter anymore since 90faeb3eb1e11e3a61824edfa113c01f02c61617