[systemd-devel] repart: Value too large for defined data type
Thayne Harbaugh
thayne at mastodonlabs.com
Thu Jan 9 21:47:17 UTC 2025
Greetings,
I have a mkosi build that is failing with the following message:
>$ mkosi build
...
/var/tmp/.#repart020c1a929b048b02 successfully formatted as ext4 (label "root", uuid c8ed6cd3-04b0-4667-8f2f-af9487b8b986)
Automatically determined minimal disk image size as 2.2G.
Sized '/home/thayne/.cache/mkosi/mkosi-workspace-37l8iaf4/staging/test_1.2.3.raw' to 2.2G.
Applying changes to /home/thayne/.cache/mkosi/mkosi-workspace-37l8iaf4/staging/test_1.2.3.raw.
Failed to read file attributes of /home/thayne/.cache/mkosi/mkosi-workspace-37l8iaf4/staging/test_1.2.3.raw: Value too large for defined data type
? "systemd-repart --empty=allow --size=auto --dry-run=no --json=pretty --no-pager --offline=yes --seed 1feaec73-f24d-454c-bd15-4f80926e951e /home/thayne/.cache/mkosi/mkosi-workspace-37l8iaf4/staging/test_1.2.3.raw --root=/buildroot --empty=create --defer-partitions esp,xbootldr --generate-fstab=/etc/fstab --generate-crypttab=/etc/crypttab --definitions /source/mkosi.repart" returned non-zero exit code 1.
It is a build that has been running without problems for some time.
Recently it has changed from incorporating systemd v256 to v257. When
I switch it back to v256 it succeeds and does not error. I have tried
to narrow it further.
* The build runs inside of a Docker container with the mkosi source
triee mounted inside. The container is started with the following
command:
>$ docker run -it --privileged -v "/dir/to/source:/source" ubuntu:24.04
* The container has mkosi 24.3 inside
* The failure occurs with both erofs+best and ext4+guess
* The mkosi configuration is the following:
mkosi.conf
==========
[Distribution]
Distribution=ubuntu
# noble == 24.04
Release=noble
Repositories=noble,noble-security,noble-updates
Architecture=x86-64
[Output]
Format=disk
ImageId=test
ImageVersion=1.2.3
[Content]
RootPassword=tomato
Bootable=yes
Bootloader=systemd-boot
Packages=
linux-image-6.8.0-51-generic
mkosi.repart/10-esp.conf
========================
[Partition]
Type=esp
Format=vfat
CopyFiles=/boot:/
CopyFiles=/efi:/
SizeMinBytes=2048M
mkosi.repart/20-rootfs.conf
===========================
[Partition]
Type=root
Label=root
#Format=erofs
#Minimize=best
Format=ext4
Minimize=guess
MountPoint=/:ro
CopyFiles=/:/
ReadOnly=on
Encrypt=key-file
EncryptedVolume=root:/run/fscrypt.sock:luks,headless,x-initrd.attach
While initially the failure seemed to correclate directly with systemd
v257 packages being injected into mkosi.packages I have since been
able to reproduce the failure with the upstream Ubuntu 24.04/noble
v255 version of systemd.
It seems that building on a mount inside of a Docker container is
necessary factor to cause the failure. While I have made a quick
glance at src/repart/repart.c in prepare_temporary_file(),
context_split() and context_minimize() I have not done any serious
digging yet.
Any ideas about the specifics of what causes this failure and what it
will take to fix it?
More information about the systemd-devel
mailing list