From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewKEN-0004YL-D0 for guix-patches@gnu.org; Thu, 15 Mar 2018 00:11:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewKEI-0000Zp-OM for guix-patches@gnu.org; Thu, 15 Mar 2018 00:11:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:54225) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ewKEI-0000Zj-L8 for guix-patches@gnu.org; Thu, 15 Mar 2018 00:11:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ewKEI-000111-GB for guix-patches@gnu.org; Thu, 15 Mar 2018 00:11:02 -0400 Subject: [bug#30572] [PATCH 4/7] gnu: When building in a VM, share a temporary directory. Resent-Message-ID: From: Chris Marusich Date: Thu, 15 Mar 2018 05:09:12 +0100 Message-Id: <20180315040915.5556-5-cmmarusich@gmail.com> In-Reply-To: <20180315040915.5556-1-cmmarusich@gmail.com> References: <20180222102933.4978-1-cmmarusich@gmail.com> <20180315040915.5556-1-cmmarusich@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: bug#30572 <30572@debbugs.gnu.org> Cc: Chris Marusich * gnu/build/vm.scm (load-in-linux-vm): Make a shared temporary directory available in the VM. * gnu/system/vm.scm (%linux-vm-file-systems): Add a corresponding entry. --- gnu/build/vm.scm | 7 +++++++ gnu/system/vm.scm | 12 ++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm index 6380df0a1..806744a64 100644 --- a/gnu/build/vm.scm +++ b/gnu/build/vm.scm @@ -128,6 +128,7 @@ the #:references-graphs parameter of 'derivation'." (error "qemu-img failed"))) (mkdir "xchg") + (mkdir "tmp") (match references-graphs ((graph-files ...) @@ -149,6 +150,12 @@ the #:references-graphs parameter of 'derivation'." "-virtfs" (string-append "local,id=xchg_dev,path=xchg" ",security_model=none,mount_tag=xchg") + "-virtfs" + ;; Some programs require more space in /tmp than is normally + ;; available in the guest. Accommodate such programs by + ;; sharing a temporary directory. + (string-append "local,id=tmp_dev,path=tmp" + ",security_model=none,mount_tag=tmp") "-kernel" linux "-initrd" initrd "-append" (string-append "console=ttyS0 --load=" diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index ae8780d2e..d239fa56a 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2016, 2017 Leo Famulari ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2017 Marius Bakke +;;; Copyright © 2018 Chris Marusich ;;; ;;; This file is part of GNU Guix. ;;; @@ -87,8 +88,8 @@ ;;; Code: (define %linux-vm-file-systems - ;; File systems mounted for 'derivation-in-linux-vm'. The store and /xchg - ;; directory are shared with the host over 9p. + ;; File systems mounted for 'derivation-in-linux-vm'. These are shared with + ;; the host over 9p. (list (file-system (mount-point (%store-prefix)) (device "store") @@ -102,6 +103,13 @@ (type "9p") (needed-for-boot? #t) (options "trans=virtio") + (check? #f)) + (file-system + (mount-point "/tmp") + (device "tmp") + (type "9p") + (needed-for-boot? #t) + (options "trans=virtio") (check? #f)))) (define* (expression->derivation-in-linux-vm name exp -- 2.15.1