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:
+10
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user