* gnu/system/file-systems.scm (spec->file-system): Remove variable.
* gnu/system/linux-container.scm (container-script): Refactor.
---
 gnu/system/file-systems.scm    | 11 -----------
 gnu/system/linux-container.scm |  6 ++----
 2 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index 4cc1221..b51d57f 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -40,7 +40,6 @@
             file-system-dependencies
 
             file-system->spec
-            spec->file-system
             specification->file-system-mapping
             uuid
 
@@ -108,16 +107,6 @@ initrd code."
     (($ <file-system> device title mount-point type flags options _ _ check?)
      (list device title mount-point type flags options check?))))
 
-(define (spec->file-system sexp)
-  "Deserialize SEXP, a list, to the corresponding <file-system> object."
-  (match sexp
-    ((device title mount-point type flags options check?)
-     (file-system
-       (device device) (title title)
-       (mount-point mount-point) (type type)
-       (flags flags) (options options)
-       (check? check?)))))
-
 (define (specification->file-system-mapping spec writable?)
   "Read the SPEC and return the corresponding <file-system-mapping>.  SPEC is
 a string of the form \"SOURCE\" or \"SOURCE=TARGET\".  The former specifies
diff --git a/gnu/system/linux-container.scm b/gnu/system/linux-container.scm
index 24e61c3..0146df1 100644
--- a/gnu/system/linux-container.scm
+++ b/gnu/system/linux-container.scm
@@ -81,8 +81,7 @@ MAPPINGS is a list of <file-system> objects that specify the 
files/directories
 that will be shared with the host system."
   (let* ((os           (containerized-operating-system os mappings))
          (file-systems (filter file-system-needed-for-boot?
-                               (operating-system-file-systems os)))
-         (specs        (map file-system->spec file-systems)))
+                               (operating-system-file-systems os))))
 
     (mlet* %store-monad ((os-drv (operating-system-derivation
                                   os
@@ -94,10 +93,9 @@ that will be shared with the host system."
                                   (gnu build linux-container)))
           #~(begin
               (use-modules (gnu build linux-container)
-                           (gnu system file-systems) ;spec->file-system
                            (guix build utils))
 
-              (call-with-container (map spec->file-system '#$specs)
+              (call-with-container #$file-systems
                 (lambda ()
                   (setenv "HOME" "/root")
                   (setenv "TMPDIR" "/tmp")
-- 
2.9.0

Reply via email to