Skip to content
Snippets Groups Projects
Commit 7889394e authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

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.
parent 90f69c2e
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -24,6 +24,7 @@ (define-module (guix scripts system)
#: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 (read-operating-system file)
(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 @@ (define (parse-options)
(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 @@ (define (parse-options)
(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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment