git.iko.soy/typeable/nixpkgs
on master help sign in
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

commitf664823a1ae2a81cad5eae4c73b2a4714e417d64 authorClemens Fruhwirth <clemens@endorphin.org> dateThu 1 Aug 2019, 11:37 (7 years ago) parentc6c7850
1 file changed+2−1
nixos/lib/make-disk-image.nix+2−1
nixos/lib/make-disk-image.nix+2−1
@@ -185,7 +185,8 @@ let format' = format; in let
185185 --system ${config.system.build.toplevel} --channel ${channelSources} --substituters ""
186186
187187 echo "copying staging root to image..."
188− cptofs -p ${optionalString (partitionTableType != "none") "-P ${rootPartition}"} -t ${fsType} -i $diskImage $root/* /
188+ cptofs -p ${optionalString (partitionTableType != "none") "-P ${rootPartition}"} -t ${fsType} -i $diskImage $root/* / ||
189+ (echo "ERROR: cptofs failed. diskSize might be too small for closure."; exit 1)
189190 '';
190191in pkgs.vmTools.runInLinuxVM (
191192 pkgs.runCommand name