guix-commits
[Top][All Lists]
Advanced

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

07/08: gnu: system: Add operating-system-derivation/container.


From: David Thompson
Subject: 07/08: gnu: system: Add operating-system-derivation/container.
Date: Mon, 08 Jun 2015 15:57:35 +0000

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

commit c8e040e4ec2ae10794e8d3e9d86058147f4f99f1
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 8346a38..c822eca 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -79,6 +79,7 @@
             operating-system-activation-script
 
             operating-system-derivation
+            operating-system-derivation/container
             operating-system-profile
             operating-system-grub.cfg
 
@@ -772,11 +773,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
@@ -913,4 +915,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]