davexunit pushed a commit to branch wip-container in repository guix. commit 1d6437cb5be21e63b5dcfc5014488544707f6464 Author: David Thompson <da...@gnu.org> Date: Mon Jun 8 09:04:38 2015 -0400
scripts: system: Add 'container' subcommand. * guix/scripts/system.scm (show-help): Display 'container' subcommand. (system-derivation-for-action, guix-system): Add 'container' case. --- guix/scripts/system.scm | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index aa9b3f8..db9cb3e 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -30,6 +30,7 @@ #:use-module (guix build utils) #:use-module (gnu build install) #:use-module (gnu system) + #:use-module (gnu system linux-container) #:use-module (gnu system vm) #:use-module (gnu system grub) #:use-module (gnu packages grub) @@ -284,6 +285,9 @@ it atomically, and then run OS's activation script." (case action ((build init reconfigure) (operating-system-derivation os)) + ((container) + ;; FIXME: Allow user-specified root directory. + (linux-container-script os #:root-dir "/tmp/container")) ((vm-image) (system-qemu-image os #:disk-image-size image-size)) ((vm) @@ -381,6 +385,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 Linux 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")) @@ -490,7 +496,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 disk-image reconfigure init) + ((build container vm vm-image disk-image reconfigure init) (alist-cons 'action action result)) (else (leave (_ "~a: unknown action~%") action)))))) @@ -511,7 +517,7 @@ Build the operating system declared in FILE according to ACTION.\n")) action)) (case action - ((build vm vm-image disk-image reconfigure) + ((build container vm vm-image disk-image reconfigure) (unless (= count 1) (fail))) ((init)