guix system: Add 'build' action.

* guix/scripts/system.scm (show-help): Document 'build' action.
  (guix-system): Honor 'build' action.
* doc/guix.texi (Invoking guix system): Add 'build' action.
master
Ludovic Courtès 2014-05-16 21:56:00 +02:00
parent 90f69c2ec5
commit 7889394e05
2 changed files with 18 additions and 6 deletions

View File

@ -3204,6 +3204,11 @@ operating system is instantiate. Currently the following values are
supported:
@table @code
@item build
Build the operating system's derivation, which includes all the
configuration files and programs needed to boot and run the system.
This action does not actually install anything.
@item vm
@cindex virtual machine
Build a virtual machine that contain the operating system declared in

View File

@ -24,6 +24,7 @@
#:use-module (guix utils)
#:use-module (guix monads)
#:use-module (guix scripts build)
#:use-module (gnu system)
#:use-module (gnu system vm)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-37)
@ -71,9 +72,15 @@
(define (show-help)
(display (_ "Usage: guix system [OPTION] ACTION FILE
Build the operating system declared in FILE according to ACTION.\n"))
(display (_ "Currently the only valid values for ACTION are 'vm', which builds
a virtual machine of the given operating system that shares the host's store,
and 'vm-image', which builds a virtual machine image that stands alone.\n"))
(newline)
(display (_ "The valid values for ACTION are:\n"))
(display (_ "\
- 'build', build the operating system without installing anything\n"))
(display (_ "\
- 'vm', build a virtual machine image that shares the host's store\n"))
(display (_ "\
- 'vm-image', build a freestanding virtual machine image.\n"))
(show-build-options-help)
(display (_ "
--image-size=SIZE for 'vm-image', produce an image of SIZE"))
@ -131,9 +138,7 @@ and 'vm-image', which builds a virtual machine image that stands alone.\n"))
(alist-cons 'argument arg result)))
(let ((action (string->symbol arg)))
(case action
((vm)
(alist-cons 'action action result))
((vm-image)
((build vm vm-image)
(alist-cons 'action action result))
(else (leave (_ "~a: unknown action~%")
action))))))
@ -147,6 +152,8 @@ and 'vm-image', which builds a virtual machine image that stands alone.\n"))
(read-operating-system file)
(leave (_ "no configuration file specified~%"))))
(mdrv (case action
((build)
(operating-system-derivation os))
((vm-image)
(let ((size (assoc-ref opts 'image-size)))
(system-qemu-image os