Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 358119 - app-crypt/scl011-2.06 new package
Summary: app-crypt/scl011-2.06 new package
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: Normal enhancement (vote)
Assignee: Default Assignee for New Packages
URL: http://www.scmmicro.com/de/products-s...
Whiteboard:
Keywords: EBUILD
Depends on:
Blocks:
 
Reported: 2011-03-09 19:28 UTC by Christoph Brill (egore) (RESIGNED)
Modified: 2011-04-15 17:40 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
scl011-bin-2.06.ebuild (scl011-bin-2.06.ebuild,1.13 KB, text/plain)
2011-03-09 19:29 UTC, Christoph Brill (egore) (RESIGNED)
Details
SCM-MICRO (SCM-MICRO,7.49 KB, text/plain)
2011-03-09 19:30 UTC, Christoph Brill (egore) (RESIGNED)
Details
lsusb.txt (lsusb.txt,2.58 KB, text/plain)
2011-03-10 20:11 UTC, Christoph Brill (egore) (RESIGNED)
Details
92_pcscd_scl011-bin.rules (92_pcscd_scl011-bin.rules,332 bytes, text/plain)
2011-03-10 20:21 UTC, Christoph Brill (egore) (RESIGNED)
Details
scl011-bin-2.06.ebuild (scl011-bin-2.06.ebuild,1.23 KB, text/plain)
2011-03-10 20:35 UTC, Christoph Brill (egore) (RESIGNED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Brill (egore) (RESIGNED) 2011-03-09 19:28:19 UTC
I recently got a card reader for the nPA (new German identification card). SCM Microsystems provides a binary x86 and amd64 driver for pcsc-lite. I wrote a small ebuild for it to ease installation.

I'll attach it and it is also available in my overlay: http://cgit.freedesktop.org/~cbrill/egore911-overlay

Reproducible: Always
Comment 1 Christoph Brill (egore) (RESIGNED) 2011-03-09 19:29:35 UTC
Created attachment 265339 [details]
scl011-bin-2.06.ebuild
Comment 2 Christoph Brill (egore) (RESIGNED) 2011-03-09 19:30:13 UTC
Created attachment 265341 [details]
SCM-MICRO

necessary license file
Comment 3 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-03-10 14:19:54 UTC
@base-system / @crypto:

Anyone interested in this package?
Comment 4 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-03-10 14:42:47 UTC
@base-system:

Sorry for the noise but I misread the metadata for pcsc-lite.
Comment 5 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-03-10 15:17:22 UTC
I think this needs at least an udev file to set the proper permission on the device or it won't work with modern pcsc-lite at least when starting pcscd as a service.

Christoph do you feel like being the proxy maintainer? It really isn't the kind of package that we can deal with without the hardware unfortunately; that's why I keep hardware around just to test this stuff.

License team can you please verify the license as well? Thanks.
Comment 6 Ulrich Müller gentoo-dev 2011-03-10 15:45:36 UTC
Comment on attachment 265341 [details]
SCM-MICRO

(In reply to comment #5)
> License team can you please verify the license as well?

I think that the license should be added to the @EULA group.
And by clause 3 of the license, the ebuild needs RESTRICT="mirror bindist".
Comment 7 Christoph Brill (egore) (RESIGNED) 2011-03-10 19:12:27 UTC
(In reply to comment #5)
> I think this needs at least an udev file to set the proper permission on the
> device or it won't work with modern pcsc-lite at least when starting pcscd as a
> service.

I plugged in the device and started pcscd manually, worked flawless. Having a udev rule tarting pcscd would be much better though.

> Christoph do you feel like being the proxy maintainer? It really isn't the kind
> of package that we can deal with without the hardware unfortunately; that's why
> I keep hardware around just to test this stuff.

Sure! I'm interested in keeping the package up to date. The device will become quite common in Germany as it's being offered for free to increase acceptance of the nPA. I'm currently trying to get access to the "big brother" of this device (an SDI011).

(In reply to comment #6)
> I think that the license should be added to the @EULA group.
> And by clause 3 of the license, the ebuild needs RESTRICT="mirror bindist".

Both sounds reasonable to me (I'm very far from knowning licenses).

Can someone comment on how the ebuild was written? I'm especially interested in the 32 vs. 64 bit stuff I did.
Comment 8 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-03-10 19:47:47 UTC
Uhm how did you start pcscd? AFAICT the device wouldn't be accessible by default by the user nobody pcscd init script starts it from. Can you provide the lsusb -v output for that device?

You can just look up the basic udev rules used by app-crypt/ccid to see how it should be auto-started (setting the PCSCD env variable is enough, pcsc-lite takes care of changing owner and starting the service).

The ebuild looks good to me; I'd have used a more compact form to switch between the two files during install but it's fine. I guess the only last thing to do is prepending -* in front of KEYWORDS: binary packages cannot work on other architectures anyway, and it's a signal for arches not to bother trying.
Comment 9 Christoph Brill (egore) (RESIGNED) 2011-03-10 20:11:57 UTC
Created attachment 265491 [details]
lsusb.txt
Comment 10 Christoph Brill (egore) (RESIGNED) 2011-03-10 20:21:58 UTC
Created attachment 265493 [details]
92_pcscd_scl011-bin.rules
Comment 11 Christoph Brill (egore) (RESIGNED) 2011-03-10 20:35:08 UTC
Created attachment 265495 [details]
scl011-bin-2.06.ebuild
Comment 12 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-03-10 20:40:27 UTC
Rules look good (although for consistency I'd suggest naming them 92-pcscd-scl011-bin.rules — I should rename ccid's as well).

Now though I'm wondering whether the SCM is not a standard CCID device in hiding.. would you be up to doing some hacking at ccid and see if it behaves? :)

Keep the rules file, but don't install the driver itself, then hack ccid's readers/supported_readers.txt to list your device VID/PID as well. Restart pcsc-lite and use pcsc_scan (from pcsc-tools) to see if it detects your card.

I'm sure Ludovic would love to hear if it works.
Comment 13 Christoph Brill (egore) (RESIGNED) 2011-03-10 20:47:45 UTC
(In reply to comment #8)
> Uhm how did you start pcscd? AFAICT the device wouldn't be accessible by
> default by the user nobody pcscd init script starts it from.

I basically did a "pcscd -fd" and a "pcsc_scan" to verify reading the cards
data works.

> Can you provide the lsusb -v output for that device?

Sure, see attachment #265491 [details]

> You can just look up the basic udev rules used by app-crypt/ccid to see how it
> should be auto-started (setting the PCSCD env variable is enough, pcsc-lite
> takes care of changing owner and starting the service).

I added an experimental udev file (attachment #265493 [details]) but I don't really know
udev rules (yet). It does not seem to work and I don't really really know how
to debug this (cause I don't really know what to expect).

> The ebuild looks good to me; I'd have used a more compact form to switch
> between the two files during install but it's fine. I guess the only last thing
> to do is prepending -* in front of KEYWORDS: binary packages cannot work on
> other architectures anyway, and it's a signal for arches not to bother trying.

I uploaded an updated version with adapted keywords.
Comment 14 Christoph Brill (egore) (RESIGNED) 2011-03-10 20:59:32 UTC
Tried hacking around, but didn't get it to work. And according to supported_readers.txt this won't work ...

> # Bogus readers but partly supported
> # See the http://pcsclite.alioth.debian.org/ccid/unsupported.html for a
> # description of the problem(s)
> ...
> #0x04E6:0x5292:SCM SCL01x Contactless Reader
Comment 15 Christoph Brill (egore) (RESIGNED) 2011-03-10 21:11:12 UTC
Something seems to be wrong with the rules file, I think.

If I "/etc/init.d/pcscd start" and plug in the device it works.

If I stop pcscd (and restart udev) and plug in the device i get:

pcscd: *** glibc detected *** /usr/sbin/pcscd: free(): invalid pointer: 0x000000000260e600 ***
Comment 16 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-03-10 22:26:12 UTC
Okay if you start it as root or as your user you shouldn't have the problem with nobody, but the udev file is required to get it to set the proper device permissions.

Which version of pcsc-lite are you using? 1.7.0 has changed the hotplug system and I wouldn't be surprised if it failed to work properly, if you were using that try 1.6.7, otherwise do the other way around ;)

If you are around on IRC tomorrow we can debug the udev rules together, then I'll import this and seeing whether ccid can work or not should become a non-issue (although I wouldn't mind if you were to help me out to take a further look at that — I have already had to work on ccid to make two of my devices work properly, but now it's much less painful to deal with them).
Comment 17 Christoph Brill (egore) (RESIGNED) 2011-03-11 08:13:48 UTC
(In reply to comment #16)
> Okay if you start it as root or as your user you shouldn't have the problem
> with nobody, but the udev file is required to get it to set the proper device
> permissions.

Yeah, always did this as root.

> Which version of pcsc-lite are you using? 1.7.0 has changed the hotplug system
> and I wouldn't be surprised if it failed to work properly, if you were using
> that try 1.6.7, otherwise do the other way around ;)

I was using 1.7.0. Using scl011-bin together with 1.6.7 the udev rule file works flawless. It also allows a normal user (non-root) to run pcsc_scan sucessfully. Thanks for the suggestion!

> If you are around on IRC tomorrow we can debug the udev rules together, then
> I'll import this and seeing whether ccid can work or not should become a
> non-issue (although I wouldn't mind if you were to help me out to take a
> further look at that — I have already had to work on ccid to make two of my
> devices work properly, but now it's much less painful to deal with them).

Using ccid together with 1.6.7 seems to bring up the device (LED is on) but pcsc_scan does not find a reader. I'll try to join #gentoo tonight, should be much faster than "chatting" using bugzilla ;-) Having ccid to support the device would be much better than shipping a binary blob, IMO.
Comment 18 Christoph Brill (egore) (RESIGNED) 2011-03-15 07:56:53 UTC
Sorry for the delay, RL interrupted me.

I could find you on IRC, guess I don't know your nickname :-) The usual suspects (e.g. "flameeyes", "dpetteno", etc.) did not show any results (or maybe I was blind). Anyway, I'll try to find you again.
Comment 19 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-03-15 13:06:19 UTC
Just query me as Flameeyes ;)
Comment 20 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-03-30 09:40:01 UTC
Christoph can you try and see if the crash is gone with pcsc-lite-1.7.1 that I just added to the tree? Thanks!
Comment 21 Christoph Brill (egore) (RESIGNED) 2011-04-01 07:06:31 UTC
(In reply to comment #20)
> Christoph can you try and see if the crash is gone with pcsc-lite-1.7.1 that I
> just added to the tree? Thanks!

Still the same. Starting pcscd manually using "/etc/init.d/pcscd start" works. Plugging in the device causes pcsc-lite to crash (even though it no longer prints an error to the log) :-/
Comment 22 Christoph Brill (egore) (RESIGNED) 2011-04-02 09:38:26 UTC
(In reply to comment #21)
> Still the same. Starting pcscd manually using "/etc/init.d/pcscd start" works.
> Plugging in the device causes pcsc-lite to crash (even though it no longer
> prints an error to the log) :-/

Also tested against 1.7.2 no changes :-(
Comment 23 Christoph Brill (egore) (RESIGNED) 2011-04-14 21:07:38 UTC
Just tested the driver against pcsc-lite 1.7.2-r1 and it works.
Comment 24 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-04-15 17:40:24 UTC
Thanks Christoph, committed now with you as proxy maintainer. I have made a couple of changes to the ebuild btw, nothing major though, but give it a look.