Skip to contentSkip to conversation

pcsc-lite and ccid support

PATCH New ruckuus at gmail.com 2 participants 7 messages Jul 12, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pcsc-lite and ccid support

From: Dwi Sasongko S <[email protected]>

Support for accessing USB smart card reader.

http://pcsclite.alioth.debian.org/

---
 package/Config.in              |    2 ++
 package/ccid/Config.in         |    6 ++++++
 package/ccid/ccid.mk           |   13 +++++++++++++
 package/pcsc-lite/Config.in    |    6 ++++++
 package/pcsc-lite/pcsc-lite.mk |   14 ++++++++++++++
 5 files changed, 41 insertions(+), 0 deletions(-)
 create mode 100644 package/ccid/Config.in
 create mode 100644 package/ccid/ccid.mk
 create mode 100644 package/pcsc-lite/Config.in
 create mode 100644 package/pcsc-lite/pcsc-lite.mk
package/Config.in +2 -0
index 09aa76a..db82d95 100644
@@ -303,6 +303,7 @@ source "package/libiqrf/Config.in"
 source "package/libusb/Config.in"
 source "package/libusb-compat/Config.in"
 source "package/python-serial/Config.in"
+source "package/pcsc-lite/Config.in"
 endmenu
 
 if BROKEN
@@ -342,6 +343,7 @@ source "package/libnspr/Config.in"
 source "package/liboil/Config.in"
 source "package/libsigc/Config.in"
 source "package/startup-notification/Config.in"
+source "package/ccid/Config.in"
 endmenu
 
 menu "Text and terminal handling"
package/ccid/Config.in new file +6 -0
new file mode 100644
index 0000000..d5ff34e
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_CCID
+	depends on BR2_PACKAGE_PCSC_LITE
+	bool "ccid"
+	help
+		Card reader driver
+
package/ccid/ccid.mk new file +13 -0
new file mode 100644
index 0000000..2eb2e4d
@@ -0,0 +1,13 @@
+##########################################################
+#
+# CCID
+#
+# ########################################################
+CCID_VERSION = 5706
+CCID_SITE = svn://anonscm.debian.org/pcsclite/trunk/Drivers/ccid
+CCID_INSTALL_STAGING = YES
+CCID_INSTALL_TARGET = YES
+CCID_AUTORECONF = YES
+CCID_DEPENDENCIES = pcsc-lite libusb
+
+$(eval $(call AUTOTARGETS, package, ccid))
package/pcsc-lite/Config.in new file +6 -0
new file mode 100644
index 0000000..51e32c8
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_PCSC_LITE
+	select BR2_PACKAGE_CCID
+	bool "pcsc-lite"
+	help
+		Middleware to be used with PC/SC
+
package/pcsc-lite/pcsc-lite.mk new file +14 -0
new file mode 100644
index 0000000..9457b75
@@ -0,0 +1,14 @@
+##########################################################
+#
+# PCSC-Lite
+#
+# ########################################################
+PCSC_LITE_VERSION = 5853
+PCSC_LITE_SITE = svn://anonscm.debian.org/pcsclite/trunk/PCSC
+PCSC_LITE_INSTALL_STAGING = YES
+PCSC_LITE_INSTALL_TARGET = YES
+PCSC_LITE_AUTORECONF = YES
+PCSC_LITE_CONF_OPT = --disable-libudev --enable-libusb --enable-embedded
+PCSC_LITE_DEPENDENCIES=libusb
+
+$(eval $(call AUTOTARGETS, package, pcsc-lite))
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 1/1 pcsc-lite and ccid support

Hello !

Thanks for those patches. A few comments below.

Le Tue, 12 Jul 2011 13:28:09 +0700,
ruckuus at gmail.com a ?crit :

package/ccid/Config.in line 2

Quoted 5 lines
package/ccid/Config.in new file +2 -0
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_CCID
+	depends on BR2_PACKAGE_PCSC_LITE

If I understood correctly ccid is a set of programs that depends on pcsc-lite which is a library ? If this is the case, then you should turn this into :

select BR2_PACKAGE_PCSC_LITE

This is because we prefer to have automatic selection of required dependencies.

package/ccid/Config.in line 5

Quoted 3 lines
package/ccid/Config.in new file +3 -0
+	bool "ccid"
+	help
+		Card reader driver

The help message should be intended with one tab + 2 spaces. The description could also be a little bit more elaborate (which type of hardware is supported, etc.). And we typically include the URL of the project. See other packages for examples.

package/ccid/Config.in

Quoted 7 lines
package/ccid/Config.in new file +7 -0
+##########################################################
+#
+# CCID
+#
+# ########################################################
+CCID_VERSION = 5706
+CCID_SITE = svn://anonscm.debian.org/pcsclite/trunk/Drivers/ccid

The latest ccid release is 1.4.4, dated May 2011, which doesn't seem to be that old. In general, we prefer using stable releases rather than SVN versions when possible. Do you have a good reason for choosing a specific SVN version instead of the latest project release ?

package/ccid/Config.in

Quoted 4 lines
package/ccid/Config.in new file +4 -0
+CCID_INSTALL_STAGING = YES
+CCID_INSTALL_TARGET = YES
+CCID_AUTORECONF = YES
+CCID_DEPENDENCIES = pcsc-lite libusb

If you depend on libusb here, then the CCID package should also:

select BR2_PACKAGE_LIBUSB

package/pcsc-lite/Config.in line 2

Quoted 9 lines

+$(eval $(call AUTOTARGETS, package, ccid))

package/pcsc-lite/Config.in new file +2 -0
new file mode 100644
index 0000000..51e32c8
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_PCSC_LITE
+	select BR2_PACKAGE_CCID

Is it pcsc that depends on ccid, or ccid that depends on pcsc ? According to your *_DEPENDENCIES variable, it's ccid that depends on pcsc-lite, so the "select BR2_PACKAGE_CCID" here should go away.

package/pcsc-lite/Config.in line 5

Quoted 3 lines
package/pcsc-lite/Config.in new file +3 -0
+	bool "pcsc-lite"
+	help
+		Middleware to be used with PC/SC

Same comment as above: indentation is tab + 2 spaces, more elaborate description, and project URL.

package/pcsc-lite/Config.in

Quoted 7 lines
package/pcsc-lite/Config.in new file +7 -0
+##########################################################
+#
+# PCSC-Lite
+#
+# ########################################################
+PCSC_LITE_VERSION = 5853
+PCSC_LITE_SITE = svn://anonscm.debian.org/pcsclite/trunk/PCSC

Same question, SVN version really needed ?

package/pcsc-lite/Config.in

Quoted 7 lines
package/pcsc-lite/Config.in new file +6 -1
+PCSC_LITE_INSTALL_STAGING = YES
+PCSC_LITE_INSTALL_TARGET = YES
+PCSC_LITE_AUTORECONF = YES
+PCSC_LITE_CONF_OPT = --disable-libudev --enable-libusb
--enable-embedded +PCSC_LITE_DEPENDENCIES=libusb
+
+$(eval $(call AUTOTARGETS, package, pcsc-lite))

Again, thanks for proposing those two packages!

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw

PATCH 1/1 pcsc-lite and ccid support

Hello again,

Thanks for the comments. My answer interpolated below.

Quoted 17 lines · Thomas Petazzoni

Hello !

Thanks for those patches. A few comments below.

Le Tue, 12 Jul 2011 13:28:09 +0700,
ruckuus at gmail.com a ?crit :

package/ccid/Config.in line 2

Quoted 5 lines
package/ccid/Config.in new file +2 -0
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_CCID
+ ? ? depends on BR2_PACKAGE_PCSC_LITE

If I understood correctly ccid is a set of programs that depends on pcsc-lite which is a library ? If this is the case, then you should turn this into :

Quoted 2 lines

? ? ? ?select BR2_PACKAGE_PCSC_LITE

Understood.

Quoted 12 lines

This is because we prefer to have automatic selection of required dependencies.

package/ccid/Config.in line 5

Quoted 3 lines
package/ccid/Config.in new file +3 -0
+ ? ? bool "ccid"
+ ? ? help
+ ? ? ? ? ? ? Card reader driver

The help message should be intended with one tab + 2 spaces. The description could also be a little bit more elaborate (which type of hardware is supported, etc.). And we typically include the URL of the project. See other packages for examples.

Understood.

Quoted 4 lines
Quoted 4 lines
package/ccid/Config.in new file +4 -0
+##########################################################
+#
+# CCID
+#
Quoted 9 lines

package/ccid/Config.in

Quoted 3 lines
package/ccid/Config.in new file +3 -0
+# ########################################################
+CCID_VERSION = 5706
+CCID_SITE = svn://anonscm.debian.org/pcsclite/trunk/Drivers/ccid

The latest ccid release is 1.4.4, dated May 2011, which doesn't seem to be that old. In general, we prefer using stable releases rather than SVN versions when possible. Do you have a good reason for choosing a specific SVN version instead of the latest project release ?

It should have been using the latest version.

The reason is somehow fuzzy for me, and I need your advise. The idea is to keep the changes in .mk file as less as possible when there is new release, so in above case we only need to change the CCID_VERSION based on SVN version.

I agree to use the stable release which is in this case will look as follow:

CCID_VERSION = 1.4.4
CCID_SOURCE = ccid-$(CCID_VERSION).tar.bz2 CCID_SITE = https://alioth.debian.org/frs/download.php/3579

Comparing to the previous release: 1.4.3 CCID_VERSION = 1.4.3
CCID_SOURCE = ccid-$(CCID_VERSION).tar.bz2 CCID_SITE = https://alioth.debian.org/frs/download.php/3535

There will be changes in CCID_VERSION and CCID_SITE when upgrading from 1.4.3 to 1.4.4

Please advise, should this is not reasonable

Quoted 9 lines

package/ccid/Config.in

Quoted 4 lines
package/ccid/Config.in new file +4 -0
+CCID_INSTALL_STAGING = YES
+CCID_INSTALL_TARGET = YES
+CCID_AUTORECONF = YES
+CCID_DEPENDENCIES = pcsc-lite libusb

If you depend on libusb here, then the CCID package should also:

? ? ? ?select BR2_PACKAGE_LIBUSB

Understood

Quoted 5 lines
Quoted 5 lines

+$(eval $(call AUTOTARGETS, package, ccid))

package/pcsc-lite/Config.in new file +0 -1
new file mode 100644
index 0000000..51e32c8
--- /dev/null
Quoted 9 lines

package/pcsc-lite/Config.in line 2

Quoted 4 lines

+++ b/package/pcsc-lite/Config.in

package/pcsc-lite/Config.in new file +2 -0
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_PCSC_LITE
+ ? ? select BR2_PACKAGE_CCID

Is it pcsc that depends on ccid, or ccid that depends on pcsc ? According to your *_DEPENDENCIES variable, it's ccid that depends on pcsc-lite, so the "select BR2_PACKAGE_CCID" here should go away.

Mmm ... actually CCID depends on PCSC. I will fix that.

Quoted 7 lines

package/pcsc-lite/Config.in line 5

Quoted 3 lines
package/pcsc-lite/Config.in new file +3 -0
+ ? ? bool "pcsc-lite"
+ ? ? help
+ ? ? ? ? ? ? Middleware to be used with PC/SC

Same comment as above: indentation is tab + 2 spaces, more elaborate description, and project URL.

Quoted 10 lines

package/pcsc-lite/Config.in

Quoted 7 lines
package/pcsc-lite/Config.in new file +7 -0
+##########################################################
+#
+# PCSC-Lite
+#
+# ########################################################
+PCSC_LITE_VERSION = 5853
+PCSC_LITE_SITE = svn://anonscm.debian.org/pcsclite/trunk/PCSC

Same question, SVN version really needed ?

Actually no. When checking out from SVN it will always get the latest version.

Quoted 10 lines

package/pcsc-lite/Config.in

Quoted 7 lines
package/pcsc-lite/Config.in new file +6 -1
+PCSC_LITE_INSTALL_STAGING = YES
+PCSC_LITE_INSTALL_TARGET = YES
+PCSC_LITE_AUTORECONF = YES
+PCSC_LITE_CONF_OPT = --disable-libudev --enable-libusb
--enable-embedded +PCSC_LITE_DEPENDENCIES=libusb
+
+$(eval $(call AUTOTARGETS, package, pcsc-lite))

Again, thanks for proposing those two packages!

Many thanks for your comments. This is my first attempt on buildroot, I will try my best to accomplish it.

Best regards,
DWI

#3 lore raw

PATCH 1/1 pcsc-lite and ccid support

Hello Dwi,

Le Tue, 12 Jul 2011 14:03:01 +0700,
Dwi Sasongko Supriyadi <[email protected]> a ?crit :

Quoted 26 lines
Quoted 6 lines

The latest ccid release is 1.4.4, dated May 2011, which doesn't seem to be that old. In general, we prefer using stable releases rather than SVN versions when possible. Do you have a good reason for choosing a specific SVN version instead of the latest project release ?

It should have been using the latest version.

The reason is somehow fuzzy for me, and I need your advise. The idea is to keep the changes in .mk file as less as possible when there is new release, so in above case we only need to change the CCID_VERSION based on SVN version.

I agree to use the stable release which is in this case will look as follow:

CCID_VERSION = 1.4.4
CCID_SOURCE = ccid-$(CCID_VERSION).tar.bz2 CCID_SITE = https://alioth.debian.org/frs/download.php/3579

Comparing to the previous release: 1.4.3 CCID_VERSION = 1.4.3
CCID_SOURCE = ccid-$(CCID_VERSION).tar.bz2 CCID_SITE = https://alioth.debian.org/frs/download.php/3535

Quoted 4 lines

There will be changes in CCID_VERSION and CCID_SITE when upgrading from 1.4.3 to 1.4.4

Please advise, should this is not reasonable

Well, I think updating two lines (CCID_VERSION and CCID_SITE) is reasonable when the package version needs to be changed. It would of course have been better if Alioth did not use this strange (and stupid?) URL scheme, but that's the way it is.

Quoted 1 line
Quoted 1 line
Quoted 1 line

+CCID_AUTORECONF = YES

Presumably, if you use the tarball versions, the ./configure script and Makefile.in files will already be available, so this line could be removed.

Quoted 11 lines
Quoted 10 lines

package/pcsc-lite/pcsc-lite.mk line 7

Quoted 7 lines
package/pcsc-lite/pcsc-lite.mk new file +7 -0
+##########################################################
+#
+# PCSC-Lite
+#
+# ########################################################
+PCSC_LITE_VERSION = 5853
+PCSC_LITE_SITE = svn://anonscm.debian.org/pcsclite/trunk/PCSC

Same question, SVN version really needed ?

Quoted 2 lines

Actually no. When checking out from SVN it will always get the latest version.

No, with what you have written, it will always get revision 5853, and nothing else. It'd be better to use the tarball version here as well.

Quoted 1 line
Quoted 1 line
Quoted 1 line

+PCSC_LITE_AUTORECONF = YES

And remove this line.

Quoted 2 lines

Many thanks for your comments. This is my first attempt on buildroot, I will try my best to accomplish it.

And your first attempt is very good! Thanks for contributing!

Regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

PATCH 1/1 pcsc-lite and ccid support

Hello Thomas,

Quoted 34 lines · Thomas Petazzoni

Hello Dwi,

Le Tue, 12 Jul 2011 14:03:01 +0700,
Dwi Sasongko Supriyadi <[email protected]> a ?crit :

Quoted 29 lines
Quoted 6 lines

The latest ccid release is 1.4.4, dated May 2011, which doesn't seem to be that old. In general, we prefer using stable releases rather than SVN versions when possible. Do you have a good reason for choosing a specific SVN version instead of the latest project release ?

It should have been using the latest version.

The reason is somehow fuzzy for me, and I need your advise. The idea is to keep the changes in .mk file as less as possible when there is new release, so in above case we only need to change the CCID_VERSION based on SVN version.

I agree to use the stable release which is in this case will look as follow:

CCID_VERSION = 1.4.4
CCID_SOURCE = ccid-$(CCID_VERSION).tar.bz2 CCID_SITE = https://alioth.debian.org/frs/download.php/3579

Comparing to the previous release: 1.4.3 CCID_VERSION = 1.4.3
CCID_SOURCE = ccid-$(CCID_VERSION).tar.bz2 CCID_SITE = https://alioth.debian.org/frs/download.php/3535

There will be changes in CCID_VERSION and CCID_SITE when upgrading from 1.4.3 to 1.4.4

Quoted 7 lines
Quoted 1 line

Please advise, should this is not reasonable

Well, I think updating two lines (CCID_VERSION and CCID_SITE) is reasonable when the package version needs to be changed. It would of course have been better if Alioth did not use this strange (and stupid?) URL scheme, but that's the way it is.

I have modified the url to point to the tarball instead of SVN

Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

+CCID_AUTORECONF = YES

Presumably, if you use the tarball versions, the ./configure script and Makefile.in files will already be available, so this line could be removed.

Thank you for this info.

Quoted 11 lines
Quoted 11 lines
Quoted 10 lines

package/pcsc-lite/pcsc-lite.mk line 7

Quoted 7 lines
package/pcsc-lite/pcsc-lite.mk new file +7 -0
+##########################################################
+#
+# PCSC-Lite
+#
+# ########################################################
+PCSC_LITE_VERSION = 5853
+PCSC_LITE_SITE = svn://anonscm.debian.org/pcsclite/trunk/PCSC

Same question, SVN version really needed ?

Quoted 6 lines
Quoted 2 lines

Actually no. When checking out from SVN it will always get the latest version.

No, with what you have written, it will always get revision 5853, and nothing else. It'd be better to use the tarball version here as well.

Indeed, when saying it will check out the latest version what I mean is when the version is not specified.

Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

+PCSC_LITE_AUTORECONF = YES

And remove this line.

Quoted 2 lines

Many thanks for your comments. This is my first attempt on buildroot, I will try my best to accomplish it.

And your first attempt is very good! Thanks for contributing!

Thank you.

I have already modified the patch after testing from scratch (recompile everything) and found out that there are other dependencies for ccid.

Should I send the patch here or creating another thread?

Thanks in advance,
DWI

#5 lore raw

PATCH 1/1 pcsc-lite and ccid support

Le Tue, 12 Jul 2011 17:10:01 +0700,
Dwi Sasongko Supriyadi <[email protected]> a ?crit :

Quoted 3 lines

I have already modified the patch after testing from scratch (recompile everything) and found out that there are other dependencies for ccid.

Ok.

Quoted 1 line

Should I send the patch here or creating another thread?

Either way is fine.

Regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#6 lore raw

PATCH 1/1 pcsc-lite and ccid support

Quoted 7 lines · Thomas Petazzoni

Le Tue, 12 Jul 2011 17:10:01 +0700,
Dwi Sasongko Supriyadi <[email protected]> a ?crit :

Quoted 3 lines

I have already modified the patch after testing from scratch (recompile everything) and found out that there are other dependencies for ccid.

Quoted 5 lines

Ok.

Quoted 1 line

Should I send the patch here or creating another thread?

Either way is fine.

Thanks. I have sent the modified version in previous e-mail actually.

Best regards,
DWI