From 71277dd4cd83a03e6cdf8e8912c50b593b93bda0 Mon Sep 17 00:00:00 2001 From: Job79 Date: Tue, 17 Nov 2026 19:55:19 +0100 Subject: [PATCH] perf: ext4 for /var, drop systemd-boot-random-seed xfs is a module in Fedora's kernel and takes ~0.5s to load, which held up mounting /var. ext4 is built in. systemd-boot-random-seed waited ~1s for the ESP to mount. Also remove /afs and /buildroot from the image and give the test VM 4 CPUs. Co-Authored-By: Claude Opus 5.5 --- mkosi.conf | 14 ++++++++++++-- mkosi.extra/etc/fstab | 2 +- mkosi.repart/30-var.conf | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/mkosi.conf b/mkosi.conf index f9758cf..9a9cfc8 100644 --- a/mkosi.conf +++ b/mkosi.conf @@ -100,7 +100,7 @@ KernelInitrdModules= nvme dm-verity erofs - xfs + ext4 # All modules but the hardware drivers, then the drivers a VM needs (disks, # network, screen) and those of rootless podman's networks (pasta). The last # matching line wins. Keyboard, USB and a basic screen are built into the @@ -126,6 +126,13 @@ KernelModules= # nsresourced # - sshd-keygen sshd uses one host key, kept on /var # (mkosi.extra/etc/ssh/sshd_config.d) +# - /afs mount point for the AFS network filesystem +# - /buildroot dnf's lock file, left by mkosi: it passes dnf5 +# persistdir=/buildroot/var/lib/dnf and dnf5 puts +# the install root in front of it again +# - systemd-boot-random-seed refreshes the boot loader's seed on the ESP, which +# holds up boot ~1s mounting it. The VM has +# virtio-rng. RemoveFiles= /usr/lib/modules/*/System.map /usr/lib/udev/hwdb.bin @@ -134,6 +141,9 @@ RemoveFiles= /usr/lib/systemd/system/systemd-userdbd.* /usr/lib/systemd/system/systemd-nsresourced.* /usr/lib/systemd/system/sshd-keygen* + /afs + /buildroot + /usr/lib/systemd/system/systemd-boot-random-seed.service [Validation] # Sign systemd-boot and the UKI for Secure Boot, and put our keys on the ESP. @@ -152,7 +162,7 @@ SecureBootCertificate=mkosi.crt # to forward ssh to port 2222. Ephemeral boots a copy, so test runs don't # change the built image. Ephemeral=yes -CPUs=8 +CPUs=4 RAM=8G RuntimeSize=40G RuntimeNetwork=none diff --git a/mkosi.extra/etc/fstab b/mkosi.extra/etc/fstab index a729a88..e7d9511 100644 --- a/mkosi.extra/etc/fstab +++ b/mkosi.extra/etc/fstab @@ -2,4 +2,4 @@ # # /var is the only partition on disk that is written (mkosi.repart/30-var.conf). # x-systemd.growfs grows its filesystem to fill the partition at boot. -PARTLABEL=var /var xfs x-systemd.growfs 0 0 +PARTLABEL=var /var ext4 x-systemd.growfs 0 2 diff --git a/mkosi.repart/30-var.conf b/mkosi.repart/30-var.conf index 87c1183..1a838af 100644 --- a/mkosi.repart/30-var.conf +++ b/mkosi.repart/30-var.conf @@ -7,7 +7,7 @@ [Partition] Type=var Label=var -Format=xfs +Format=ext4 CopyFiles=/var:/ Minimize=guess SplitName=-