1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-26 11:01:48 +02:00

container: Pass a list of <file-system> objects as things to mount.

* gnu/build/linux-container.scm (mount-file-systems): 'mounts' is now a
list of <file-system> objects instead of a list of lists ("specs").
Add call to 'file-system->spec' as the argument to 'mount-file-system'.
(run-container, call-with-container): Adjust docstring accordingly.
* gnu/system/file-systems.scm (spec->file-system): New procedure.
* gnu/system/linux-container.scm (container-script)[script]: Call
'spec->file-system' inside gexp.
* guix/scripts/environment.scm (launch-environment/container): Remove
call to 'file-system->spec'.
* tests/containers.scm ("call-with-container, mnt namespace")
("call-with-container, mnt namespace, wrong bind mount"): Pass a list of
<file-system> objects.
This commit is contained in:
Ludovic Courtès
2016-11-10 17:45:54 +01:00
parent 5e7eaccb14
commit 5970e8e248
5 changed files with 35 additions and 13 deletions
+10 -3
View File
@@ -20,6 +20,7 @@
#:use-module (guix utils)
#:use-module (guix build syscalls)
#:use-module (gnu build linux-container)
#:use-module (gnu system file-systems)
#:use-module (srfi srfi-64)
#:use-module (ice-9 match))
@@ -80,7 +81,10 @@
(skip-if-unsupported)
(test-assert "call-with-container, mnt namespace"
(zero?
(call-with-container '(("none" device "/testing" "tmpfs" () #f #f))
(call-with-container (list (file-system
(device "none")
(mount-point "/testing")
(type "tmpfs")))
(lambda ()
(assert-exit (file-exists? "/testing")))
#:namespaces '(user mnt))))
@@ -91,8 +95,11 @@
;; An exception should be raised; see <http://bugs.gnu.org/23306>.
(catch 'system-error
(lambda ()
(call-with-container '(("/does-not-exist" device "/foo"
"none" (bind-mount) #f #f))
(call-with-container (list (file-system
(device "/does-not-exist")
(mount-point "/foo")
(type "none")
(flags '(bind-mount))))
(const #t)
#:namespaces '(user mnt)))
(lambda args