aboutsummaryrefslogtreecommitdiff
path: root/guix/build
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-01-31 12:21:10 +0100
committerLudovic Courtès <ludo@gnu.org>2014-01-31 12:52:13 +0100
commit4919d68432c69d386300053b0de178f9efb0334f (patch)
tree335ee5f200ac3662972a5fea30f4e651e0bd227a /guix/build
parent217b862f0e8dfac18874f9c6ec8cafdb2471b4fb (diff)
downloadgnu-guix-4919d68432c69d386300053b0de178f9efb0334f.tar
gnu-guix-4919d68432c69d386300053b0de178f9efb0334f.tar.gz
gnu: linux-initrd: Recognize 9p file systems.
* gnu/system/linux-initrd.scm (qemu-initrd)[virtio-9p-modules]: New variable. [linux-modules]: Append VIRTIO-9P-MODULES when a 9p file system is in MOUNTS. * guix/build/linux-initrd.scm (mount-qemu-9p): New procedure. (boot-system): Recognize '9p' in MOUNTS, and use 'mount-qemu-9p'.
Diffstat (limited to 'guix/build')
-rw-r--r--guix/build/linux-initrd.scm18
1 files changed, 16 insertions, 2 deletions
diff --git a/guix/build/linux-initrd.scm b/guix/build/linux-initrd.scm
index b9fc9b1523..7b22354f70 100644
--- a/guix/build/linux-initrd.scm
+++ b/guix/build/linux-initrd.scm
@@ -30,6 +30,7 @@
make-essential-device-nodes
configure-qemu-networking
mount-qemu-smb-share
+ mount-qemu-9p
bind-mount
load-linux-module*
device-number
@@ -145,6 +146,17 @@ Vanilla QEMU's `-smb' option just exports a /qemu share, whereas our
(mount (string-append "//" server share) mount-point "cifs" 0
(string->pointer "guest,sec=none"))))
+(define (mount-qemu-9p source mount-point)
+ "Mount QEMU's 9p file system from SOURCE at MOUNT-POINT.
+
+This uses the 'virtio' transport, which requires the various virtio Linux
+modules to be loaded."
+
+ (format #t "mounting QEMU's 9p share '~a'...\n" source)
+ (let ((server "10.0.2.4"))
+ (mount source mount-point "9p" 0
+ (string->pointer "trans=virtio"))))
+
(define (bind-mount source target)
"Bind-mount SOURCE at TARGET."
(define MS_BIND 4096) ; from libc's <sys/mount.h>
@@ -242,8 +254,10 @@ the new root."
(let ((target (string-append "/root/" target)))
(mkdir-p target)
(mount-qemu-smb-share source target)))
- ;; TODO: Add 9p.
- )
+ (('9p source target)
+ (let ((target (string-append "/root/" target)))
+ (mkdir-p target)
+ (mount-qemu-9p source target))))
mounts)
(when guile-modules-in-chroot?