From a8ac4f081a9a679498ea42ccfe001f218bba3043 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 30 Jun 2017 00:04:38 +0200 Subject: vm: Estimate the disk size by default. * gnu/build/vm.scm (estimated-partition-size): New procedure. * gnu/system/vm.scm (expression->derivation-in-linux-vm): Change #:disk-image-size default to 'guess. [builder]: When DISK-IMAGE-SIZE is 'guess, use 'estimated-partition-size' and compute and estimate of the image size. (qemu-image): Likewise. * guix/build/store-copy.scm (file-size, closure-size): New procedures. * guix/scripts/system.scm (%default-options): Change 'image-size' to 'guess. * doc/guix.texi (Building the Installation Image): Remove '--image-size' flag from example. (Invoking guix system): Document the image size estimate. --- doc/guix.texi | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 729ec081be..d61a5b7514 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -7877,9 +7877,8 @@ that. The installation image described above was built using the @command{guix system} command, specifically: -@c FIXME: 1G is too much; see . @example -guix system disk-image --image-size=1G gnu/system/install.scm +guix system disk-image gnu/system/install.scm @end example Have a look at @file{gnu/system/install.scm} in the source tree, @@ -16187,8 +16186,9 @@ size of the image. @item vm-image @itemx disk-image Return a virtual machine or disk image of the operating system declared -in @var{file} that stands alone. Use the @option{--image-size} option -to specify the size of the image. +in @var{file} that stands alone. By default, @command{guix system} +estimates the size of the image needed to store the system, but you can +use the @option{--image-size} option to specify a value. When using @code{vm-image}, the returned image is in qcow2 format, which the QEMU emulator can efficiently use. @xref{Running GuixSD in a VM}, @@ -16251,6 +16251,10 @@ of the given @var{size}. @var{size} may be a number of bytes, or it may include a unit as a suffix (@pxref{Block size, size specifications,, coreutils, GNU Coreutils}). +When this option is omitted, @command{guix system} computes an estimate +of the image size as a function of the size of the system declared in +@var{file}. + @item --root=@var{file} @itemx -r @var{file} Make @var{file} a symlink to the result, and register it as a garbage -- cgit v1.2.3