aboutsummaryrefslogtreecommitdiff
path: root/gnu/build/file-systems.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-09-30 12:01:32 +0200
committerLudovic Courtès <ludo@gnu.org>2016-09-30 12:05:27 +0200
commit79355ae3e84359716f5135cc7083e72246bc8bf9 (patch)
tree6b61851e2153581578bb78ef0f177b8841ee5db7 /gnu/build/file-systems.scm
parent39d6b9c99f297e14fc4f47f002be3d40556726be (diff)
parent86d8f6d3efb8300a3354735cbf06be6c01e23243 (diff)
downloadguix-79355ae3e84359716f5135cc7083e72246bc8bf9.tar
guix-79355ae3e84359716f5135cc7083e72246bc8bf9.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/build/file-systems.scm')
-rw-r--r--gnu/build/file-systems.scm34
1 files changed, 12 insertions, 22 deletions
diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
index f277cbfa34..f1fccbdf2e 100644
--- a/gnu/build/file-systems.scm
+++ b/gnu/build/file-systems.scm
@@ -19,6 +19,7 @@
(define-module (gnu build file-systems)
#:use-module (guix build utils)
#:use-module (guix build bournish)
+ #:use-module (guix build syscalls)
#:use-module (rnrs io ports)
#:use-module (rnrs bytevectors)
#:use-module (ice-9 match)
@@ -41,17 +42,16 @@
uuid->string
string->uuid
- MS_RDONLY
- MS_NOSUID
- MS_NODEV
- MS_NOEXEC
- MS_BIND
- MS_MOVE
bind-mount
mount-flags->bit-mask
check-file-system
- mount-file-system))
+ mount-file-system)
+ #:re-export (mount
+ umount
+ MS_BIND
+ MS_MOVE
+ MS_RDONLY))
;;; Commentary:
;;;
@@ -61,21 +61,11 @@
;;; Code:
;; 'mount' is already defined in the statically linked Guile used for initial
-;; RAM disks, but in all other cases the (guix build syscalls) module contains
-;; the mount binding.
-(eval-when (expand load eval)
- (unless (defined? 'mount)
- (module-use! (current-module)
- (resolve-interface '(guix build syscalls)))))
-
-;; Linux mount flags, from libc's <sys/mount.h>.
-(define MS_RDONLY 1)
-(define MS_NOSUID 2)
-(define MS_NODEV 4)
-(define MS_NOEXEC 8)
-(define MS_REMOUNT 32)
-(define MS_BIND 4096)
-(define MS_MOVE 8192)
+;; RAM disks, in which case the bindings in (guix build syscalls) do not work
+;; (the FFI bindings do not work there). Override them in that case.
+(when (module-defined? the-scm-module 'mount)
+ (set! mount (@ (guile) mount))
+ (set! umount (@ (guile) umount)))
(define (bind-mount source target)
"Bind-mount SOURCE at TARGET."