Merge pull request #2231 from CvH/8.2-pcscd

PC/SC Smart Card Daemon
This commit is contained in:
Christian Hewitt 2017-11-30 18:33:46 +04:00 committed by GitHub
commit 469f1829c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 195 additions and 7 deletions

View File

@ -0,0 +1,37 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2017-present Team LibreELEC
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="ccid"
PKG_VERSION="1.4.28"
PKG_ARCH="any"
PKG_LICENSE="LGPL"
PKG_SITE="http://pcsclite.alioth.debian.org/ccid.html"
PKG_URL="https://alioth.debian.org/frs/download.php/latestfile/112/${PKG_NAME}-${PKG_VERSION}.tar.bz2"
PKG_DEPENDS_TARGET="toolchain pcsc-lite"
PKG_SECTION="driver"
PKG_SHORTDESC="CCID free software driver"
PKG_LONGDESC="CCID free software driver"
PKG_AUTORECONF="yes"
PKG_CONFIGURE_OPTS_TARGET="--enable-static --enable-twinserial"
make_target() {
make
make -C src/ Info.plist
}

View File

@ -1,6 +1,6 @@
################################################################################
# This file is part of LibreELEC - https://LibreELEC.tv
# Copyright (C) 2016 Team LibreELEC
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2016-present Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -17,21 +17,19 @@
################################################################################
PKG_NAME="pcsc-lite"
PKG_VERSION="1.8.16"
PKG_VERSION="1.8.22"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://pcsclite.alioth.debian.org/pcsclite.html"
PKG_URL="https://alioth.debian.org/frs/download.php/file/4164/${PKG_NAME}-${PKG_VERSION}.tar.bz2"
PKG_URL="https://alioth.debian.org/frs/download.php/latestfile/39/${PKG_NAME}-${PKG_VERSION}.tar.bz2"
PKG_DEPENDS_TARGET="toolchain libusb"
PKG_SECTION="service/system"
PKG_SHORTDESC="Middleware to access a smart card using SCard API (PC/SC)"
PKG_LONGDESC="Middleware to access a smart card using SCard API (PC/SC)"
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
PKG_CONFIGURE_OPTS_TARGET="--disable-shared \
--enable-static \
--disable-libudev \
--enable-libusb \
--enable-usbdropdir=/storage/.kodi/addons/service.system.pcscd-addon/drivers"
--enable-usbdropdir=/storage/.kodi/addons/service.pcscd/drivers"

View File

@ -0,0 +1,2 @@
100
- initial addon

View File

@ -0,0 +1,10 @@
# Gemalto reader with serial communication
# - n is the serial port to use n in [0..3]
# - reader is the reader name. It is needed for multi-slot readers.
# Possible reader values are: GemPCPinPad, GemCorePOSPro, GemCoreSIMPro,
# GemPCTwin (default value)
# example: /dev/ttyS0:GemPCPinPad
#FRIENDLYNAME "GemPCTwin serial"
#DEVICENAME /dev/ttySn[:reader]
#LIBPATH /storage/.kodi/addons/service.pcscd/drivers/serial/libccidtwin.so
#CHANNELID n

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@ -0,0 +1,59 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2017-present Team LibreELEC
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2011-2011 Gregor Fuis (gujs@openelec.tv)
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="pcscd"
PKG_VERSION="1.0"
PKG_REV="100"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="https://libreelec.tv"
PKG_URL=""
PKG_DEPENDS_TARGET="toolchain pcsc-lite libusb ccid"
PKG_SECTION="service"
PKG_SHORTDESC="Middleware to access a smart card using SCard API (PC/SC)"
PKG_LONGDESC="Middleware to access a smart card using SCard API (PC/SC)"
PKG_AUTORECONF="no"
PKG_IS_ADDON="yes"
PKG_ADDON_NAME="PC/SC Smart Card Daemon"
PKG_ADDON_TYPE="xbmc.service"
make_target() {
:
}
makeinstall_target() {
:
}
addon() {
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/bin/
cp -Pa $(get_build_dir pcsc-lite)/.install_pkg/usr/sbin/pcscd $ADDON_BUILD/$PKG_ADDON_ID/bin/pcscd.bin
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/drivers/serial
cp -Pa $(get_build_dir ccid)/.$TARGET_NAME/src/.libs/libccidtwin.so $ADDON_BUILD/$PKG_ADDON_ID/drivers/serial
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/drivers/ifd-ccid.bundle/Contents/Linux/
cp -Pa $(get_build_dir ccid)/.$TARGET_NAME/src/.libs/libccid.so $ADDON_BUILD/$PKG_ADDON_ID/drivers/ifd-ccid.bundle/Contents/Linux/
cp -Pa $(get_build_dir ccid)/.$TARGET_NAME/src/Info.plist $ADDON_BUILD/$PKG_ADDON_ID/drivers/ifd-ccid.bundle/Contents
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/config
cp -Pa $PKG_DIR/config/* $ADDON_BUILD/$PKG_ADDON_ID/config/
}

View File

@ -0,0 +1,34 @@
#!/bin/sh
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2017-present Team LibreELEC
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
. /etc/profile
oe_setup_addon service.pcscd
mkdir -p $ADDON_HOME/config
chmod a+x $ADDON_DIR/bin/*
if [ ! -f "$ADDON_HOME/config/reader.conf" ]; then
cp $ADDON_DIR/config/reader.conf $ADDON_HOME/config/reader.conf
fi
exec pcscd.bin --foreground -c $ADDON_HOME/config/reader.conf

View File

@ -0,0 +1,35 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2017-present Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
import subprocess
import xbmc
import xbmcaddon
class Monitor(xbmc.Monitor):
def __init__(self, *args, **kwargs):
xbmc.Monitor.__init__(self)
self.id = xbmcaddon.Addon().getAddonInfo('id')
def onSettingsChanged(self):
subprocess.call(['systemctl', 'restart', self.id])
if __name__ == "__main__":
Monitor().waitForAbort()

View File

@ -0,0 +1,13 @@
[Unit]
Description=PCSC lite
After=graphical.target
[Service]
ExecStart=/bin/sh -c "exec sh /storage/.kodi/addons/service.pcscd/bin/pcscd.start"
TimeoutStopSec=1
Restart=always
RestartSec=2
StartLimitInterval=0
[Install]
WantedBy=kodi.target