kernel 3.10 rebuild [release 2.4.0beta1.svn20080426-12mamba;Sun Sep 15 2013]

This commit is contained in:
Silvan Calarco 2024-01-05 21:26:11 +01:00
parent 2bfbf22fbf
commit 4fce8bcc57
4 changed files with 190 additions and 0 deletions

View File

@ -1,2 +1,4 @@
# cm2020 # cm2020
Driver for the Omnikey Cardman 2020 USB smart card reader.

View File

@ -0,0 +1,30 @@
diff -ru cm2020.orig//src/cm2020/cardman.c cm2020/src/cm2020/cardman.c
--- cm2020.orig//src/cm2020/cardman.c 2008-04-26 16:59:50.000000000 +0200
+++ cm2020/src/cm2020/cardman.c 2011-02-07 20:24:47.622266596 +0100
@@ -87,7 +87,7 @@
#define FILL_CONTROL_URB usb_fill_control_urb
#define FILL_INT_URB usb_fill_int_urb
/* prevent races between open() and disconnect() */
-static DECLARE_MUTEX (disconnect_sem);
+static DEFINE_SEMAPHORE (disconnect_sem);
#endif
static unsigned char ucFIDITable_T1_FW1FW2[10][14] =
@@ -151,7 +151,7 @@
#endif
.read= cmu_read,
.write= cmu_write,
- .ioctl= cmu_ioctl,
+ .compat_ioctl= cmu_ioctl,
.open= cmu_open,
.release= cmu_close,
};
@@ -2386,7 +2386,7 @@
memset(cardman,0,sizeof(struct usb_cardman));
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- init_MUTEX (&cardman->sem);
+ sema_init (&cardman->sem, 1);
cardman->dev = dev;
cardman->interface = iface;
#endif

View File

@ -0,0 +1,11 @@
diff -ru cm2020.orig/src/cm2020/cardman.c cm2020/src/cm2020/cardman.c
--- cm2020.orig/src/cm2020/cardman.c 2011-08-19 12:31:11.441186388 +0200
+++ cm2020/src/cm2020/cardman.c 2011-08-19 15:38:22.482278477 +0200
@@ -30,7 +30,6 @@
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#include <linux/errno.h>
- #include <linux/smp_lock.h>
#include <linux/completion.h>
#include <asm/uaccess.h>
#else

147
cm2020.spec Normal file
View File

@ -0,0 +1,147 @@
# openmamba 2.6 kernel module specfile
# Copyright (C) 2004-2010 by Silvan Calarco
#
# To build for a specific target:
#
# rpm -ba --define="KERNEL_TARGET mamba" cm2020.spec
#
# default is "mamba"
#
%define kernel_ver %{version}
%define build_version %{kernel_ver}
%define BUILD_CC %{_target_platform}-gcc
%define BUILD_CXX %{_target_platform}-g++
%if "%{?KERNEL_TARGET}" == ""
# build a mamba kernel by default
%define KERNEL_TARGET mamba
%endif
%if "%{?KERNEL_VER}" == ""
%define KERNEL_VER %(uname -r | sed "s|\\([0-9.]*\\).*|\\1|" )
%endif
Name: cm2020
Version: 2.4.0beta1.svn20080426
Release: 12mamba
Summary: Driver for the Omnikey Cardman 2020 USB smart card reader
Group: System/Kernel and Hardware/Drivers
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://svn.gula.es/cm2020
# svn co http://svn.gula.es/cm2020
Source: http://svn.gula.es/cm2020/cm2020-%{version}.tar.bz2
Patch0: %{name}-2.4.0beta1.svn20080426-kernel-2.6.37.patch
Patch1: %{name}-2.4.0beta1.svn20080426-kernel-2.6.39.patch
License: GPL
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
Driver for the Omnikey Cardman 2020 USB smart card reader.
%package -n kernel-%{KERNEL_TARGET}-cm2020
Summary: Driver for the Omnikey Cardman 2020 USB smart card reader
Group: System/Kernel and Hardware/Drivers
Requires(pre): kernel-%{KERNEL_TARGET} >= %{KERNEL_VER}
Requires(pre): kernel-%{KERNEL_TARGET} <= %{KERNEL_VER}.255
## KERNELOBSOLETES-BEGIN 3.4
Obsoletes: kernel-%{KERNEL_TARGET}-cm2020 = 2.4.0beta1.svn20080426-9mamba
Obsoletes: kernel-%{KERNEL_TARGET}-cm2020 = 2.4.0beta1.svn20080426-10mamba
## KERNELOBSOLETES-END
%description -n kernel-%{KERNEL_TARGET}-cm2020
Driver for the Omnikey Cardman 2020 USB smart card reader.
%prep
%setup -q -n %{name}
%patch0 -p1
%patch1 -p1
%if "%{?KERNEL_TARGET}" == ""
echo "No target specified, aborting."
exit 1
%else
echo "I'm going to build module for a %{KERNEL_TARGET} kernel..."
%endif
cd src/cm2020
mv makefile.26 Makefile
%build
#
# build for KERNEL_TARGET
#
BUILD_OPTS="CC=%{BUILD_CC} CXX=%{BUILD_CXX} %{_smp_mflags}"
# build cm2020 module
make CROSS_COMPILE=%{_target_platform}- -C src/cm2020 \
${BUILD_OPTS} \
KVER=%{KERNEL_VER}%{?KERNEL_TARGET} \
KDIR=%{_prefix}/src/linux-%{KERNEL_VER}%{?KERNEL_TARGET}
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
# install cm2020 module
install -D -m 0644 \
src/cm2020/cardman.ko \
%{buildroot}/lib/modules/%{KERNEL_VER}%{?KERNEL_TARGET}/extra/cardman.ko
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -n kernel-%{KERNEL_TARGET}-cm2020
# new install or upgrade
/sbin/depmod -a -F /boot/System.map-%{KERNEL_VER}%{?KERNEL_TARGET} \
%{KERNEL_VER}%{?KERNEL_TARGET} >/dev/null 2>&1
:
%postun -n kernel-%{KERNEL_TARGET}-cm2020
# erase this package
[ $1 -eq 0 ] &&
/sbin/depmod -a -F /boot/System.map-%{KERNEL_VER}%{?KERNEL_TARGET} \
%{KERNEL_VER}%{?KERNEL_TARGET} >/dev/null 2>&1
:
%files -n kernel-%{KERNEL_TARGET}-cm2020
%defattr(-,root,root)
/lib/modules/%{KERNEL_VER}%{?KERNEL_TARGET}/extra/cardman.ko
%doc COPYING README
%changelog
* Sun Sep 15 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.0beta1.svn20080426-12mamba
- kernel 3.10 rebuild
* Fri Jan 04 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.0beta1.svn20080426-11mamba
- kernel 3.4 rebuild
* Mon Nov 05 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.0beta1.svn20080426-10mamba
- bump release up for milestone2 update
* Sat Oct 27 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.0beta1.svn20080426-9mamba
- kernel 3.6 rebuild
* Sat Jun 30 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.0beta1.svn20080426-8mamba
- automatic update by autodist
* Sun Feb 12 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.0beta1.svn20080426-7mamba
- automatic update by autodist
* Wed Jan 25 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.0beta1.svn20080426-6mamba
- automatic update by autodist
* Sun Sep 04 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.0beta1.svn20080426-5mamba
- automatic update by autodist
* Fri Aug 19 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.0beta1.svn20080426-4mamba
- automatic update by autodist
* Wed Apr 20 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.0beta1.svn20080426-3mamba
- kernel 2.6.38 rebuild
* Mon Feb 07 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.0beta1.svn20080426-2mamba
- automatic update by autodist
* Fri Dec 17 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.0beta1.svn20080426-1mamba
- package created out of kernel-extramodules