overlay/disk-images: set root partition to 3 GiB

Instead of programatically estimating the size of the root partition
we hard-code the value in the partition table and add a test to
verify that we always have at least 25% free space available.

I tried to replicate COSA logic in [1] to estimate the required root
partition size but since we don't have the ostree commit during
the container build it's still a big guesstimate: we have to
account for the XFS block size and how each metadata file will eat a
full block.
So instead of a half-measure / half guess we use a full hardcoded
approach with an accompagnying test.

[1] https://github.com/coreos/fedora-coreos-config/pull/4259
This commit is contained in:
jbtrystram 2026-10-07 17:28:04 +02:00 committed by Jean-Baptiste Trystram
parent ed96fad3e9
commit 40c1b92fa3
5 changed files with 35 additions and 0 deletions

View file

@ -48,6 +48,8 @@ partition_table:
# Root partition — DPS type for aarch64
- label: "root"
# bump when ext.config.disks.rootfs-free-space fail
size: 3.5GiB
type: B921B045-1DF0-41C3-AF44-4C6F280D3FAE
payload_type: "filesystem"
payload:

View file

@ -40,6 +40,8 @@ partition_table:
# Root partition — DPS type for ppc64le
- label: "root"
# bump when ext.config.disks.rootfs-free-space fail
size: 3.5GiB
type: C31C45E6-3F39-412E-80FB-4809C4980599
payload_type: "filesystem"
payload:

View file

@ -34,6 +34,8 @@ partition_table:
# Root partition — DPS type for s390x
- label: "root"
# bump when ext.config.disks.rootfs-free-space fail
size: 3.5GiB
partnum: 4
type: 5EEAD9A9-FE09-4A1E-A1D7-520D00531306
payload_type: "filesystem"

View file

@ -48,6 +48,8 @@ partition_table:
# Root partition — DPS type for x86_64
- label: "root"
# bump when ext.config.disks.rootfs-free-space fail
size: 3.5GiB
type: 4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709
payload_type: "filesystem"
payload:

View file

@ -0,0 +1,27 @@
#!/bin/bash
## kola:
## appendKernelArgs: "coreos.disable_growfs"
## description: Verify that the coreos.disable_growfs karg makes the
## growfs service a no-op, and that the ungrown rootfs still has at
## least 25% free space.
## creationDate: 2026-10-07
set -xeuo pipefail
# shellcheck disable=SC1091
. "$KOLA_EXT_DATA/commonlib.sh"
MIN_FREE_SPACE_EXPECTED=15
if [ -f /run/ignition-ostree-growfs.stamp ]; then
fatal "rootfs was grown even though coreos.disable_growfs was set"
fi
ok "rootfs was not grown due to coreos.disable_growfs"
used_pcent=$(df --output=pcent /sysroot | tail -n 1 | tr -dc '0-9')
free_pcent=$((100 - used_pcent))
echo "/sysroot free space: ${free_pcent}%"
if [ "${free_pcent}" -lt $MIN_FREE_SPACE_EXPECTED ]; then
fatal "/sysroot has less than ${MIN_FREE_SPACE_EXPECTED}% free space (${free_pcent}%) without growfs"
fi
ok "/sysroot has at least 25% free space without growfs"