nixos/lib/make-ext4-fs: fix after mkfs.ext4 refactoring

In 9ac1ab10c963a86457c2c9b1edf31542ff3737cd this library function was
refactored to use mkfs.ext4 instead of cptofs. There are two problems:

If populateImageCommands would create no files (which is fine), a cp
invocation would fail due to missing source arguments.

Another problem is that mkfs.ext4 relies on fakeroot to have sane
uid/gids in the generated filesystem image. This currently doesn't
work for cross compiling.

Changed files
+4 -1
nixos
+4 -1
nixos/lib/make-ext4-fs.nix
···
(
GLOBIGNORE=".:.."
shopt -u dotglob
-
cp -a --reflink=auto ./files/* -t ./rootImage/
)
# Also include a manifest of the closures in a format suitable for nix-store --load-db
···
(
GLOBIGNORE=".:.."
shopt -u dotglob
+
+
for f in ./files/*; do
+
cp -a --reflink=auto -t ./rootImage/ "$f"
+
done
)
# Also include a manifest of the closures in a format suitable for nix-store --load-db