summaryrefslogtreecommitdiff
path: root/guix/scripts/system.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-05-22 23:22:15 +0200
committerLudovic Courtès <ludo@gnu.org>2014-05-22 23:24:13 +0200
commitfb729425dcd80b8ef34c075867d2f204bc4d55cb (patch)
tree41059b378b89e796d61360c0efa01a673abe74ec /guix/scripts/system.scm
parent1e77fedb46af3c131b46da7ced55f7078d0d0e5f (diff)
guix system: Add 'disk-image' action.
* guix/scripts/system.scm (show-help): Add 'disk-image'. (guix-system)[parse-options]: Support 'disk-image' action. [option-arguments]: Likewise. Handle the 'disk-image' action. * doc/guix.texi (Invoking guix system): Document 'disk-image'.
Diffstat (limited to 'guix/scripts/system.scm')
-rw-r--r--guix/scripts/system.scm12
1 files changed, 9 insertions, 3 deletions
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index af48c57b54..345d8c3e5f 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -129,6 +129,8 @@ Build the operating system declared in FILE according to ACTION.\n"))
(display (_ "\
- 'vm-image', build a freestanding virtual machine image\n"))
(display (_ "\
+ - 'disk-image', build a disk image, suitable for a USB stick\n"))
+ (display (_ "\
- 'init', initialize a root file system to run GNU.\n"))
(show-build-options-help)
@@ -191,7 +193,7 @@ Build the operating system declared in FILE according to ACTION.\n"))
(alist-cons 'argument arg result)
(let ((action (string->symbol arg)))
(case action
- ((build vm vm-image init)
+ ((build vm vm-image disk-image init)
(alist-cons 'action action result))
(else (leave (_ "~a: unknown action~%")
action))))))
@@ -214,7 +216,7 @@ Build the operating system declared in FILE according to ACTION.\n"))
action))
(case action
- ((build vm vm-image)
+ ((build vm vm-image disk-image)
(unless (= count 1)
(fail)))
((init)
@@ -238,7 +240,11 @@ Build the operating system declared in FILE according to ACTION.\n"))
(system-qemu-image os
#:disk-image-size size)))
((vm)
- (system-qemu-image/shared-store-script os))))
+ (system-qemu-image/shared-store-script os))
+ ((disk-image)
+ (let ((size (assoc-ref opts 'image-size)))
+ (system-disk-image os
+ #:disk-image-size size)))))
(store (open-connection))
(dry? (assoc-ref opts 'dry-run?))
(drv (run-with-store store mdrv))