summary refs log tree commit diff
path: root/nixos/lib
diff options
context:
space:
mode:
authorJulian Stecklina <js@alien8.de>2020-07-25 16:46:08 +0200
committerSystem administrator <root@canaan.localhost>2020-07-26 22:49:55 +0200
commitfd2047c642ba44d5c300149f63f68c34da773c04 (patch)
treebdf58fcb40f6544168ee3a8026b2c9d021959c61 /nixos/lib
parentba163623ec4ce2845abcd5bd20d67829cae02860 (diff)
downloadnixpkgs-fd2047c642ba44d5c300149f63f68c34da773c04.tar
nixpkgs-fd2047c642ba44d5c300149f63f68c34da773c04.tar.gz
nixpkgs-fd2047c642ba44d5c300149f63f68c34da773c04.tar.bz2
nixpkgs-fd2047c642ba44d5c300149f63f68c34da773c04.tar.lz
nixpkgs-fd2047c642ba44d5c300149f63f68c34da773c04.tar.xz
nixpkgs-fd2047c642ba44d5c300149f63f68c34da773c04.tar.zst
nixpkgs-fd2047c642ba44d5c300149f63f68c34da773c04.zip
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.
Diffstat (limited to 'nixos/lib')
-rw-r--r--nixos/lib/make-ext4-fs.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/nixos/lib/make-ext4-fs.nix b/nixos/lib/make-ext4-fs.nix
index 74a6c134e64..33dbc8f5ec4 100644
--- a/nixos/lib/make-ext4-fs.nix
+++ b/nixos/lib/make-ext4-fs.nix
@@ -46,7 +46,10 @@ pkgs.stdenv.mkDerivation {
       (
         GLOBIGNORE=".:.."
         shopt -u dotglob
-        cp -a --reflink=auto ./files/* -t ./rootImage/
+
+        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