From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUc79-0004hY-0l for guix-patches@gnu.org; Thu, 28 Dec 2017 12:37:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eUc74-0004Lk-RS for guix-patches@gnu.org; Thu, 28 Dec 2017 12:37:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:46720) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eUc74-0004LX-KL for guix-patches@gnu.org; Thu, 28 Dec 2017 12:37:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eUc74-0003kn-AQ for guix-patches@gnu.org; Thu, 28 Dec 2017 12:37:02 -0500 Subject: [bug#29875] [PATCH] gnu: qemu: Add wrapper for Samba. Resent-Message-ID: From: Marius Bakke In-Reply-To: <20171228093234.42b99416@mykolab.com> References: <20171228093234.42b99416@mykolab.com> Date: Thu, 28 Dec 2017 18:35:55 +0100 Message-ID: <87bmiidabo.fsf@fastmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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: Rutger Helling , 29875@debbugs.gnu.org, ludo@gnu.org --=-=-= Content-Type: text/plain Rutger Helling writes: > This patch adds a small hack to get Samba support working on QEMU, > without actually pulling it in as an input. Awesome :) > It seems to work surprisingly well. The only bad thing is that you need > to explicitly install Samba in your profile for Samba support. There's > no error if you try to run something like -net user,smb=/tmp without > having Samba installed in your profile. QEMU will just merrily keep on > running while not actually starting a Samba server. Huh, I would have expected a warning at least. But not complaining :) > I've also updated the URL of QEMU. Can you push that as a separate patch? > From f45a7663f646b195222dc4426b19884147051f05 Mon Sep 17 00:00:00 2001 > From: Rutger Helling > Date: Thu, 28 Dec 2017 08:57:28 +0100 > Subject: [PATCH] gnu: qemu: Add wrapper for Samba. > > * gnu/packages/virtualization.scm (qemu)[arguments]: Change #:configure-flags to > a list, add --smbd flag. Add 'create-samba-wrapper phase. > [home-page]: Update URL. [...] > diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm > index 0e4feb7b1..1584580ad 100644 > --- a/gnu/packages/virtualization.scm > +++ b/gnu/packages/virtualization.scm > @@ -96,7 +96,10 @@ > '(;; Running tests in parallel can occasionally lead to failures, like: > ;; boot_sector_test: assertion failed (signature == SIGNATURE): (0x00000000 == 0x0000dead) > #:parallel-tests? #f > - #:configure-flags '("--enable-usb-redir" "--enable-opengl") > + #:configure-flags (list "--enable-usb-redir" "--enable-opengl" > + (string-append "--smbd=" > + (assoc-ref %outputs "out") > + "/libexec/samba-wrapper")) Reading the script, would it work to simply pass "--smbd=smbd" here? [...] > + ;; Create a wrapper for Samba. This allows QEMU to use Samba without > + ;; pulling it in as an input. Note that you need to explicitly install > + ;; Samba in your Guix profile for Samba support. > + (add-after 'install-info 'create-samba-wrapper > + (lambda* (#:key inputs outputs #:allow-other-keys) > + (let* ((out (assoc-ref %outputs "out")) > + (libexec (string-append out "/libexec"))) > + (system* "touch" "samba-wrapper") > + (call-with-output-file "samba-wrapper" > + (lambda (port) > + (format port "#!/bin/sh > + exec smbd $@"))) > + (chmod "samba-wrapper" #o755) > + (install-file "samba-wrapper" libexec)) > + #t)) The "touch" here is unnecessary. If the above is insufficient, this LGTM. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlpFK3sACgkQoqBt8qM6 VPpAKAgArAIqa6B1PjA347o558HpOtf8Dt6vkT9fGhuJXzBfnYiLqDtby/+1ymKj Na/lefvcHrzaKDdKTnPsZNrwEPyOow68YOZeB3ppRoZ9RNvOI1uFoXvUXaf9rYJZ 0csPkM1NXbWkmbXtz7VfRDKVUDFa6DDwDdxeLHPXYTljJ2m3uSdXWI6s+dY4pXyr MXpCN05qMJgzoy6zsfDrwtQiKYGWc00Iev3YydVRVsKdh1ekFiVr8BDxEctSpO2v PTY4doobitVl9EyHOtIXOkhc1pgwM2yZHHebhaftF5xt5i7bHFDZPQUE7mWBWhSB 5p8rA7NBqZzO/tOpF4y5VOGmqLHSNQ== =sbH9 -----END PGP SIGNATURE----- --=-=-=--