mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 05:06:43 +00:00
pcscd: initial addon
This commit is contained in:
parent
f20200dad3
commit
e347b69d0e
2
packages/addons/service/pcscd/changelog.txt
Normal file
2
packages/addons/service/pcscd/changelog.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
100
|
||||||
|
- initial addon
|
10
packages/addons/service/pcscd/config/reader.conf
Normal file
10
packages/addons/service/pcscd/config/reader.conf
Normal 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
|
BIN
packages/addons/service/pcscd/icon/icon.png
Executable file
BIN
packages/addons/service/pcscd/icon/icon.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 63 KiB |
59
packages/addons/service/pcscd/package.mk
Normal file
59
packages/addons/service/pcscd/package.mk
Normal 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/
|
||||||
|
}
|
34
packages/addons/service/pcscd/source/bin/pcscd.start
Executable file
34
packages/addons/service/pcscd/source/bin/pcscd.start
Executable 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
|
35
packages/addons/service/pcscd/source/default.py
Normal file
35
packages/addons/service/pcscd/source/default.py
Normal 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()
|
@ -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
|
Loading…
x
Reference in New Issue
Block a user