diff options
author | Christian Hesse | 2015-06-30 16:02:47 +0200 |
---|---|---|
committer | Christian Hesse | 2015-06-30 16:02:47 +0200 |
commit | 676f30095d8faa73c9d4635fdefae62acd7d4b7f (patch) | |
tree | 67c4f86510616c73cfdea7d01ead03c5ea664279 | |
download | aur-676f30095d8faa73c9d4635fdefae62acd7d4b7f.tar.gz |
initial import of open-sasc-ng-dkms 0.r620.29b7b5f231c8-2
-rw-r--r-- | .SRCINFO | 38 | ||||
-rw-r--r-- | 2.6.38.patch | 120 | ||||
-rw-r--r-- | PKGBUILD | 73 | ||||
-rw-r--r-- | cardclient.conf | 49 | ||||
-rw-r--r-- | config_dvb.pl.patch | 86 | ||||
-rw-r--r-- | dkms.conf | 10 | ||||
-rw-r--r-- | open-sasc-ng.install | 10 | ||||
-rw-r--r-- | open-sasc-ng.lr | 9 | ||||
-rw-r--r-- | sasc-ng.conf | 23 | ||||
-rw-r--r-- | sasc-ng.service | 11 |
10 files changed, 429 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..b15fe118cb3c --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,38 @@ +pkgbase = open-sasc-ng-dkms + pkgdesc = a versatile SoftCAM which creates virtual DVB devices + pkgver = 0.r620.29b7b5f231c8 + pkgrel = 2 + url = http://85.17.209.13:6100 + install = open-sasc-ng.install + arch = i686 + arch = x86_64 + license = GPL + makedepends = mercurial + depends = linux-headers + depends = dkms + depends = sascng-linux3-dkms + provides = sasc-ng + provides = open-sasc-ng + conflicts = sasc-ng + conflicts = open-sasc-ng + backup = etc/camdir/cardclient.conf + backup = etc/conf.d/sasc-ng + source = open-sasc-ng::hg+http://85.17.209.13:6100/sc + source = 2.6.38.patch + source = cardclient.conf + source = dkms.conf + source = sasc-ng.service + source = sasc-ng.conf + source = open-sasc-ng.lr + source = config_dvb.pl.patch + sha256sums = SKIP + sha256sums = 45856a48253dcf58a81244bf8216cbf7e77d30ebfd07d14735cbe94180787961 + sha256sums = 7caba03e515fe55aced4aad831e72ef3c0e59a3cdcea7bcdf79f7bfff6fcec75 + sha256sums = 8c5b5ce5ac3eba4cfa3f7ec21b815b34dee0c7cd7616c250764f4c0bac896c37 + sha256sums = f23c4b4a3941190906a11f2d00319bbf82e3382dab5ecea86b34c3a19086fb18 + sha256sums = edfef56e3be2e1d0b7b0d11588e638d54548b9f2dd06495b9b581ba5baae9314 + sha256sums = 620da70c775ce055a3f04041cf90e6d2acf7f7a57b0eecd07f240456d0069cf4 + sha256sums = 195f440a4de49c56c8becba0fed966b436b2260f2cf3ce9e9277d97b411be9e4 + +pkgname = open-sasc-ng-dkms + diff --git a/2.6.38.patch b/2.6.38.patch new file mode 100644 index 000000000000..34d06c974326 --- /dev/null +++ b/2.6.38.patch @@ -0,0 +1,120 @@ +Only in sc/contrib/sasc-ng: config.mak +diff -ru sc/contrib/sasc-ng/dvbloopback/module/dvblb_forward.c sc-build/contrib/sasc-ng/dvbloopback/module/dvblb_forward.c +--- sc/contrib/sasc-ng/dvbloopback/module/dvblb_forward.c 2011-04-27 09:36:37.197065902 +0300 ++++ sc-build/contrib/sasc-ng/dvbloopback/module/dvblb_forward.c 2011-04-27 09:42:23.640415717 +0300 +@@ -166,9 +166,9 @@ + struct file *ftmp = find_forwardmap(lbdev, f->private_data); + if (!ftmp || IS_ERR(ftmp)) + return -EFAULT; +- if (lbdev->forward_dev->fops &&lbdev->forward_dev->fops->ioctl) +- return lbdev->forward_dev->fops->ioctl( +- ftmp->f_dentry->d_inode, ftmp, cmd, arg); ++ if (lbdev->forward_dev->fops &&lbdev->forward_dev->fops->unlocked_ioctl) ++ return lbdev->forward_dev->fops->unlocked_ioctl( ++ ftmp, cmd, arg); + return -EFAULT; + } + +diff -ru sc/contrib/sasc-ng/dvbloopback/module/dvb_loopback.c sc-build/contrib/sasc-ng/dvbloopback/module/dvb_loopback.c +--- sc/contrib/sasc-ng/dvbloopback/module/dvb_loopback.c 2011-04-27 09:36:37.197065902 +0300 ++++ sc-build/contrib/sasc-ng/dvbloopback/module/dvb_loopback.c 2011-04-27 09:41:54.984751422 +0300 +@@ -118,9 +118,9 @@ + /* This is a copy of dvb_usercopy. We need to do this because it isn't exported + by dvbdev + */ +-static int dvblb_usercopy(struct inode *inode, struct file *file, ++static int dvblb_usercopy(struct file *file, + unsigned int cmd, unsigned long arg, +- int (*func)(struct inode *inode, struct file *file, ++ int (*func)(struct file *file, + unsigned int cmd, void *arg)) + { + char sbuf[128]; +@@ -180,7 +180,7 @@ + } + + /* call driver */ +- if ((err = func(inode, file, cmd, parg)) == -ENOIOCTLCMD) ++ if ((err = func(file, cmd, parg)) == -ENOIOCTLCMD) + err = -EINVAL; + + if (err < 0) +@@ -663,7 +663,7 @@ + dvb_generic_ioctl) which is called by dvblb_ioctl for device-0. It is + used to forward ioctl commands back to the userspace application + */ +-static int dvblb_looped_ioctl(struct inode *inode, struct file *f, ++static int dvblb_looped_ioctl(struct file *f, + unsigned int cmd, void *parg) + { + int ret; +@@ -692,7 +692,7 @@ + return ret; + } + +-static int dvblb_ioctl(struct inode *inode, struct file *f, ++static int dvblb_ioctl(struct file *f, + unsigned int cmd, unsigned long arg) + { + void * parg = (void *)arg; +@@ -722,8 +722,7 @@ + /* This is the looped device */ + if (lbdev->forward_dev) + return dvblb_forward_ioctl(lbdev, f, cmd, arg); +- +- return dvblb_usercopy (inode, f, cmd, arg, ++ return dvblb_usercopy (f, cmd, arg, + dvbdev->kernel_ioctl); + } + /* This is the userspace control device */ +@@ -978,7 +977,7 @@ + .write = dvblb_write, + .poll = dvblb_poll, + .mmap = dvblb_mmap, +- .ioctl = dvblb_ioctl, ++ .unlocked_ioctl = dvblb_ioctl, + }; + + static struct dvb_device dvbdev_looped = { +@@ -998,7 +997,7 @@ + .write = dvblb_write, + .poll = dvblb_poll, + .mmap = dvblb_mmap, +- .ioctl = dvblb_ioctl, ++ .unlocked_ioctl = dvblb_ioctl, + }; + + static struct dvb_device dvbdev_userspace = { +diff -ru sc/contrib/sasc-ng/Makefile sc-build/contrib/sasc-ng/Makefile +--- sc/contrib/sasc-ng/Makefile 2011-04-27 09:36:37.193734235 +0300 ++++ sc-build/contrib/sasc-ng/Makefile 2011-04-27 09:44:40.072162363 +0300 +@@ -8,7 +8,7 @@ + + CC ?= gcc + CXX ?= g++ +-CXXFLAGS ?= -Wall -D__user= -Werror ++CXXFLAGS ?= -Wall -D__user= + CFLAGS ?= -Wall -D__user= + + ifdef DVB_DIR +@@ -57,7 +57,7 @@ + INC_DEPS := $(shell ls $(LBDIR)/*.h) dvbloopback/module/dvbloopback.h + INC_DEPS_LB := $(shell ls dvblb_plugins/*.h) + +-LIBS = -lpthread -lcrypto -lcrypt ++LIBS = -lpthread -lcrypto -lcrypt -lv4l1 + + all: $(TOOL) libscanwrap.so + +diff -ru sc/contrib/sasc-ng/sc/dvbdevice.cpp sc-build/contrib/sasc-ng/sc/dvbdevice.cpp +--- sc/contrib/sasc-ng/sc/dvbdevice.cpp 2011-04-27 09:36:37.207060903 +0300 ++++ sc-build/contrib/sasc-ng/sc/dvbdevice.cpp 2011-04-27 09:42:51.956250022 +0300 +@@ -10,7 +10,7 @@ + #include "include/vdr/dvbdevice.h" + #include <errno.h> + #include <limits.h> +-#include <linux/videodev.h> ++#include <libv4l1-videodev.h> + #include <linux/dvb/audio.h> + #include <linux/dvb/dmx.h> + #include <linux/dvb/frontend.h> diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..8888ee4bdf67 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,73 @@ +# Maintainer: Christian Hesse <mail@eworm.de> +# Contributor: Wessel Dirksen "p-we" <wdirksen at gmail dot com> +# Contributor: Juha-Matti "Suolx" Heikkala + +pkgname=open-sasc-ng-dkms +pkgver=0.r620.29b7b5f231c8 +pkgrel=2 +pkgdesc='a versatile SoftCAM which creates virtual DVB devices' +url='http://85.17.209.13:6100' +arch=('i686' 'x86_64') +license=('GPL') +depends=('linux-headers' 'dkms' 'sascng-linux3-dkms') +makedepends=('mercurial') +conflicts=('sasc-ng' 'open-sasc-ng') +provides=('sasc-ng' 'open-sasc-ng') +install=open-sasc-ng.install +backup=('etc/camdir/cardclient.conf' + 'etc/conf.d/sasc-ng') +source=('open-sasc-ng::hg+http://85.17.209.13:6100/sc' + '2.6.38.patch' + 'cardclient.conf' + 'dkms.conf' + 'sasc-ng.service' + 'sasc-ng.conf' + 'open-sasc-ng.lr' + 'config_dvb.pl.patch') +sha256sums=('SKIP' + '45856a48253dcf58a81244bf8216cbf7e77d30ebfd07d14735cbe94180787961' + '7caba03e515fe55aced4aad831e72ef3c0e59a3cdcea7bcdf79f7bfff6fcec75' + '8c5b5ce5ac3eba4cfa3f7ec21b815b34dee0c7cd7616c250764f4c0bac896c37' + 'f23c4b4a3941190906a11f2d00319bbf82e3382dab5ecea86b34c3a19086fb18' + 'edfef56e3be2e1d0b7b0d11588e638d54548b9f2dd06495b9b581ba5baae9314' + '620da70c775ce055a3f04041cf90e6d2acf7f7a57b0eecd07f240456d0069cf4' + '195f440a4de49c56c8becba0fed966b436b2260f2cf3ce9e9277d97b411be9e4') + +pkgver() { + cd ${srcdir}/open-sasc-ng/ + + echo "0.r$(hg identify -n).$(hg identify -i)" +} + +build() { + cd ${srcdir}/open-sasc-ng/ + + if [ "$(hg identify -n)" -lt "600" ]; then + patch -Np1 < ${srcdir}/2.6.38.patch + fi + patch -p1 < ${srcdir}/config_dvb.pl.patch + + cd contrib/sasc-ng/ + + chmod a+x configure + chmod a+x makelinks.sh + chmod a+x dvbloopback/module/config_dvb.pl + + ./configure --compiletype=release + make +} + +package() { + cd ${srcdir}/open-sasc-ng/contrib/sasc-ng/ + + mkdir -p ${pkgdir}/var/lib/dkms/open-sasc-ng/${pkgver}/ + cp -r dvbloopback/module ${pkgdir}/var/lib/dkms/open-sasc-ng/${pkgver}/source + sed "s/%%PKGVER%%/${pkgver}/" < ${srcdir}/dkms.conf > ${pkgdir}/var/lib/dkms/open-sasc-ng/${pkgver}/source/dkms.conf + + install -D -m0755 sasc-ng ${pkgdir}/usr/sbin/sasc-ng + install -D -m0644 ${srcdir}/sasc-ng.service ${pkgdir}/usr/lib/systemd/system/sasc-ng.service + install -D -m0644 ${srcdir}/sasc-ng.conf ${pkgdir}/etc/conf.d/sasc-ng + install -D -m0644 ${srcdir}/cardclient.conf ${pkgdir}/etc/camdir/cardclient.conf + install -D -m0644 ${srcdir}/open-sasc-ng.lr ${pkgdir}/etc/logrotate.d/open-sasc-ng.lr +} + diff --git a/cardclient.conf b/cardclient.conf new file mode 100644 index 000000000000..82b1eb7835ae --- /dev/null +++ b/cardclient.conf @@ -0,0 +1,49 @@ +# Sample protocols for use in Linux x86 or x86_64 PC based systems +# +# Comment lines can start with # or ; +# +# Every client line starts with the client name, followed by some arguments: +# 'hostname' The name of the server +# Use "localhost" if card server is on the same machine +# 'port' The port number as defined by the card server +# This is set on the card server usually between 10000 and 50000 +# 'emm' The flag to allow EMM transfers to the server +# (0=disabled 1=enabled) This should always be set to 1! +# 'caid' (optional) caid on which this client should work. +# Best is allow to autodetect +# 'mask' (optional) mask for caid. E.g. caid=1700 mask=FF00 would allow +# anything between 1700 & 17FF. Default is 1700 & FF00. +# If only the caid is specified, the mask value will be set to FFFF +# You may give multiple caid/mask values comma separated +# (e.g. 1702,1722,0d0c/ff00). +# Best is allow to autodetect +# 'username' is the login username +# 'password' is the login password +# 'cfgkey' is a required self-specified 28byte config key (Newcamd only) +# +# Radegast client: +# Radegast doesn't autodetect CAID and MASK values (AFAIK) and must be specified +# Example: radegast:hostname:port:0/0B00/FFFF +# +# Camd33 client (tcp protocol): +# For autodetect of CAID and MASK with camd33 specify "0000" +# Example: camd33:hostname:port:1/0000/0000:username:password +# +# Camd35 client (udp protocol): +# For autodetect of CAID and MASK with camd35 specify "0000" +# Example: camd35:hostname:port:1/0000/0000:username:password +# +# Newcamd client: +# For autodetect of CAID and MASK with newcamd, you leave the fields omitted +# Example: newcamd:hostname:port:1:username:password:0102030405060708091011121314 +# +# You will need to install and properly configure a cardserver package, +# such as OSCAM, to interface with cardclient.conf before sasc-ng will work +# with smart card encrypted systems. +# +# Please do not steal DTV. Use this package for DTV you are legally paying +# for. Stealing DTV will hurt all HTPC users in the end because providers are +# understandably cracking down on this due to theft. Don't give them a reason +# to work hard to make sasc-ng and other OS DTV stuff useless in a few years. +# +# Besides, stealing is not cool and never has been!
\ No newline at end of file diff --git a/config_dvb.pl.patch b/config_dvb.pl.patch new file mode 100644 index 000000000000..f43ef78ef248 --- /dev/null +++ b/config_dvb.pl.patch @@ -0,0 +1,86 @@ +Only in sc-build/contrib/sasc-ng: config.mak +Only in sc-build/contrib/sasc-ng/dvbloopback/module/config-dvb: chkdvb.c +diff -ru sc/contrib/sasc-ng/dvbloopback/module/config_dvb.pl sc-build/contrib/sasc-ng/dvbloopback/module/config_dvb.pl +--- sc/contrib/sasc-ng/dvbloopback/module/config_dvb.pl 2012-07-31 21:59:15.715706905 +0200 ++++ sc-build/contrib/sasc-ng/dvbloopback/module/config_dvb.pl 2012-09-15 13:29:47.000000000 +0200 +@@ -17,79 +17,12 @@ + $cmd = "cd config-dvb && make $vars" . ($debug ? "" : "2>/dev/null 1>/dev/null"); + print "$cmd\n" if($debug); + +- #test linux-version >= 2.6.22 + system("ln -sf chkdvb-2.6.v4l.c config-dvb/chkdvb.c"); +- if(system("$cmd") == 0) { +- print "Found dvbdev.h from 2.6.22 or later\n"; ++ print "Assuming kernel 2.6.22 or later\n"; + `echo "DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);" >> dvbdevwrap.h`; + `echo "#define wrap_dvb_reg_adapter(a, b, c) dvb_register_adapter(a, b, c, &dvblb_basedev->dev, adapter_nr)" >> dvbdevwrap.h`; + return 0; +- } +- +- #test linux-version >= 2.6.18 +- system("ln -sf chkdvb-2.6.18.c config-dvb/chkdvb.c"); +- if(system("$cmd") == 0) { +- print "Found dvbdev.h from 2.6.18 or later\n"; +- `echo "#define wrap_dvb_reg_adapter(a, b, c) dvb_register_adapter(a, b, c, &dvblb_basedev->dev)" >> dvbdevwrap.h`; +- return 0; +- } +- +- #test linux-version >= 2.6.14 +- system("ln -sf chkdvb-2.6.14.c config-dvb/chkdvb.c"); +- if(system("$cmd") == 0) { +- print "Found dvbdev.h from 2.6.14 or later\n"; +- `echo "#define wrap_dvb_reg_adapter dvb_register_adapter" >> dvbdevwrap.h`; +- return 0; +- } +- +- #test linux-version >= 2.6.5 +- system("ln -sf chkdvb-2.6.5.c config-dvb/chkdvb.c"); +- if(system("$cmd") == 0) { +- print "Found dvbdev.h from 2.6.5 or later\n"; +- print "But this is an unsupported kernel!\n"; +- return 1; +- } + +- #maybe kernel headers aren't available. let's use canned dvbdev.h +- #this is dangerous! +- $uname = `uname -r`; +- if($uname =~ /2\.6\.(\d\d)/ && $1 >= 22) { +- system("ln -sf ../dvbdev-2.6.v4l.h config-dvb/dvbdev.h"); +- system("ln -sf chkdvb-2.6.v4l.c config-dvb/chkdvb.c"); +- if(system("$cmd") == 0) { +- print "Found 2.6.22 or later kernel, but no dvbdev.h\n"; +- print "Using canned header\n"; +- `echo "DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);" >> dvbdevwrap.h`; +- `echo "#define wrap_dvb_reg_adapter(a, b, c) dvb_register_adapter(a, b, c, &dvblb_basedev->dev, adapter_nr)" >> dvbdevwrap.h`; +- system("ln -sf dvbdev-2.6.v4l.h dvbdev.h"); +- return 0; +- } +- } +- elsif($uname =~ /2\.6\.2[01]/ || +- $uname =~ /2\.6\.1[89]/) { +- system("ln -sf ../dvbdev-2.6.18.h config-dvb/dvbdev.h"); +- system("ln -sf chkdvb-2.6.18.c config-dvb/chkdvb.c"); +- if(system("$cmd") == 0) { +- print "Found 2.6.18 or later kernel, but no dvbdev.h\n"; +- print "Using canned header\n"; +- `echo "#define wrap_dvb_reg_adapter(a, b, c) dvb_register_adapter(a, b, c, &dvblb_basedev->dev)" >> dvbdevwrap.h`; +- system("ln -sf dvbdev-2.6.18.h dvbdev.h"); +- return 0; +- } +- } +- elsif($uname =~ /2\.6\.1[4-7]/) { +- system("ln -sf ../dvbdev-2.6.14.h config-dvb/dvbdev.h"); +- system("ln -sf chkdvb-2.6.14.c config-dvb/chkdvb.c"); +- if(system("$cmd") == 0) { +- print "Found 2.6.14 or later kernel, but no dvbdev.h\n"; +- print "Using canned header\n"; +- `echo "#define wrap_dvb_reg_adapter dvb_register_adapter" >> dvbdevwrap.h`; +- system("ln -sf dvbdev-2.6.14.h dvbdev.h"); +- return 0; +- } +- } +- print "Could not identify kernel\n"; +- return 1; + } + + exit(test_dvb_adapter(@ARGV)); diff --git a/dkms.conf b/dkms.conf new file mode 100644 index 000000000000..7a2d827f84aa --- /dev/null +++ b/dkms.conf @@ -0,0 +1,10 @@ +PACKAGE_NAME="open-sasc-ng" +PACKAGE_VERSION="%%PKGVER%%" +CLEAN="make clean" + +BUILT_MODULE_NAME[0]="dvbloopback" +MAKE[0]="make" +BUILT_MODULE_LOCATION[0]="." +DEST_MODULE_LOCATION[0]="/kernel/drivers/media/dvb/" + +AUTOINSTALL="yes" diff --git a/open-sasc-ng.install b/open-sasc-ng.install new file mode 100644 index 000000000000..f6f64645d11f --- /dev/null +++ b/open-sasc-ng.install @@ -0,0 +1,10 @@ +post_install() { + echo "Edit /etc/conf.d/sasc-ng and /etc/cardclient.conf before using!" + depmod -a +} +post_upgrade() { + depmod -a +} +post_remove() { + depmod -a +} diff --git a/open-sasc-ng.lr b/open-sasc-ng.lr new file mode 100644 index 000000000000..ad250609eb50 --- /dev/null +++ b/open-sasc-ng.lr @@ -0,0 +1,9 @@ +/var/log/sasc-ng.log { + copytruncate + daily + size 10M + missingok + rotate 2 + compress + notifempty +} diff --git a/sasc-ng.conf b/sasc-ng.conf new file mode 100644 index 000000000000..4de3ea103ff9 --- /dev/null +++ b/sasc-ng.conf @@ -0,0 +1,23 @@ +SASCNG_ARGS="-j 0:1" +# For minimum setup use "-j <real>:<virtual>" to link adapters +# Virtual foldback tuners are automatically assigned DVB device numbers FOLLOWING real adaptor numbers +# In the case of 2 DVB tuners: Real tuners will be DVB0 and DVB1 and foldback tuners will be DVB2 and DVB3 +# Extra parameters that often improve stability: -b 16M --sid-allpid --sid-nocache +# The --cam-budget parameter is necessary for use with MythTV +# Example of 3 DVB tuner setup: SASCNG_ARGS="-j 0:3 -j 1:4 -j 2:5 -b 16M --sid-allpid --sid-nocache --cam-budget" + +DVBLOOPBACK_ARGS="num_adapters=1" +# The defined integer must match the number of adaptor link-pairs specified in SASCNG_ARGS +# Syntax for use with above example: DVBLOOPBACK_ARGS="num_adapters=3" + +LOGDIR="/var/log/" +CAMDIR=/etc/camdir +# Define as needed. Remember to check the write permissions for the specified log directory + +# Sasc-ng is normally limited to a maximum of 4 DVB tuners in a Linux system because a standard +# Linux kernel is set to a maximum of 8 DVB tuners. (4 real + 4 sasc-ng foldback tuners) It is +# possible to use more DVB tuners if you compile the kernel yourself and raise the DVB device +# maximum in the config. There are various kernel packages available in the AUR which use the +# ABS which has a dialog GUI based configuration setup. Change CONFIG_DVB_MAX_ADAPTERS from 8 +# to something higher. The minimum number of adaptors you will need to set for use with sasc-ng +# is number of real DVB adaptors x2.
\ No newline at end of file diff --git a/sasc-ng.service b/sasc-ng.service new file mode 100644 index 000000000000..6a6faf2bdf12 --- /dev/null +++ b/sasc-ng.service @@ -0,0 +1,11 @@ +[Unit] +Description=SASC NG +After=network.target + +[Service] +EnvironmentFile=/etc/conf.d/sasc-ng +ExecStartPre=/sbin/modprobe dvbloopback $DVBLOOPBACK_ARGS +ExecStart=/usr/sbin/sasc-ng $SASCNG_ARGS --cam-dir $CAMDIR -l $LOGDIR/sasc-ng.log -b 16M --sid-allpid --sid-nocache --cam-budget + +[Install] +WantedBy=multi-user.target |