~ruther/guix-local

161ed5476d27a69bbb940fd4a76f67976bd1d91e — Ludovic Courtès 13 years ago d510ab4
gnu: qemu-kvm: Add patch to have multiple SMB shares.

* gnu/packages/qemu.scm (qemu-kvm/smb-shares): New variable.
* gnu/packages/patches/qemu-multiple-smb-shares.patch: New file.
* Makefile.am (dist_patch_DATA): Add it.
3 files changed, 34 insertions(+), 0 deletions(-)

M Makefile.am
A gnu/packages/patches/qemu-multiple-smb-shares.patch
M gnu/packages/qemu.scm
M Makefile.am => Makefile.am +1 -0
@@ 202,6 202,7 @@ dist_patch_DATA =						\
  gnu/packages/patches/mcron-install.patch			\
  gnu/packages/patches/perl-no-sys-dirs.patch			\
  gnu/packages/patches/procps-make-3.82.patch			\
  gnu/packages/patches/qemu-multiple-smb-shares.patch		\
  gnu/packages/patches/readline-link-ncurses.patch		\
  gnu/packages/patches/shishi-gets-undeclared.patch		\
  gnu/packages/patches/tar-gets-undeclared.patch		\

A gnu/packages/patches/qemu-multiple-smb-shares.patch => gnu/packages/patches/qemu-multiple-smb-shares.patch +20 -0
@@ 0,0 1,20 @@
This file extends `-smb' to add a share for the Nix store, and changes
the name of the default share.

--- a/net/slirp.c
+++ b/net/slirp.c
@@ -515,8 +515,12 @@ static int slirp_smb(SlirpState* s, const char *exported_dir,
             "log file=%s/log.smbd\n"
             "smb passwd file=%s/smbpasswd\n"
             "security = share\n"
-            "[qemu]\n"
-            "path=%s\n"
+            "[store]\n"
+            "path=/nix/store\n"
+            "read only=yes\n"
+            "guest ok=yes\n"
+            "[xchg]\n"
+            "path=%s/xchg\n"
             "read only=no\n"
             "guest ok=yes\n",
             s->smb_dir,

M gnu/packages/qemu.scm => gnu/packages/qemu.scm +13 -0
@@ 22,6 22,7 @@
  #:use-module (guix utils)
  #:use-module ((guix licenses) #:select (gpl2))
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages glib)


@@ 96,6 97,18 @@ underway to get the required changes upstream.")
    ;; Many files are GPLv2+, but some are GPLv2-only---e.g., `memory.c'.
    (license gpl2)))

(define-public qemu-kvm/smb-shares
  ;; A patched QEMU-KVM where `-net smb' yields two shares instead of one: one
  ;; for the store, and another one for exchanges with the host.
  (package (inherit qemu-kvm)
    (name "qemu-kvm-with-multiple-smb-shares")
    (inputs `(,@(package-inputs qemu-kvm)
              ("patch/smb-shares"
               ,(search-patch "qemu-multiple-smb-shares.patch"))))
    (arguments
     `(#:patches (list (assoc-ref %build-inputs "patch/smb-shares"))
       ,@(package-arguments qemu-kvm)))))

(define-public qemu
  ;; The real one, with a complete target list.
  (package (inherit qemu-kvm)