Hi! Here is an ebuild for drivers needed for the O2Micro PCMCIA SmartCard Reader found in some notebooks (for example the Acer Travelmate 8100). This is my first ebuild, so please tell me if I did anything wrong. Thanks for your attention, Tony.
Created attachment 73585 [details] The ebuild
Created attachment 74575 [details] pcsc-o2micro-ozscr-drv/pcsc-o2micro-ozscr-drv-2.0.3.ebuild Version bump Added Dependency for pcmcia-cs Updated URLs Fixed paths to Makefile (ozscr -> ozscr-2.6.13) Will only work for kernels >= 2.6.13 ( for a kernel < 2.6.13 you must build the module in ozscr-2.6)
Created attachment 79937 [details] Updated ebuild Added debug useflag and detection of kernel versions < 2.6.13 to Andreas' version.
emerge pcsc-o2micro-ozscr-drv fails on the ebuild dated 2006-02-16. script config-release also fails make also fails emerge --info: Gentoo Base System version 1.6.14 Portage 2.0.54-r2 (default-linux/x86/2006.0, gcc-3.4.5, glibc-2.3.6-r3, 2.6.16-gentoo-r7 i686) ================================================================= System uname: 2.6.16-gentoo-r7 i686 Intel(R) Pentium(R) M processor 2.00GHz ccache version 2.3 [enabled] dev-lang/python: 2.4.2 dev-python/pycrypto: [Not Present] dev-util/ccache: 2.3 dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.17 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=pentium-m -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=pentium-m -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo http://gentoo.chem.wisc.edu/gentoo/ http://distfiles.gentoo.org" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage" USE="x86 X acpi alsa avi berkdb bitmap-fonts bzip2 cdr cli crypt cups doc dri dvd dvdr encode esd examples expat fbcon foomaticdb fortran gdbm gif gnome gpm gstreamer gtk gtk2 imlib ipv6 isdnlog jpeg libg++ libwww mad mikmod mmx motif mp3 mpeg ncurses nptl ogg opengl pam pcmcia pcre pdflib perl png pppd python qt quicktime readline reflection sdl session smartcard spell spl sse sse2 ssl tcpd truetype truetype-fonts type1-fonts udev usb vorbis xml xml2 xmms xorg xv zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS, PORTAGE_RSYNC_OPTS ebuild error: Calculating dependencies [32;01m*[0m Determining the location of the kernel source code [32;01m*[0m Found kernel source directory: [32;01m*[0m /usr/src/linux [32;01m*[0m Found sources for kernel version: [32;01m*[0m 2.6.16-gentoo-r7 [32;01m*[0m Using kernel modul for kernel version 2.6.13 upwards >>> Unpacking source... >>> Unpacking O2Micro_PCMCIA_SCR_203_Linux_Kernel26_OpenSource.tar.gz to /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work >>> Source unpacked. make: Entering directory `/var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozctapi' gcc -DCPU_ICAP_PC -fPIC -I/usr/include/PCSC -c ctapi.c gcc -DCPU_ICAP_PC -fPIC -I/usr/include/PCSC -c ifdhandler.c ifdhandler.c:31:24: ifdhandler.h: No such file or directory ifdhandler.c:53: error: syntax error before "UCHAR" ifdhandler.c:53: warning: no semicolon at end of struct or union ifdhandler.c:54: warning: data definition has no type or storage class ifdhandler.c:55: warning: data definition has no type or storage class ifdhandler.c:59: error: syntax error before "DEVICE_CAPABILITIES" ifdhandler.c:59: warning: no semicolon at end of struct or union ifdhandler.c:60: warning: data definition has no type or storage class ifdhandler.c:61: error: syntax error before "protocol_options" ifdhandler.c:61: warning: data definition has no type or storage class ifdhandler.c:62: warning: data definition has no type or storage class ifdhandler.c:69: error: syntax error before '*' token ifdhandler.c:75: warning: data definition has no type or storage class ifdhandler.c:83: error: syntax error before "IFDHCreateChannel" ifdhandler.c:83: error: syntax error before "Lun" ifdhandler.c: In function `IFDHCreateChannel': ifdhandler.c:123: error: `Lun' undeclared (first use in this function) ifdhandler.c:123: error: (Each undeclared identifier is reported only once ifdhandler.c:123: error: for each function it appears in.) ifdhandler.c:127: error: `IFD_SUCCESS' undeclared (first use in this function) ifdhandler.c:130: error: `Channel' undeclared (first use in this function) ifdhandler.c:145: error: `IFD_COMMUNICATION_ERROR' undeclared (first use in this function) ifdhandler.c:149: error: syntax error before ')' token ifdhandler.c: At top level: ifdhandler.c:159: error: syntax error before "IFDHCloseChannel" ifdhandler.c:159: error: syntax error before "Lun" ifdhandler.c: In function `IFDHCloseChannel': ifdhandler.c:175: error: `Lun' undeclared (first use in this function) ifdhandler.c:179: error: `IFD_COMMUNICATION_ERROR' undeclared (first use in this function) ifdhandler.c:190: error: `IFD_SUCCESS' undeclared (first use in this function) ifdhandler.c: At top level: ifdhandler.c:194: error: syntax error before "IFDHGetCapabilities" ifdhandler.c:194: error: syntax error before "Lun" ifdhandler.c: In function `IFDHGetCapabilities': ifdhandler.c:215: error: `Lun' undeclared (first use in this function) ifdhandler.c:219: error: `IFD_ICC_NOT_PRESENT' undeclared (first use in this function) ifdhandler.c:221: error: `Tag' undeclared (first use in this function) ifdhandler.c:221: error: `TAG_IFD_ATR' undeclared (first use in this function) ifdhandler.c:223: error: `Length' undeclared (first use in this function) ifdhandler.c:223: error: request for member `icc_state' in something not a structure or union ifdhandler.c:224: error: `Value' undeclared (first use in this function) ifdhandler.c:224: error: request for member `icc_state' in something not a structure or union ifdhandler.c:227: error: `IFD_ERROR_TAG' undeclared (first use in this function) ...done! >>> emerge (1 of 1) sys-apps/pcsc-o2micro-ozscr-drv-2.0.3 to / >>> md5 files ;-) pcsc-o2micro-ozscr-drv-2.0.3.ebuild >>> md5 files ;-) files/digest-pcsc-o2micro-ozscr-drv-2.0.3 >>> md5 src_uri ;-) O2Micro_PCMCIA_SCR_203_Linux_Kernel26_OpenSource.tar.gz config-release and make error: /root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6/ozscrlx.c:205: error: unknown field `attach' specified in initializer /root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6/ozscrlx.c:205: warning: excess elements in struct initializer /root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6/ozscrlx.c:205: warning: (near initialization for `ozscrlx_driver') /root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6/ozscrlx.c:206: error: unknown field `detach' specified in initializer /root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6/ozscrlx.c:206: warning: excess elements in struct initializer /root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6/ozscrlx.c:206: warning: (near initialization for `ozscrlx_driver') /root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6/ozscrlx.c: In function `cs_error': /root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6/ozscrlx.c:516: warning: implicit declaration of function `pcmcia_report_error' /root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6/ozscrlx.c: In function `ozscr_attach': /root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6/ozscrlx.c:915: warning: implicit declaration of function `pcmcia_register_client' /root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6/ozscrlx.c: In function `ozscr_detach': /root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6/ozscrlx.c:1059: warning: implicit declaration of function `pcmcia_deregister_client' /root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6/ozscrlx.c: In function `init_ozscrlx': /root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6/ozscrlx.c:1119: error: `servinfo_t' undeclared (first use in this function) /root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6/ozscrlx.c:1119: error: (Each undeclared identifier is reported only once /root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6/ozscrlx.c:1119: error: for each function it appears in.) /root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6/ozscrlx.c:1119: error: syntax error before "serv" /root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6/ozscrlx.c:1123: warning: implicit declaration of function `pcmcia_get_card_services_info' /root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6/ozscrlx.c:1123: error: `serv' undeclared (first use in this function) /root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6/ozscrlx.c:1125: error: `CS_RELEASE_CODE' undeclared (first use in this function) make[2]: *** [/root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6/ozscrlx.o] Error 1 make[1]: *** [_module_/root/o2micro/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6] Error 2 make: *** [default] Error 2 cp: cannot stat `ozscrlx.ko': No such file or directory make: *** [install] Error 1 I will be willing to test any new ebuilds or patches.
similar error with the "updated ebuild" (2006-02-16) for me ... make[1]: Entering directory `/usr/src/linux-2.6.16-gentoo-r9' CC [M] /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.o /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.c:205: error: unknown field ‘attach’ specified in initializer /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.c:205: warning: excess elements in struct initializer /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.c:205: warning: (near initialization for ‘ozscrlx_driver’) /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.c:206: error: unknown field ‘event’ specified in initializer /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.c:206: warning: excess elements in struct initializer /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.c:206: warning: (near initialization for ‘ozscrlx_driver’) /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.c:207: error: unknown field ‘detach’ specified in initializer /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.c:207: warning: excess elements in struct initializer /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.c:207: warning: (near initialization for ‘ozscrlx_driver’) /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.c: In function ‘ozscr_attach’: /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.c:902: warning: implicit declaration of function ‘pcmcia_register_client’ /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.c: In function ‘ozscr_detach’: /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.c:1046: warning: implicit declaration of function ‘pcmcia_deregister_client’ make[2]: *** [/var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.o] Error 1 make[1]: *** [_module_/var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13] Error 2 make[1]: Leaving directory `/usr/src/linux-2.6.16-gentoo-r9' make: *** [default] Error 2 btw, is it really necessary to have such a loooooong name? I would suggest using 'ozscrlx' as this is the module name or 'o2micro' as this is easily remembered (and it is the most common nickname for it on the web)
I am getting the same errors. I think it has something to do with the recent changes in the linux pcmcia support. O2Micro probably needs to release an update... or someone has to write a patch. The name is so long because I made it match the sheme of the other pcsc drivers already in portage.
(In reply to comment #6) > I think it has something to do with the recent > changes in the linux pcmcia support. yes, you are right, the problem is with 2.6.15 => 2.6.16 kernel changes I have found these interesting posts: * http://www.ussg.iu.edu/hypermail/linux/kernel/0512.0/1900.html where to get info about the needed changes: "For -mm (and for 2.6.16, not .15) there are quite more changes necessary, which are also described in Documentation/pcmcia/driver-changes.txt." * http://archives.neohapsis.com/archives/dev/muscle/2006-q2/0335.html this guy claims he has a patch to compile the driver but he gets error * http://www.students.ncl.ac.uk/a.j.mee/blog/index.php/2006/05/10/acer-travelmate-8204wlmi-with-gentoo/#comment-535 this guy claims that he is able to compile it too, but has another problems > O2Micro probably needs to release an > update... or someone has to write a patch. I am afraid that the second is true, although O2Micro has job offer for Linux driver programmer, so maybe we can expect a surprise :-) I tried to use their inquiry web form, but I do not expect an answer ... I'll try to write to the guys who tried porting, if they get in contact, maybe they can help each other ... or do you think of something better?
Following a comment Kavol left on my blog I did go and look at the link he left. Sure enough Andre Puschmann had done precisely the same thing as me as far as creating a patch. Any how, good new is that along with Eric Piel these guys seem to have got the issue ironed out (at least for kernels >= 2.6.17) Perhaps their patch could be included in the ebuild? http://archives.neohapsis.com/archives/dev/muscle/2006-q2/0365.html
Created attachment 90170 [details] pcsc-o2micro-ozscr-drv.tgz well, there are three usable (?) patches right now, one for 2.6.16 and two for 2.6.17 .. I have included them in my portage overlay and modified the ebuild - see the attachment these patches are taken from: * http://archives.neohapsis.com/archives/dev/muscle/2006-q2/0351.html * http://archives.neohapsis.com/archives/dev/muscle/2006-q2/0355.html * http://archives.neohapsis.com/archives/dev/muscle/2006-q2/0365.html I tried the first one, since I use gentoo-sources-2.6.16-r9, but the module crashes on loading into kernel - dmesg says: OZSCRLX version: O2Micro SmartCardBus Reader for kernel 2.6 (above 2.6.13) Unable to handle kernel NULL pointer dereference at virtual address 00000028 printing eip: e025296b *pde = 00000000 Oops: 0000 [#1] PREEMPT Modules linked in: ozscrlx pcmcia firmware_class yenta_socket rsrc_nonstatic pcmcia_core ntfs CPU: 0 EIP: 0060:[<e025296b>] Not tainted VLI EFLAGS: 00210246 (2.6.16-gentoo-r9 #3) EIP is at CmdClearFIFO+0xb/0x50 [ozscrlx] eax: 00000000 ebx: cd322960 ecx: 0000006a edx: 00000000 esi: cd322960 edi: cac9c578 ebp: cac9c540 esp: c2b73d0c ds: 007b es: 007b ss: 0068 Process modprobe (pid: 8544, threadinfo=c2b72000 task=c5c675b0) Stack: <0>d0276c80 c4113a40 e0252dcd 00000002 de7f7d06 c4113a40 00000000 cac9c578 e02548e3 df6ef0c0 000000d0 de170400 de170438 de9b1828 e0255b80 e022b7b3 de170400 000000d0 00000006 c2b73d60 00000001 00200282 00000000 00000000 Call Trace: [<e0252dcd>] CmdResetInterface+0xd/0xd0 [ozscrlx] [<e02548e3>] ozscr_attach+0x113/0x160 [ozscrlx] [<e022b7b3>] pcmcia_device_probe+0xc3/0x1d9 [pcmcia] [<c02f5ba0>] netlink_broadcast+0x240/0x3b0 [<c02475ec>] driver_probe_device+0x4c/0xc0 [<c02476e0>] __driver_attach+0x0/0x70 [<c0247747>] __driver_attach+0x67/0x70 [<c0246f4d>] bus_for_each_dev+0x5d/0x80 [<c0247515>] driver_attach+0x25/0x30 [<c02476e0>] __driver_attach+0x0/0x70 [<c0246acf>] bus_add_driver+0x8f/0x160 [<c02479cb>] driver_register+0x4b/0x90 [<e0253394>] init_ozscrlx+0x24/0x70 [ozscrlx] [<c0133d51>] sys_init_module+0x191/0x1845 [<e022cc50>] pcmcia_release_irq+0x0/0xc0 [pcmcia] [<c01459ca>] __handle_mm_fault+0x7ea/0x8c0 [<c012d260>] autoremove_wake_function+0x0/0x60 [<c0157f25>] vfs_read+0xb5/0x190 [<c01583fb>] sys_read+0x4b/0x80 [<c0103087>] sysenter_past_esp+0x54/0x75 Code: ba 03 00 00 00 a8 40 74 c7 8b 5c 24 08 89 d0 8b 74 24 0c 83 c4 10 c3 89 f6 8d bc 27 00 00 00 00 53 89 c3 83 ec 04 31 d2 8b 40 08 <0f> b7 40 28 66 85 c0 75 0c 59 89 d0 5b c3 8d b4 26 00 00 00 00 ... can anybody else test this?
Created attachment 90172 [details] pcsc-o2micro-ozscr-drv.tgz well, there are three usable (?) patches right now, one for 2.6.16 and two for 2.6.17 .. I have included them in my portage overlay and modified the ebuild - see the attachment these patches are taken from: * http://archives.neohapsis.com/archives/dev/muscle/2006-q2/0351.html * http://archives.neohapsis.com/archives/dev/muscle/2006-q2/0355.html * http://archives.neohapsis.com/archives/dev/muscle/2006-q2/0365.html I tried the first one, since I use gentoo-sources-2.6.16-r9, but the module crashes on loading into kernel - dmesg says: OZSCRLX version: O2Micro SmartCardBus Reader for kernel 2.6 (above 2.6.13) Unable to handle kernel NULL pointer dereference at virtual address 00000028 printing eip: e025296b *pde = 00000000 Oops: 0000 [#1] PREEMPT Modules linked in: ozscrlx pcmcia firmware_class yenta_socket rsrc_nonstatic pcmcia_core ntfs CPU: 0 EIP: 0060:[<e025296b>] Not tainted VLI EFLAGS: 00210246 (2.6.16-gentoo-r9 #3) EIP is at CmdClearFIFO+0xb/0x50 [ozscrlx] eax: 00000000 ebx: cd322960 ecx: 0000006a edx: 00000000 esi: cd322960 edi: cac9c578 ebp: cac9c540 esp: c2b73d0c ds: 007b es: 007b ss: 0068 Process modprobe (pid: 8544, threadinfo=c2b72000 task=c5c675b0) Stack: <0>d0276c80 c4113a40 e0252dcd 00000002 de7f7d06 c4113a40 00000000 cac9c578 e02548e3 df6ef0c0 000000d0 de170400 de170438 de9b1828 e0255b80 e022b7b3 de170400 000000d0 00000006 c2b73d60 00000001 00200282 00000000 00000000 Call Trace: [<e0252dcd>] CmdResetInterface+0xd/0xd0 [ozscrlx] [<e02548e3>] ozscr_attach+0x113/0x160 [ozscrlx] [<e022b7b3>] pcmcia_device_probe+0xc3/0x1d9 [pcmcia] [<c02f5ba0>] netlink_broadcast+0x240/0x3b0 [<c02475ec>] driver_probe_device+0x4c/0xc0 [<c02476e0>] __driver_attach+0x0/0x70 [<c0247747>] __driver_attach+0x67/0x70 [<c0246f4d>] bus_for_each_dev+0x5d/0x80 [<c0247515>] driver_attach+0x25/0x30 [<c02476e0>] __driver_attach+0x0/0x70 [<c0246acf>] bus_add_driver+0x8f/0x160 [<c02479cb>] driver_register+0x4b/0x90 [<e0253394>] init_ozscrlx+0x24/0x70 [ozscrlx] [<c0133d51>] sys_init_module+0x191/0x1845 [<e022cc50>] pcmcia_release_irq+0x0/0xc0 [pcmcia] [<c01459ca>] __handle_mm_fault+0x7ea/0x8c0 [<c012d260>] autoremove_wake_function+0x0/0x60 [<c0157f25>] vfs_read+0xb5/0x190 [<c01583fb>] sys_read+0x4b/0x80 [<c0103087>] sysenter_past_esp+0x54/0x75 Code: ba 03 00 00 00 a8 40 74 c7 8b 5c 24 08 89 d0 8b 74 24 0c 83 c4 10 c3 89 f6 8d bc 27 00 00 00 00 53 89 c3 83 ec 04 31 d2 8b 40 08 <0f> b7 40 28 66 85 c0 75 0c 59 89 d0 5b c3 8d b4 26 00 00 00 00 ... can anybody else test this?
I'm in the middle of an install (writing bash script to automate), but am far enough along to test. I'll test what I can this evening, and post the results tomorrow.
(In reply to comment #10) > Created an attachment (id=90172) [edit] > pcsc-o2micro-ozscr-drv.tgz > > well, there are three usable (?) patches right now, one for 2.6.16 and two for > 2.6.17 .. I have included them in my portage overlay and modified the ebuild - > see the attachment <REMAINDER OF TEXT CUT> I'm using kernel version 2.6.16-r9 and the ebuild attachment dated 2006-06-26 02:53 PST fails with the same error message listed previously (not the update ebuild). I had emerged pcmciautils previously. It fails whether or not pcmciautils is present. I've also tested that ebuild with kernel version 2.6.19-r7, and received the same results.
Created attachment 91053 [details] Error text received
Created attachment 91054 [details] applicable emerge --info
I've just tested with kernel 2.6.17-r1 and received the same error message. This occurs whether I have pcmcia-cs or pcmciautils installed.
Driver compiles with kernel version 2.6.17-r1 and pcsc-lite-1.3.1-r1 gpg --card-status gives this error, back to the drawing board: winscard_clnt.c:320:SCardEstablishContextTH() Cannot open public shared file: /var/run/pcscd.pub gpg: pcsc_establish_context failed: no service (0x8010001d) gpg: card reader not available gpg: OpenPGP card not available: general error
added --foreground and --debug flags to pcscd options, received this during boot: pcscdaemon.c:259:main() pcscd set to foreground with debug send to stderr debuglog.c:207:DebugLogSetLevel() debug level=debug configfile.l:106:evaluatetoken() Error with device /dev/ozscrlx: No such file or directory configfile.l:107:evaluatetoken() You should use 'DEVICENAME /dev/null' if your driver does not use this field pcscdaemon.c:489:at_exit() cleaning /var/run pcscdaemon.c:508:clean_temp_files() Cannot unlink /var/run/pcscd.comm: No such file or directory Device created in /dev is o2cr0. Modified /etc/reader.conf, changing ozscrlx to o2cr0. Received this during reboot: pcscdaemon.c:259:main() pcscd set to foreground with debug send to stderr debuglog.c:207:DebugLogSetLevel() debug level=debug readerfactory.c:1095:RFInitializeReader() Attempting startup of O2Micro SmartCardBus Reader 00 00. readerfactory.c:933:RFBindFunctions() Loading IFD Handler 2.0 readerfactory.c:1130:RFInitializeReader() Open Port F10000 Failed (/dev/o2cr0) readerfactory.c:1012:RFUnloadReader() Unloading reader driver. readerfactory.c:251:RFAddReader() O2Micro SmartCardBus Reader init failed. pcscdaemon.c:464:main() pcsc-lite 1.3.1 daemon ready. hotplug_libusb.c:105:HPReadBundleValues() Cannot open PC/SC drivers directory: /usr/lib/readers/usb hotplug_libusb.c:106:HPReadBundleValues() Disabling USB support for pcscd. [pcscdaemon.c:529:signal_trap() Preparing for suicide readerfactory.c:1350:RFCleanupReaders() entering cleaning function pcscdaemon.c:489:at_exit() cleaning /var/run Stumped on next action to try. But seem to be making progress. The usb cardreaders require udev rules to be created, is this what's missing for this driver? Just thinking out loud.
Installed pcsc-tools from: http://ludovic.rousseau.free.fr/softwares/pcsc-tools/ Output from pcsc_scan: localhost pcsc-tools-1.4.5 # ./pcsc_scan PC/SC device scanner V 1.4.5 (c) 2001-2006, Ludovic Rousseau <ludovic.rousseau@free.fr> Compiled with PC/SC lite version: 1.3.1 winscard_clnt.c:320:SCardEstablishContextTH() Cannot open public shared file: /var/run/pcscd.pub SCardEstablishContext: Cannot Connect to Resource Manager 8010001D It would appear that although dmesg reports, OZSCRLX version: O2Micro SmartCardBus Reader for kernel 2.6 (above 2.6.17) and the device /dev/o2cr0 is created, the driver is not fully loading. No error messages are shown in dmesg. The only errors identified are those shown in previous comments.
Getting it narrowed down: added ozscrlx to /etc/modules.autoload.d/kernel-2.6 (already had pcmcia and yenta-socket there). Now I don't have the port error message. Just this: pcscdaemon.c:259:main() pcscd set to foreground with debug send to stderr debuglog.c:207:DebugLogSetLevel() debug level=debug readerfactory.c:1095:RFInitializeReader() Attempting startup of O2Micro SmartCardBus Reader 00 00. readerfactory.c:933:RFBindFunctions() Loading IFD Handler 2.0 pcscdaemon.c:464:main() pcsc-lite 1.3.1 daemon ready. ATR: F8 FF FF FF hotplug_libusb.c:105:HPReadBundleValues() Cannot open PC/SC drivers directory: /usr/lib/readers/usb hotplug_libusb.c:106:HPReadBundleValues() Disabling USB support for pcscd. pcscdaemon.c:529:signal_trap() Preparing for suicide readerfactory.c:1350:RFCleanupReaders() entering cleaning function readerfactory.c:1359:RFCleanupReaders() Stopping reader: O2Micro SmartCardBus Reader 00 00 eventhandler.c:121:EHDestroyEventHandler() Stomping thread. hotplug_libusb.c:361:HPEstablishUSBNotifications() Hotplug stopped eventhandler.c:150:EHDestroyEventHandler() Thread stomped. readerfactory.c:1142:RFUnInitializeReader() Attempting shutdown of O2Micro SmartCardBus Reader 00 00. readerfactory.c:1012:RFUnloadReader() Unloading reader driver. pcscdaemon.c:489:at_exit() cleaning /var/runCard ################# So as you can see, it sees the card, but then seems to unload the driver because it can't find the drivers in the usb folder. Guess I'll try creating the folder and putting it in there to see if that works.
REPORTING SUCCESS! Requirements for successful use of the last ebuild, on a Dell Inspiron 600m are: gentoo-sources-2.6.17-gentoo-r1 pcsc-lite-1.3.1-r1 Although I had PCI hotplugging built in as a module, I wasn't loading it. Once I built it in (could have just loaded it), the card reader worked perfectly. I don't know anything about ebuilds yet (but I do have the dev handbook), but if there were a way to have the ebuild check for a correct kernel configuration, and supply warnings, this might save others hours (days in my case) of research. Also key: - Ensure pcscd is started - Create a udev rule per this post: http://archives.neohapsis.com/archives/dev/muscle/current/0003.html I want to thank everyone who has been involved with this so far.
Harvey, please to hear of your success! It looks like I did the same as you and downloaded the most recent version of the ebuild (attachment #0172 [details]) which will not compile. It looks like there might have been a posting screw up since comments #9 and #10 are the same except the ebuild attached to the latter does not appear to word (at least forkernel >= 2.6.17) So I got attachment #90170 [details] and built it. And I have everything else installed.and have arrived at a point like you in comment #18 BUT... THe device hasn't / doesn't appears for me. I have PCI hotpluggin compiled in (but none of the sub options), have tried several variants of the udev rule referenced. Have everything in modules.autoload. But still no device :-( I tried with/without a card installed and tried inserting/removing with the driver loaded. I get the same unhelpful dmesg output. Any suggestions? I hoped there might be something you missed out! If I can get this working I'll happily do the necessary ebuild fixes to save others some time!
Created attachment 92703 [details] ozscrlx driver I have updated the ebuild to include the udev rule it works for me with gentoo-sources-2.6.17-r4 and pcsc-lite >= 1.3.0 the older kernel versions are theoretically supported too, it should work up to 2.6.15 without patching but I am lazy to try it :-p and on version 2.6.16 it compiles but crashes on load (at least for me)
(In reply to comment #21) > And I have everything else installed.and have arrived at a point like you > in comment #18 BUT... THe device hasn't / doesn't appears for me. maybe a stupid quiestion, but ... is your pcscd running?
(In reply to comment #23) > (In reply to comment #21) > > And I have everything else installed.and have arrived at a point like you > > in comment #18 BUT... THe device hasn't / doesn't appears for me. > > maybe a stupid quiestion, but ... is your pcscd running? No, it won't start if the device isn't there! ------------------------------- # /usr/sbin/pcscd -f pcscdaemon.c:259:main() pcscd set to foreground with debug send to stderr configfile.l:106:evaluatetoken() Error with device /dev/ozscrlx: No such file or directory configfile.l:107:evaluatetoken() You should use 'DEVICENAME /dev/null' if your driver does not use this field pcscdaemon.c:489:at_exit() cleaning /var/run pcscdaemon.c:508:clean_temp_files() Cannot unlink /var/run/pcscd.comm: No such file or directory ------------------------------ but the module is loaded though all I see in dmesg is: ------------------------------- OZSCRLX version: O2Micro SmartCardBus Reader for kernel 2.6 (above 2.6.17) ------------------------------- pcscd is currently looking for /dev/ozscrlx but I don't appear to have ANY devices beginning with 'o' (So I don't think it's an issue with the particular incarnation of the udev rule) And the udev rule does exist (my other local udev rules appear to be functioning OK) What are the major:minor numbers of your device?
Looking in the ozscrlx.c source file I see: #define OZSCR_MAJOR 123 /* from sample=> experimental!*/ so I try: dev # mknod ozscrlx c 123 0 but get: dev # pcscd -f pcscdaemon.c:259:main() pcscd set to foreground with debug send to stderr readerfactory.c:1095:RFInitializeReader() Attempting startup of O2Micro SmartCardBus Reader 00 00. readerfactory.c:933:RFBindFunctions() Loading IFD Handler 2.0 Segmentation fault
(In reply to comment #24) > (In reply to comment #23) ... > > maybe a stupid question, but ... is your pcscd running? > No, it won't start if the device isn't there! well, on my system it starts by default even without the reader (with some dummy devices) > What are the major:minor numbers of your device? as you read within the sources ... # ls -l /dev/o* crw-rw---- 1 root tty 123, 0 2006-07-25 11:54 /dev/ozscrlx
Setting the "debug" use flag on the ebuild fails for me: >>> Compiling source in /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6 ... make: Entering directory `/var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozctapi' gcc -DCPU_ICAP_PC -fPIC -I/usr/include/PCSC -DPCSC_DEBUG -c ctapi.c gcc -DCPU_ICAP_PC -fPIC -I/usr/include/PCSC -DPCSC_DEBUG -c ifdhandler.c ld -shared ctapi.o ifdhandler.o -o lib_OZSCR.so make: Leaving directory `/var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozctapi' * Preparing ozscrlx module rm -f *.o rm -f .*.o.d rm -f *.ko rm -f *.mod.* rm -f .*.cmd rm -rf .tmp_* rm -f *~ make -C /lib/modules/`uname -r`/build SUBDIRS=`pwd` modules make[1]: Entering directory `/usr/src/linux-2.6.17-suspend2-r2' CC [M] /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.o /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.c: In function `ozscr_open': /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.c:267: error: `minor' undeclared (first use in this function)/var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.c:267: error: (Each undeclared identifier is reported only once /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.c:267: error: for each function it appears in.) /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.c: In function `ozscr_close': /var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.c:300: error: `minor' undeclared (first use in this function)make[2]: *** [/var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13/ozscrlx.o] Error 1 make[1]: *** [_module_/var/tmp/portage/pcsc-o2micro-ozscr-drv-2.0.3/work/OZSCR_2.0.3_Kern_2.6/src/ozscrlx-2.6.13] Error 2 make[1]: Leaving directory `/usr/src/linux-2.6.17-suspend2-r2' make: *** [default] Error 2 !!! ERROR: sys-apps/pcsc-o2micro-ozscr-drv-2.0.3 failed. Call stack: ebuild.sh, line 1539: Called dyn_compile ebuild.sh, line 939: Called src_compile pcsc-o2micro-ozscr-drv-2.0.3.ebuild, line 71: Called linux-mod_src_compile linux-mod.eclass, line 469: Called die !!! Unable to make KSRC=//usr/src/linux KVERS=26 clean default. !!! If you need support, post the topmost build error, and the call stack if relevant.
(In reply to comment #25) > dev # pcscd -f > pcscdaemon.c:259:main() pcscd set to foreground with debug send to stderr > readerfactory.c:1095:RFInitializeReader() Attempting startup of O2Micro > SmartCardBus Reader 00 00. > readerfactory.c:933:RFBindFunctions() Loading IFD Handler 2.0 > Segmentation fault > I hadn't noticed earlier, but when pcscd crashes as above, the following appears in dmesg: OZSCRLX version: O2Micro SmartCardBus Reader for kernel 2.6 (above 2.6.17) OZSCRLX init_ozscrlx: major num: 123 OZSCRLX init_ozscrlx: function complete! BUG: unable to handle kernel NULL pointer dereference at virtual address 00000124 printing eip: c021b028 *pde = 00000000 Oops: 0000 [#3] PREEMPT SMP Modules linked in: ozscrlx michael_mic arc4 ieee80211_crypt_tkip ipw3945 ieee80211 ieee80211_crypt snd_pcm_oss snd_mixer_oss snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device fglrx agpgart rfcomm l2cap battery ac hci_usb bluetooth usbhid pcmcia eth1394 sr_mod cdrom yenta_socket snd_hda_intel snd_hda_codec snd_pcm ohci1394 ehci_hcd ieee1394 rsrc_nonstatic uhci_hcd snd_timer i2c_i801 snd_page_alloc usbcore firmware_class pcmcia_core i2c_core CPU: 1 EIP: 0060:[<c021b028>] Tainted: PF VLI EFLAGS: 00010282 (2.6.17-suspend2-r2 #4) EIP is at kref_get+0x8/0x50 eax: 00000124 ebx: 00000124 ecx: 00000000 edx: 00000000 esi: 00000000 edi: f93f2030 ebp: f44c7bd8 esp: f447be68 ds: 007b es: 007b ss: 0068 Process pcscd (pid: 19492, threadinfo=f447a000 task=f56f90b0) Stack: f55cc3c0 f5ad4ee0 f447a000 00000000 0000010c c021a6f7 00000124 00000000 c029393a 0000010c f96d2364 00000084 f96d3912 00000000 00000000 f93f2042 00000000 f55cc3c0 c0187b06 f44c7bd8 f455e480 f447bec0 00000000 f455e480 Call Trace: <c021a6f7> kobject_get+0x17/0x20 <c029393a> get_device+0x1a/0x30 <f96d2364> pcmcia_get_dev+0x14/0x30 [pcmcia] <f96d3912> pcmcia_dev_present+0x12/0x40 [pcmcia] <f93f2042> ozscr_open+0x12/0x40 [ozscrlx] <c0187b06> chrdev_open+0xf6/0x1d0 <c0187a10> chrdev_open+0x0/0x1d0 <c017c05f> __dentry_open+0x19f/0x280 <c017c285> nameidata_to_filp+0x35/0x50 <c017c190> do_filp_open+0x50/0x60 <c022f532> tty_write+0xa2/0x250 <c017c3d8> get_unused_fd+0xb8/0xe0 <c017c543> do_sys_open+0x63/0x100 <c017c607> sys_open+0x27/0x30 <c010329b> sysenter_past_esp+0x54/0x75 Code: 24 1c 83 c4 20 c3 90 90 90 90 90 90 90 90 90 90 90 90 90 8b 44 24 04 c7 00 01 00 00 00 c3 90 8d 74 26 00 53 83 ec 10 8b 5c 24 18 <8b> 03 85 c0 74 08 f0 ff 03 83 c4 10 5b c3 c7 04 24 88 8a 36 c0 EIP: [<c021b028>] kref_get+0x8/0x50 SS:ESP 0068:f447be68 Any suggestions? I'm afraid I'm limited to finding debug info on this one. (Got the "use debug" to work by manual intervention and commenting the two debug lines refering to "minor") No extra info though.
UPDATE: New ebuild test successful. Unemerged the old driver based on attachment 90172 [details]. Removed udev rule in /etc/udev/rules.d. Moved old sources. Unpacked new ebuild into overlay. Emerged ebuild without error. Tested card and application functionality without error. For those looking for a more indepth guide to installing the driver, I've created a HOWTO listed below: HOWTO: Install 02Micro OZ711EC1 Smartcard Reader Driver http://forums.gentoo.org/viewtopic-t-482152-highlight-.html
In your Howto you propose to use pcmciautils instead of pcmcia-cs. But in your ebuild package you have a dependency on pcmcia-cs. I suggest to replace sys-apps/pcmcia-cs by virtual/pcmcia.
Created attachment 103352 [details, diff] working ozscrlx-203-kernel-2.6.17-sysfs.patch i fixed this patch so it actually applies, enjoy :)
Created attachment 103353 [details, diff] working ozscrlx-203-kernel-2.6.17-sysfs.patch i fixed this one too
Unfortunately the download source for the driver is down, is there an alternate source?
(In reply to comment #33) > Unfortunately the download source for the driver is down, is there > an alternate source? > ftp://scrdriver:scrdriver@ftp.o2micro.com/Linux/O2Micro_PCMCIA_SCR_203_Linux_Kernel26_OpenSource.tar.gz
Ryan you uploaded the same patch twice. I think one should be the fixed config patch, but this is not here. And the sysfs patch does not applies on the file. I think this is because of the failing config patch. Or I am completly wrong?
Created attachment 169746 [details] sys-apps/pcsc-o2micro-o2scr-drv-1.0.3 (new ebuild) A version that actually works with newer kernels (testet with 2.6.25). It uses the new o2scr projects source, see https://gna.org/projects/o2scr. (For everybody who has the same problem as I did on my Acer Travelmate 8100: If your reader does not show up with lspcmcia, add pci=assign-busses to your kernel parameters!)
(this is an automated message based on filtering criteria that matched this bug) 'EBUILD' is in the KEYWORDS which should mean that there is a ebuild attached to this bug. This bug is assigned to maintainer-wanted which means that it is not in the main tree. Heuristics show that no Gentoo developer has commented on your ebuild. Hello, The Gentoo Team would like to firstly thank you for your ebuild submission. We also apologize for not being able to accommodate you in a timely manner. There are simply too many new packages. Allow me to use this opportunity to introduce you to Gentoo Sunrise. The sunrise overlay[1] is a overlay for Gentoo which we allow trusted users to commit to and all users can have ebuilds reviewed by Gentoo devs for entry into the overlay. So, the sunrise team is suggesting that you look into this and submit your ebuild to the overlay where even *you* can commit to. =) Because this is a mass message, we are also asking you to be patient with us. We anticipate a large number of requests in a short time. Thanks, On behalf of the Gentoo Sunrise Team, Jeremy. [1]: http://www.gentoo.org/proj/en/sunrise/ [2]: http://overlays.gentoo.org/proj/sunrise/wiki/SunriseFaq
Created attachment 280139 [details] sys-apps/pcsc-o2micro-o2scr-drv-1.6 New 1.6 version bump
Created attachment 280141 [details] sys-apps/pcsc-o2micro-o2scr-drv-1.6