]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: make vfat creation reproducible (#42446)
authorLennart Poettering <lennart@amutable.com>
Mon, 22 Jun 2026 09:40:27 +0000 (11:40 +0200)
committerGitHub <noreply@github.com>
Mon, 22 Jun 2026 09:40:27 +0000 (11:40 +0200)
Two fixes to get this byte-stable:

- `fd_copy_directory()` was using `FOREACH_DIRENT_ALL`, which doesn't
give stable ordering. Read all paths, sort, then iterate.
- `mcopy -s` depends on `readdir()` ordering and thus isn't
reproducible. Implement the recursion/sorting here and only invoke
mcopy/mmd per dir.

First change increases memory usage, as we don't stream the paths
anymore, second increases the number of context switches when invoking
external tools. Both should be fine given the ESP content should usually
be pretty limited.

I'd like to write a test for this, but didn't come up with a way that
doesn't require privileges and would surface the error reliably.

1  2 
src/shared/mkfs-util.c

Simple merge