guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

11/13: gnu: system: Add operating-system-derivation/container.


From: David Thompson
Subject: 11/13: gnu: system: Add operating-system-derivation/container.
Date: Fri, 26 Jun 2015 00:27:36 +0000

davexunit pushed a commit to branch wip-container
in repository guix.

commit 7fd0a53a30390b2800975176e1359daca228554b
Author: David Thompson <address@hidden>
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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]