davexunit pushed a commit to branch wip-container in repository guix. commit 515cda85d1275b6ec358092c3aba6adc7df8d414 Author: David Thompson <da...@gnu.org> Date: Mon Jun 8 09:03:09 2015 -0400
gnu: system: Add operating-system-derivation/container. * gnu/system.scm (operating-system-derivation/container): New procedure. (operating-system-boot-script): Add #:container? keyword argument. --- gnu/system.scm | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a/gnu/system.scm b/gnu/system.scm index 431b55f..db64ddc 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -80,6 +80,7 @@ operating-system-activation-script operating-system-derivation + operating-system-derivation/container operating-system-profile operating-system-grub.cfg @@ -769,11 +770,12 @@ etc." ;; Set up /run/current-system. (activate-current-system))))) -(define (operating-system-boot-script os) +(define* (operating-system-boot-script os #:key container?) "Return the boot script for OS---i.e., the code started by the initrd once we're running in the final root." (mlet* %store-monad ((services (operating-system-services os)) - (activate (operating-system-activation-script os)) + (activate (operating-system-activation-script + os #:container? container?)) (dmd-conf (dmd-configuration-file services))) (gexp->file "boot" #~(begin @@ -910,4 +912,18 @@ this file is the reconstruction of GRUB menu entries for old configurations." ("locale" ,#~#$locale) ;used by libc ("etc" ,#~#$etc))))) +(define (operating-system-derivation/container os) + (mlet* %store-monad + ((profile (operating-system-profile os)) + (etc (operating-system-etc-directory os)) + (boot (operating-system-boot-script os #:container? #t)) + (locale (operating-system-locale-directory os)) + (params (operating-system-parameters-file os))) + (file-union "system-container" + `(("boot" ,#~#$boot) + ("parameters" ,#~#$params) + ("profile" ,#~#$profile) + ("locale" ,#~#$locale) ;used by libc + ("etc" ,#~#$etc))))) + ;;; system.scm ends here