3 # Install Script for the OMNIKEY Cardman USB Smartcard reader series.
7 min
=`uname -r | cut -f2 -d.`
9 moddir
=${pkgdir}/lib
/modules
13 echo Installing OMNIKEY Cardman USB Smartcard reader...
19 if [ -f $logfile ]; then
24 # check if running as root
26 #if [ `id -u` -ne 0 ]; then
27 # echo You have to run the driver installation as root.
32 # detect pcsc-driver dir
34 pcsc_driverdir
=${pkgdir}/usr
/lib
/pcsc
/drivers
/
37 # copy the pcsc-shared library to its proper place
40 mkdir
-p $pcsc_driverdir &> /dev
/null
41 cp -r ifd-cm2020.bundle
$pcsc_driverdir
45 # check if module for this Kernel version exists
49 if [ $min -le 4 ]; then
51 cp .
/makefile
.24 .
/makefile
54 cp .
/makefile
.26 .
/Makefile
56 if [ ! -f ..
/..
/modules
/cardman.
$rel.
$kext ]; then
57 echo "The kernel module for $rel isn't prebuilt!"
58 echo "Try to compile it for you!"
59 make clean
2> /dev
/null
61 if [ ! -f .
/cardman.
$kext ]; then
62 echo "Couldn't build kernel module."
63 echo "Compile it by yourself or"
64 echo "contact OMNIKEY for further details."
65 echo "(e-mail: support.linux@omnikey.com)"
68 mv .
/cardman.
$kext ..
/..
/modules
/cardman.
$rel.
$kext
75 # copy cardman kernel module
78 if [ $min == 2 ]; then
80 elif [ $min == 4 ]; then
81 mod_min
=kernel
/drivers
/usb
82 elif [ $min -ge 5 ]; then
83 mod_min
=kernel
/drivers
/usb
/misc
85 if [ ! -d $moddir/$rel/$mod_min ]; then
86 mkdir
$moddir/$rel/$mod_min 2> /dev
/null
89 driver_file
="$moddir/$rel/$mod_min/cardman.$kext"
90 echo Copy cardman.
$kext to
$moddir/$rel/$mod_min
91 mkdir
-p `dirname $driver_file`
92 cp .
/modules
/cardman.
$rel.
$kext $driver_file
93 chmod 644 $driver_file
95 echo Could not copy cardman-module
, exiting
99 mkdir
-p ${pkgdir}/etc
/udev
/rules.d
/
100 cp 10-cardmanusb.rules
${pkgdir}/etc
/udev
/rules.d
/10-cardmanusb.rules
103 # Finally, load the kernel module
105 #echo Attempting to start the cardman kernel module
106 #/sbin/rmmod cardman 2>/dev/null
108 #/sbin/insmod $driver_file 2>/dev/null
111 echo Installation finished