[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#29875: [PATCH] gnu: qemu: Add wrapper for Samba.
From: |
Rutger Helling |
Subject: |
bug#29875: [PATCH] gnu: qemu: Add wrapper for Samba. |
Date: |
Fri, 29 Dec 2017 00:07:31 +0100 |
Hi Marius,
thanks for the review! I've pushed it as two seperate patches, minus
the "touch" command.
I tried the "--smbd=smbd" command and a bunch of variants,
unfortunately that just causes QEMU to complain about missing smbd and
quit immediately.
On Thu, 28 Dec 2017 18:35:55 +0100
Marius Bakke <address@hidden> wrote:
> Rutger Helling <address@hidden> 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 <address@hidden>
> > 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.
pgpABxrPll014.pgp
Description: OpenPGP digital signature