mbox series

[bug#40631,0/4] Build QEMU with smartcard support, to get GNOME Boxes working

Message ID 877dyh7tcn.fsf@cbaines.net
Headers show
Series Build QEMU with smartcard support, to get GNOME Boxes working | expand

Message

Christopher Baines April 14, 2020, 7:36 p.m. UTC
These patches make it possible to use gnome-boxes, at least for the
simple virtual machine I tried to run.

Previously, I was stuck with the following error:

  Unable to start domain: unsupported configuration: this QEMU binary
  lacks smartcard passthrough mode support



Christopher Baines (4):
  gnu: Add softhsm.
  gnu: Add libcacard.
  gnu: qemu: Add libcacard as an input to enable smartcard support.
  gnu: spice: Add libcacard as an input to enable smartcard support.

 gnu/packages/security-token.scm | 28 +++++++++++++++++++
 gnu/packages/spice.scm          | 49 +++++++++++++++++++++++++++++++++
 gnu/packages/virtualization.scm |  1 +
 3 files changed, 78 insertions(+)

Comments

Brice Waegeneire April 28, 2020, 9:07 a.m. UTC | #1
Hello Christopher,

I was thinking of packaging libcacard the other day, thankfully you've 
already
done it.

If I understand correctly softhsm is needed to test libcacard, but it's 
tests
can't be enabled because our gnutls is missing some features and 
rebuilding it
would rebuild the world, right?

> +    (name "softhsm")
> +    (version "2.5.0")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append
> +                    "https://dist.opendnssec.org/source/"
> +                    "softhsm-" version ".tar.gz"))

The latest version is 2.6.0, even though the home-page don't list it, 
it's present
in the source you defined or in their Github page[0].


> +         (add-after 'unpack 'patch
> +           (lambda* (#:key inputs #:allow-other-keys)
> +             (substitute* "tests/setup-softhsm2.sh"
> +               (("\\/usr\\/lib64\\/pkcs11\\/libsofthsm2\\.so")
> +                (string-append (assoc-ref inputs "softhsm")
> +                               "/lib/softhsm/libsofthsm2.so")))
> +             #t)))))

Instead of 'patch' 'patch-tests' would be more descriptive.

LGTM otherwise, building and linting is successful.

[0]: https://github.com/opendnssec/SoftHSMv2/releases

- Brice
Brice Waegeneire April 28, 2020, 10:11 a.m. UTC | #2
> +    (description
> +     "The @acronym{CAC,Common Access Card} library can be used to 
> emulate and
> +share smart cards from client system to local or remote virtual 
> machines.")
> +    (home-page "https://gitlab.freedesktop.org/spice/libcacard")
> +    (license license:lgpl2.1+)))

I just founded out that 'acronym' isn't displayed at all by “guix show“
producing “The library can be used [...]”, it can be replaced by 'dfn'
which is displayed quoted: “The "CAC" library can be used [...]”. I wish
“guix lint“ would display 'acronym' which seems more usefull than 
'defn'.

- Brice
Christopher Baines May 3, 2020, 9:43 a.m. UTC | #3
Brice Waegeneire <brice@waegenei.re> writes:

> I was thinking of packaging libcacard the other day, thankfully you've
> already
> done it.
>
> If I understand correctly softhsm is needed to test libcacard, but
> it's tests
> can't be enabled because our gnutls is missing some features and
> rebuilding it
> would rebuild the world, right?

Yep, I've got a bug open for that change [1].

1: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40654

>> +    (name "softhsm")
>> +    (version "2.5.0")
>> +    (source (origin
>> +              (method url-fetch)
>> +              (uri (string-append
>> +                    "https://dist.opendnssec.org/source/"
>> +                    "softhsm-" version ".tar.gz"))
>
> The latest version is 2.6.0, even though the home-page don't list it,
> it's present
> in the source you defined or in their Github page[0].

Ah, interesting, I've updated the package to 2.6.1.

>> +         (add-after 'unpack 'patch
>> +           (lambda* (#:key inputs #:allow-other-keys)
>> +             (substitute* "tests/setup-softhsm2.sh"
>> +               (("\\/usr\\/lib64\\/pkcs11\\/libsofthsm2\\.so")
>> +                (string-append (assoc-ref inputs "softhsm")
>> +                               "/lib/softhsm/libsofthsm2.so")))
>> +             #t)))))
>
> Instead of 'patch' 'patch-tests' would be more descriptive.

Sure, I've changed the phase name.

> LGTM otherwise, building and linting is successful.

Great, I've gone ahead and pushed these patches as
17adb70f78b34a490b8e692f1a110cef72097685.

Thanks for taking a look!

Chris
Christopher Baines May 3, 2020, 9:45 a.m. UTC | #4
Brice Waegeneire <brice@waegenei.re> writes:

>> +    (description
>> +     "The @acronym{CAC,Common Access Card} library can be used to
>> emulate and
>> +share smart cards from client system to local or remote virtual
>> machines.")
>> +    (home-page "https://gitlab.freedesktop.org/spice/libcacard")
>> +    (license license:lgpl2.1+)))
>
> I just founded out that 'acronym' isn't displayed at all by “guix show“
> producing “The library can be used [...]”, it can be replaced by 'dfn'
> which is displayed quoted: “The "CAC" library can be used [...]”. I wish
> “guix lint“ would display 'acronym' which seems more usefull than
> 'defn'.

So this is/was a bug in Guile [1] and should be fixed as of Guile 3.0.1
[2].

1: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=37846
2: https://lists.gnu.org/archive/html/guile-devel/2020-03/msg00012.html