[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/06: vm: Display the disk and partition sizes.
From: |
Ludovic Courtès |
Subject: |
03/06: vm: Display the disk and partition sizes. |
Date: |
Thu, 29 Jun 2017 18:17:55 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit a2cf57e79e0c1ca59ff854c12ece178a73fe224d
Author: Ludovic Courtès <address@hidden>
Date: Thu Jun 29 23:26:35 2017 +0200
vm: Display the disk and partition sizes.
* gnu/build/vm.scm (load-in-linux-vm): Add 'format' call when
MAKE-DISK-IMAGE? is true.
(initialize-partition-table): Show the size of the partitions being
created.
---
gnu/build/vm.scm | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index 56ebeae..7d5e613 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -85,6 +85,9 @@ access it via /dev/hda.
REFERENCES-GRAPHS can specify a list of reference-graph files as produced by
the #:references-graphs parameter of 'derivation'."
(when make-disk-image?
+ (format #t "creating ~a image of ~,2f MiB...~%"
+ disk-image-format (/ disk-image-size (expt 2 20)))
+ (force-output)
(unless (zero? (system* "qemu-img" "create" "-f" disk-image-format
output
(number->string disk-image-size)))
@@ -193,8 +196,15 @@ actual /dev name based on DEVICE."
(cons (partition-options head offset index)
result))))))
- (format #t "creating partition table with ~a partitions...\n"
- (length partitions))
+ (format #t "creating partition table with ~a partitions (~a)...\n"
+ (length partitions)
+ (string-join (map (compose (cut string-append <> " MiB")
+ number->string
+ (lambda (size)
+ (round (/ size (expt 2. 20))))
+ partition-size)
+ partitions)
+ ", "))
(unless (zero? (apply system* "parted" "--script"
device "mklabel" label-type
(options partitions offset)))
- branch master updated (95bbaa0 -> 79bfa63), Ludovic Courtès, 2017/06/29
- 03/06: vm: Display the disk and partition sizes.,
Ludovic Courtès <=
- 06/06: maint: Disk image size is automatically guessed., Ludovic Courtès, 2017/06/29
- 02/06: vm: Fix 'load-in-linux-vm' docstring., Ludovic Courtès, 2017/06/29
- 05/06: vm: Use 'fold2' from (guix combinators)., Ludovic Courtès, 2017/06/29
- 01/06: build: Remove check for broken (srfi srfi-37)., Ludovic Courtès, 2017/06/29
- 04/06: vm: Estimate the disk size by default., Ludovic Courtès, 2017/06/29