+sasc-ng (620-8) local; urgency=low
+
+ * Build patched dvb-core.ko module from the standard kernel in this package,
+ and place it in /lib/modules/*/updates.
+ * Remove dependency on patched kernel, depend on default kernel instead
+ * Build for 3.8-trunk kernel instead of 3.7-trunk
+
+ -- Jan-Pascal van Best <janpascal@vanbest.org> Tue, 26 Mar 2013 11:20:20 +0100
+
sasc-ng (620-7) local; urgency=low
* Added corei5 optimisation (for my own machine ;-)
and outputs through them.
.
This package contains the sasc-ng daemon and the dvbloopback
- kernel module for kernel #KERNEL#.
+ kernel module for kernel #KERNEL#, optimised for #FLAVOR# cpus.
Maintainer: Jan-Pascal van Best <janpascal@vanbest.org>
Standards-Version: 3.9.4
Build-Depends: debhelper (>= 8), libssl-dev (>= 1.0), gcc-4.6, g++-4.6,
- #LINUX_HEADERS#
+ #LINUX_HEADERS#, #LINUX_SOURCES#
Package: sasc-ng-common
Architecture: all
+++ /dev/null
-/*
- * dvbdev.h
- *
- * Copyright (C) 2000 Ralph Metzler & Marcus Metzler
- * for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Lesser Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * This program 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 Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef _DVBDEV_H_
-#define _DVBDEV_H_
-
-#include <linux/types.h>
-#include <linux/poll.h>
-#include <linux/fs.h>
-#include <linux/list.h>
-
-#define DVB_MAJOR 212
-
-#if defined(CONFIG_DVB_MAX_ADAPTERS) && CONFIG_DVB_MAX_ADAPTERS > 0
- #define DVB_MAX_ADAPTERS CONFIG_DVB_MAX_ADAPTERS
-#else
- #define DVB_MAX_ADAPTERS 8
-#endif
-
-#define DVB_UNSET (-1)
-
-#define DVB_DEVICE_VIDEO 0
-#define DVB_DEVICE_AUDIO 1
-#define DVB_DEVICE_SEC 2
-#define DVB_DEVICE_FRONTEND 3
-#define DVB_DEVICE_DEMUX 4
-#define DVB_DEVICE_DVR 5
-#define DVB_DEVICE_CA 6
-#define DVB_DEVICE_NET 7
-#define DVB_DEVICE_OSD 8
-
-#define DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr) \
- static short adapter_nr[] = \
- {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET }; \
- module_param_array(adapter_nr, short, NULL, 0444); \
- MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers")
-
-struct dvb_frontend;
-
-struct dvb_adapter {
- int num;
- struct list_head list_head;
- struct list_head device_list;
- const char *name;
- u8 proposed_mac [6];
- void* priv;
-
- struct device *device;
-
- struct module *module;
-
- int mfe_shared; /* indicates mutually exclusive frontends */
- struct dvb_device *mfe_dvbdev; /* frontend device in use */
- struct mutex mfe_lock; /* access lock for thread creation */
-};
-
-
-struct dvb_device {
- struct list_head list_head;
- const struct file_operations *fops;
- struct dvb_adapter *adapter;
- int type;
- int minor;
- u32 id;
-
- /* in theory, 'users' can vanish now,
- but I don't want to change too much now... */
- int readers;
- int writers;
- int users;
-
- wait_queue_head_t wait_queue;
- /* don't really need those !? -- FIXME: use video_usercopy */
- int (*kernel_ioctl)(struct file *file, unsigned int cmd, void *arg);
-
- void *priv;
-};
-
-
-extern int dvb_register_adapter(struct dvb_adapter *adap, const char *name,
- struct module *module, struct device *device,
- short *adapter_nums);
-extern int dvb_unregister_adapter (struct dvb_adapter *adap);
-
-extern int dvb_register_device (struct dvb_adapter *adap,
- struct dvb_device **pdvbdev,
- const struct dvb_device *template,
- void *priv,
- int type);
-
-extern void dvb_unregister_device (struct dvb_device *dvbdev);
-
-extern int dvb_generic_open (struct inode *inode, struct file *file);
-extern int dvb_generic_release (struct inode *inode, struct file *file);
-extern long dvb_generic_ioctl (struct file *file,
- unsigned int cmd, unsigned long arg);
-
-/* we don't mess with video_usercopy() any more,
-we simply define out own dvb_usercopy(), which will hopefully become
-generic_usercopy() someday... */
-
-extern int dvb_usercopy(struct file *file, unsigned int cmd, unsigned long arg,
- int (*func)(struct file *file, unsigned int cmd, void *arg));
-
-/** generic DVB attach function. */
-#ifdef CONFIG_MEDIA_ATTACH
-#define dvb_attach(FUNCTION, ARGS...) ({ \
- void *__r = NULL; \
- typeof(&FUNCTION) __a = symbol_request(FUNCTION); \
- if (__a) { \
- __r = (void *) __a(ARGS); \
- if (__r == NULL) \
- symbol_put(FUNCTION); \
- } else { \
- printk(KERN_ERR "DVB: Unable to find symbol "#FUNCTION"()\n"); \
- } \
- __r; \
-})
-
-#else
-#define dvb_attach(FUNCTION, ARGS...) ({ \
- FUNCTION(ARGS); \
-})
-
-#endif
-
-#endif /* #ifndef _DVBDEV_H_ */
--- /dev/null
+diff -Nur linux-2.6.38/drivers/media/dvb/dvb-core/dvbdev.c linux-2.6.38/drivers/media/dvb/dvb-core/dvbdev.c
+--- linux-2.6.38/drivers/media/dvb-core/dvbdev.c
++++ linux-2.6.38/drivers/media/dvb-core/dvbdev.c
+@@ -83,8 +83,11 @@ static int dvb_device_open(struct inode *inode, struct file *file)
+ file->f_op = old_fops;
+ goto fail;
+ }
+- if(file->f_op->open)
++ if(file->f_op->open) {
++ mutex_unlock(&dvbdev_mutex);
+ err = file->f_op->open(inode,file);
++ mutex_lock(&dvbdev_mutex);
++ }
+ if (err) {
+ fops_put(file->f_op);
+ file->f_op = fops_get(old_fops);
+--
+
rm -f .dependencies
rm -rf contrib/sasc-ng/sc/locale
-override_dh_auto_build:
- #cd contrib/sasc-ng; make module; make
+# build_(kernel)_(flavor), e.g. build_3.7-trunk-amd64_sse2
+# build_kernel needs to happen before build_sasc because build_sasc need
+# dvbdev.h which is provided by build_kernel!
-# build_(kernel)_(flavor), e.g. build_3.7.trunk-amd64_sse2
-build_%:
+build_sasc_%:
VERSION="$*"; \
FLAVOR=$${VERSION#*_}; \
KERNEL=$${VERSION/_$$FLAVOR/}; \
- sed -e "s|#DVB_DIR#|$(CURDIR)/debian/includes/$$KERNEL/|" < debian/config.mak-$$FLAVOR > contrib/sasc-ng/config.mak; \
+ sed -e "s|#DVB_DIR#|$(CURDIR)/debian/tmp/include/$$KERNEL/|" < debian/config.mak-$$FLAVOR > contrib/sasc-ng/config.mak; \
echo "Building $$VERSION - $$FLAVOR"; \
cd contrib/sasc-ng; \
make module CC=gcc-4.6 CXX=g++-4.6; \
make module_clean; \
make clean
-override_dh_auto_install: $(foreach kernel,$(KERNELS),$(foreach flav,$(FFDECSA_FLAVORS),build_$(kernel)_$(flav)))
- # use (package).install instead
+# build_kernel_(kernel), e.g. build_kernel_3.7-trunk-amd64
+build_kernel_%:
+ VERSION="$*"; \
+ KERNEL=$${VERSION#*_}; \
+ SHORT_KERNEL=$${KERNEL%%-*}; \
+ KERNEL_TARBALL=/usr/src/linux-source-$${SHORT_KERNEL}.tar.bz2; \
+ BUILD_DIR=/lib/modules/$${KERNEL}/build; \
+ echo "Building patched dvb-core module for kernel $${KERNEL}"; \
+ tmpdir=$(CURDIR)/debian/tmp-$${SHORT_KERNEL}; \
+ mkdir -p $$tmpdir; \
+ tar xjf $${KERNEL_TARBALL} -C $${tmpdir} --strip-components 4 linux-source-$${SHORT_KERNEL}/drivers/media/dvb-core/; \
+ patch -p4 -d $${tmpdir} < $(CURDIR)/debian/linux-3.7.1-dvb-mutex.patch; \
+ make -C $${BUILD_DIR} M=$${tmpdir} modules; \
+ mkdir -p $(CURDIR)/debian/tmp/$$KERNEL/module-updates; \
+ mkdir -p $(CURDIR)/debian/tmp/include/$$KERNEL/; \
+ cp $${tmpdir}/dvb-core.ko $(CURDIR)/debian/tmp/$$KERNEL/module-updates/; \
+ cp $${tmpdir}/dvbdev.h $(CURDIR)/debian/tmp/include/$$KERNEL/; \
+ rm -rf $${tmpdir}
+
+.PHONY: build_kernel
+build_kernel: $(foreach kernel,$(KERNELS),build_kernel_$(kernel))
+
+.PHONY: build_sasc
+build_sasc: $(foreach kernel,$(KERNELS),$(foreach flav,$(FFDECSA_FLAVORS),build_sasc_$(kernel)_$(flav)))
+
+override_dh_auto_build:
+ # Do nothing
+
+override_dh_auto_install: build_kernel build_sasc
CONTROL_FILES = debian/control.source debian/control.flavor debian/rules debian/rules.defs debian/sasc-ng.install.in
comma = ,
$(MAKE) -f debian/rules debian/control-real
endif
+define kernel_short_version
+$(shell echo $1|sed -e's/-.*//')
+endef
+
LINUX_HEADERS =$(foreach f,$(KERNELS),linux-headers-$(f) (=$(KERNEL_VERSION_$(f)))$(comma))
+#LINUX_SOURCES =$(foreach f,$(KERNELS),linux-source-$(KERNEL_VERSION_SHORT_$f) (=$(KERNEL_VERSION_$(f)))$(comma))
+LINUX_SOURCES =$(foreach f,$(KERNELS),linux-source-$(call kernel_short_version,$(f)) (=$(KERNEL_VERSION_$(f)))$(comma))
# call with $1 = kernel version, $2 = full kernel version, $3 = flavor
define append-flavor-entries
endef
+
debian/control-real: $(CONTROL_FILES)
sed \
-e 's/#LINUX_HEADERS#/$(LINUX_HEADERS)/g' \
+ -e 's/#LINUX_SOURCES#/$(LINUX_SOURCES)/g' \
debian/control.source > debian/control.tmp
$(foreach kernel,$(KERNELS),$(foreach flav,$(FFDECSA_FLAVORS),$(call append-flavor-entries,$(kernel),$(KERNEL_VERSION_$(kernel)),$(flav))))
mv debian/control.tmp debian/control
-KERNELS = 3.7-trunk-amd64
-KERNEL_VERSION_3.7-trunk-amd64 = 3.7.1-1~experimental.2.sasc1
+KERNELS = 3.8-trunk-amd64
+KERNEL_VERSION_3.8-trunk-amd64 = 3.8.3-1~experimental.1
FFDECSA_FLAVORS = core2 athlon64 atom corei5
debian/tmp/#KERNEL#-#FLAVOR#/bin/* /usr/sbin/
debian/tmp/#KERNEL#-#FLAVOR#/modules/* /lib/modules/#KERNEL#/misc
debian/tmp/#KERNEL#-#FLAVOR#/lib/* /usr/lib/
+debian/tmp/#KERNEL#/module-updates/* /lib/modules/#KERNEL#/updates
examples/cardclient.conf.example /etc/sasc-ng/
examples/cardslot.conf.example /etc/sasc-ng/
examples/externalau.sh.example /etc/sasc-ng/