summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorDavid Thompson <davet@gnu.org>2015-06-08 09:04:38 -0400
committerDavid Thompson <dthompson2@worcester.edu>2015-10-30 13:22:59 -0400
commit1c8a81b1af81bdb2fd87efb38004900ad5a77d36 (patch)
treea0eb77e6687626a247bff906cab867b2bfb886af /guix
parent8e5999e0b0a4f3e639663a803eb99486c3d8304a (diff)
scripts: system: Add 'container' action.
* guix/scripts/system.scm (show-help): Display 'container' action. (system-derivation-for-action, guix-system): Add 'container' case. (perform-action): Skip GRUB config generation when building a container. * doc/guix.texi (Invoking guix system): Document it.
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/system.scm19
1 files changed, 13 insertions, 6 deletions
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index d847c75444..499038ffa1 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -34,6 +34,7 @@
#:use-module (gnu build install)
#:use-module (gnu system)
#:use-module (gnu system file-systems)
+ #:use-module (gnu system linux-container)
#:use-module (gnu system vm)
#:use-module (gnu system grub)
#:use-module (gnu services)
@@ -406,6 +407,8 @@ PATTERN, a string. When PATTERN is #f, display all the system generations."
(case action
((build init reconfigure)
(operating-system-derivation os))
+ ((container)
+ (container-script os #:mappings mappings))
((vm-image)
(system-qemu-image os #:disk-image-size image-size))
((vm)
@@ -438,10 +441,12 @@ building anything."
#:full-boot? full-boot?
#:mappings mappings))
(grub (package->derivation grub))
- (grub.cfg (operating-system-grub.cfg os
- (if (eq? 'init action)
- '()
- (previous-grub-entries))))
+ (grub.cfg (if (eq? 'container action)
+ (return #f)
+ (operating-system-grub.cfg os
+ (if (eq? 'init action)
+ '()
+ (previous-grub-entries)))))
(drvs -> (if (and grub? (memq action '(init reconfigure)))
(list sys grub grub.cfg)
(list sys)))
@@ -524,6 +529,8 @@ Build the operating system declared in FILE according to ACTION.\n"))
(display (_ "\
build build the operating system without installing anything\n"))
(display (_ "\
+ container build a container that shares the host's store\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"))
@@ -694,7 +701,7 @@ argument list and OPTS is the option alist."
(alist-cons 'argument arg result)
(let ((action (string->symbol arg)))
(case action
- ((build vm vm-image disk-image reconfigure init
+ ((build container vm vm-image disk-image reconfigure init
extension-graph dmd-graph list-generations)
(alist-cons 'action action result))
(else (leave (_ "~a: unknown action~%") action))))))
@@ -723,7 +730,7 @@ argument list and OPTS is the option alist."
(exit 1))
(case action
- ((build vm vm-image disk-image reconfigure)
+ ((build container vm vm-image disk-image reconfigure)
(unless (= count 1)
(fail)))
((init)