From: Lennart Poettering Date: Mon, 22 Jun 2026 09:40:27 +0000 (+0200) Subject: repart: make vfat creation reproducible (#42446) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5d3fbce100bbbf33f1334c861643428be2b3461;p=thirdparty%2Fsystemd.git repart: make vfat creation reproducible (#42446) 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. --- d5d3fbce100bbbf33f1334c861643428be2b3461