mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 13:58:15 -05:00
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.
This commit is contained in:
parent
6efb98ed3c
commit
a2cf57e79e
1 changed files with 12 additions and 2 deletions
|
@ -85,6 +85,9 @@ (define* (load-in-linux-vm builder
|
||||||
REFERENCES-GRAPHS can specify a list of reference-graph files as produced by
|
REFERENCES-GRAPHS can specify a list of reference-graph files as produced by
|
||||||
the #:references-graphs parameter of 'derivation'."
|
the #:references-graphs parameter of 'derivation'."
|
||||||
(when make-disk-image?
|
(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
|
(unless (zero? (system* "qemu-img" "create" "-f" disk-image-format
|
||||||
output
|
output
|
||||||
(number->string disk-image-size)))
|
(number->string disk-image-size)))
|
||||||
|
@ -193,8 +196,15 @@ (define (options partitions offset)
|
||||||
(cons (partition-options head offset index)
|
(cons (partition-options head offset index)
|
||||||
result))))))
|
result))))))
|
||||||
|
|
||||||
(format #t "creating partition table with ~a partitions...\n"
|
(format #t "creating partition table with ~a partitions (~a)...\n"
|
||||||
(length partitions))
|
(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"
|
(unless (zero? (apply system* "parted" "--script"
|
||||||
device "mklabel" label-type
|
device "mklabel" label-type
|
||||||
(options partitions offset)))
|
(options partitions offset)))
|
||||||
|
|
Loading…
Reference in a new issue