summary refs log tree commit diff
path: root/nixos/lib
diff options
context:
space:
mode:
authorClemens Fruhwirth <clemens@endorphin.org>2019-08-01 11:37:24 +0200
committerClemens Fruhwirth <clemens@endorphin.org>2019-08-26 13:09:53 +0200
commitf664823a1ae2a81cad5eae4c73b2a4714e417d64 (patch)
tree57278114a2f9d3ea35ddd8b10eddff9be69b92c4 /nixos/lib
parentc6c7850321f124aab1708f55976fd96c13c3f8c9 (diff)
downloadnixpkgs-f664823a1ae2a81cad5eae4c73b2a4714e417d64.tar
nixpkgs-f664823a1ae2a81cad5eae4c73b2a4714e417d64.tar.gz
nixpkgs-f664823a1ae2a81cad5eae4c73b2a4714e417d64.tar.bz2
nixpkgs-f664823a1ae2a81cad5eae4c73b2a4714e417d64.tar.lz
nixpkgs-f664823a1ae2a81cad5eae4c73b2a4714e417d64.tar.xz
nixpkgs-f664823a1ae2a81cad5eae4c73b2a4714e417d64.tar.zst
nixpkgs-f664823a1ae2a81cad5eae4c73b2a4714e417d64.zip
make-disk-image.nix: Handle cptofs error explicitly
Because the copy process inside the VM does not reliably
give "No space" error message leaving the user wondering what
went wrong:

unable to create directory /mnt/0000fe01///nix/store/yknzxx7w2ck9p30k81gpi5yfjlrq41lr-libsecret-0.18.7/share/locale/ro: Success
[    5.462365] reboot: Restarting system
error processing entry /build/root/nix/store/yknzxx7w2ck9p30k81gpi5yfjlrq41lr-libsecret-0.18.7/share/locale/ro, aborting
error processing entry /build/root/nix/store/yknzxx7w2ck9p30k81gpi5yfjlrq41lr-libsecret-0.18.7/share/locale, aborting
error processing entry /build/root/nix/store/yknzxx7w2ck9p30k81gpi5yfjlrq41lr-libsecret-0.18.7/share, aborting
error processing entry /build/root/nix/store/yknzxx7w2ck9p30k81gpi5yfjlrq41lr-libsecret-0.18.7, aborting
error processing entry /build/root/nix/store, aborting
error processing entry /build/root/nix, aborting
builder for '/nix/store/fsdvqxq92iai7f3w8wcsncgfwag7cj2l-libvirtd-ssh-image.drv' failed with exit code 228
Diffstat (limited to 'nixos/lib')
-rw-r--r--nixos/lib/make-disk-image.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/nixos/lib/make-disk-image.nix b/nixos/lib/make-disk-image.nix
index 5e86ea479d5..feb6d194022 100644
--- a/nixos/lib/make-disk-image.nix
+++ b/nixos/lib/make-disk-image.nix
@@ -185,7 +185,8 @@ let format' = format; in let
       --system ${config.system.build.toplevel} --channel ${channelSources} --substituters ""
 
     echo "copying staging root to image..."
-    cptofs -p ${optionalString (partitionTableType != "none") "-P ${rootPartition}"} -t ${fsType} -i $diskImage $root/* /
+    cptofs -p ${optionalString (partitionTableType != "none") "-P ${rootPartition}"} -t ${fsType} -i $diskImage $root/* / ||
+      (echo "ERROR: cptofs failed. diskSize might be too small for closure."; exit 1)
   '';
 in pkgs.vmTools.runInLinuxVM (
   pkgs.runCommand name