[Pkg-voip-commits] r2984 - in zaptel/trunk/debian: . patches
Tzafrir Cohen
tzafrir-guest at alioth.debian.org
Tue Jan 9 09:15:20 CET 2007
Author: tzafrir-guest
Date: 2007-01-09 09:15:19 +0100 (Tue, 09 Jan 2007)
New Revision: 2984
Added:
zaptel/trunk/debian/patches/xpp_udev.dpatch
Modified:
zaptel/trunk/debian/changelog
zaptel/trunk/debian/patches/00list
zaptel/trunk/debian/rules
Log:
* xpp firmwares changed location. Remove new ones as well.
* Add support for udev loading of those firmwares.
Modified: zaptel/trunk/debian/changelog
===================================================================
--- zaptel/trunk/debian/changelog 2007-01-08 21:44:18 UTC (rev 2983)
+++ zaptel/trunk/debian/changelog 2007-01-09 08:15:19 UTC (rev 2984)
@@ -2,6 +2,10 @@
* NOT RELEASED YET
+ [Tzafrir Cohen]
+ * xpp firmwares changed location. Remove new ones as well.
+ * Add support for udev loading of those firmwares.
+
-- Kilian Krause <kilian at debian.org> Wed, 3 Jan 2007 21:02:55 +0100
zaptel (1:1.2.12~dfsg-2) unstable; urgency=low
Modified: zaptel/trunk/debian/patches/00list
===================================================================
--- zaptel/trunk/debian/patches/00list 2007-01-08 21:44:18 UTC (rev 2983)
+++ zaptel/trunk/debian/patches/00list 2007-01-09 08:15:19 UTC (rev 2984)
@@ -13,3 +13,4 @@
wct4xxp-dfsg.dpatch
dbug391840.dpatch
Makefile_hostcc
+xpp_udev
Added: zaptel/trunk/debian/patches/xpp_udev.dpatch
===================================================================
--- zaptel/trunk/debian/patches/xpp_udev.dpatch 2007-01-08 21:44:18 UTC (rev 2983)
+++ zaptel/trunk/debian/patches/xpp_udev.dpatch 2007-01-09 08:15:19 UTC (rev 2984)
@@ -0,0 +1,200 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## xpp_udev.dpatch by Tzafrir Cohen <tzafrir.cohen at xorcom.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix udev firmware load (and slight documentation) of the Xorcom
+## DP: Astribank (zaptel/xpp)
+## DP: Patch is to be merged soon into official driver.
+
+ at DPATCH@
+diff -urNad zaptel-1.2.12~dfsg~/xpp/README.Astribank zaptel-1.2.12~dfsg/xpp/README.Astribank
+--- zaptel-1.2.12~dfsg~/xpp/README.Astribank 2006-11-30 23:46:11.000000000 +0200
++++ zaptel-1.2.12~dfsg/xpp/README.Astribank 2007-01-08 16:05:37.000000000 +0200
+@@ -126,11 +126,54 @@
+ this will be the old value + 1.
+
+
++Firmware Loading with Hotplug:
++"""""""""""""""""""""""""""""
++The Hotplug framework was popular for hotplugging and usually also
++autoloading drivers. If it is used on your system, you'll see
++/etc/hotplug with many files under it. Hotplug will automatically load
++most relevant USB and PCI kernel modules by the relevant USB and PCI
++IDs. Again: if the framework is in place and the proper configuration
++files are in place, the firmware should be loaded automatically.
++
++In order to get hotplug to autoload the firmware into the Astribank,
++the configuration file xpp_fxloader.usermap and the script xpp_fxloader
++should be copied into /etc/hotplug/usb/ . This is done by 'make -C
++xpp/utils install' .
++
++xpp_fxloader.usermap includes a map of USB IDs and the command to run
++when they are encountered. It instructs hotplug to run the script
++xpp_fxloader from that directory. This is done by 'make -C
++xpp/utils install' .
++
++When xpp_fxloader is run without any parameters it assumes that it was
++run by the hotplug scripts. It will then check if the even is an "add"
++event (and not a "remove" event), and if so, install the required
++firmware file. It will be called twice, as after the load of the USB
++firmware the device will reenumerate itself and thus "unplug" and
++"replug" to load the FPGA firmware.
++
++
+ Firmware Loading with UDEV:
+ """"""""""""""""""""""""""
+-Firmware loading with udev should work but is not installed
+-automatically, yet. See the comments in the beginning of the script
+-/etc/hotplug/usb/xpp_fxloader .
++The UDEV framework has replaced Hotplug in most recent systems. If you
++have a recent 2.6 system with no Hotplug and files under /etc/udev,
++chances are you ude udev. udev does quite a few nice things.
++Again: if the framework is in place and the proper configuration
++files are in place, the firmware should be loaded automatically.
++
++In order to get hotplug to autoload the firmware into the Astribank,
++the configuration file xpp.rules should be copied into /etc/udev/rules.d
++and the script xpp_fxloader should be copied into /etc/hotplug/usb/ .
++This is done by 'make -C xpp/utils install' .
++
++xpp.rules instructs udevd to run xpp_fxloader with the option udev and
++the USB ID when an Astribank is plugged and needs loading firmware.
++When xpp_fxloader is run with the option udev it assumes that it was
++run by udevd scripts. It will then install the required firmware file.
++It will be called twice, as after the load of the USB firmware the
++device will reenumerate itself and thus "unplug" and "replug" to load
++the FPGA firmware.
++
+
+ Loading The Modules:
+ """""""""""""""""""
+@@ -297,6 +340,47 @@
+ 13 XPP_IN/0-12 FXOKS (In use)
+ 14 XPP_IN/0-13 FXOKS (In use)
+
++Sample dialplan (extentions.conf) for all the above:
++
++[phones-zap]
++; 401 will dial to channel 1, 420, to zaptel channel 20, etc.
++exten => _4XX,1,Dial(ZAP/${EXTEN:1})
++
++[trunk-9]
++; Dial through the first FXO port availble.
++; This assumes that all FXO ports are in group 0 and all others are not,
++; as in the sample zapata.conf for 8FXS/8FXO below, and as is generated
++; by genzaptelconf by default.
++exten => 9.,Dial(Zap/g0/${EXTEN:1})
++
++[from-internal]
++; The context of FXS ports: analog phones.
++; They are allowed to dial to all other phones
++include => phones-zap
++; They are also allowed to call through the trunk:
++include => trunk-9
++
++[from-pstn]
++; Calls from the PSTN enter here. Redirect calls to an IVR
++; or a default extension in the s context here. In this case we
++; redirect calls to Zaptel channel 1:
++exten => s,1,Dial(Zap/1)
++
++[astribank-inputs]
++exten => s,1,Set(ZAP_CHAN=Cut(${CHANNEL},-,1))
++exten => s,n,Set(ZAP_CHAN=Cut(${ZAP_CHAN},/,2))
++; 11 is the number of the first input port. At least in the sample
++; configuration below.
++exten => s,n,Set(INPUT_NUM=Math(${ZAP_CHAN}-11))
++; The sample below just logs the signal.
++exten => s,n,NoOp(Got signal from input port number ${INPUT_NUM})
++; Alternatively:
++;exten => s,n,System(run something)
++
++; No. We did not forget the context astribank-outputs. Output
++; ports only get calls from the PBX. Thus they don't need a context
++; of their own.
++
+
+ /proc Interface
+ """""""""""""""
+diff -urNad zaptel-1.2.12~dfsg~/xpp/utils/Makefile zaptel-1.2.12~dfsg/xpp/utils/Makefile
+--- zaptel-1.2.12~dfsg~/xpp/utils/Makefile 2006-11-30 23:46:11.000000000 +0200
++++ zaptel-1.2.12~dfsg/xpp/utils/Makefile 2007-01-08 16:05:37.000000000 +0200
+@@ -16,6 +16,7 @@
+ DATADIR = $(datadir)/zaptel
+ MANDIR = $(mandir)/man8
+ HOTPLUG_USB_DIR = /etc/hotplug/usb
++UDEV_RULES_DIR = /etc/udev/rules.d
+
+ XPD_FIRMWARE = $(wildcard ../firmwares/*.hex)
+ XPD_INIT_DATA = $(XPD_FIRMWARE) init_fxo_modes
+@@ -53,6 +54,8 @@
+ $(INSTALL) -d $(DESTDIR)$(HOTPLUG_USB_DIR)
+ $(INSTALL_DATA) xpp_fxloader.usermap $(DESTDIR)$(HOTPLUG_USB_DIR)/
+ $(INSTALL) xpp_fxloader $(DESTDIR)$(HOTPLUG_USB_DIR)/
++ $(INSTALL) -d $(DESTDIR)$(UDEV_RULES_DIR)
++ $(INSTALL_DATA) xpp.rules $(DESTDIR)$(UDEV_RULES_DIR)/
+
+ libhexfile.a: hexfile.o
+ $(AR) cru $@ $^
+diff -urNad zaptel-1.2.12~dfsg~/xpp/utils/xpp.rules zaptel-1.2.12~dfsg/xpp/utils/xpp.rules
+--- zaptel-1.2.12~dfsg~/xpp/utils/xpp.rules 1970-01-01 02:00:00.000000000 +0200
++++ zaptel-1.2.12~dfsg/xpp/utils/xpp.rules 2007-01-08 16:05:37.000000000 +0200
+@@ -0,0 +1,8 @@
++BUS!="usb", ACTION!="add", GOTO="xpp_usb_add_end"
++
++# Load firmware into the Xorcom Astribank device:
++SYSFS{idVendor}=="e4e4", SYSFS{idProduct}=="11[345][01]", \
++ RUN+="/etc/hotplug/usb/xpp_fxloader udev $sysfs{idVendor}/$sysfs{idProduct}/$sysfs{bcdDevice}"
++
++LABEL="xpp_usb_add_end"
++
+diff -urNad zaptel-1.2.12~dfsg~/xpp/utils/xpp_fxloader zaptel-1.2.12~dfsg/xpp/utils/xpp_fxloader
+--- zaptel-1.2.12~dfsg~/xpp/utils/xpp_fxloader 2006-11-28 15:36:03.000000000 +0200
++++ zaptel-1.2.12~dfsg/xpp/utils/xpp_fxloader 2007-01-08 16:05:37.000000000 +0200
+@@ -1,8 +1,8 @@
+ #!/bin/sh
+
+-# xpp_fxload: load XPP firmware
++# xpp_fxloader: load Xorcom Astribank (XPP) firmware
+ #
+-# This script can be run manually or from hotplug.
++# This script can be run manually or from hotplug/udev.
+ #
+ # Firmware files should be located in $FIRMWARE_DIR which defaults:
+ # 1. /usr/share/zaptel
+@@ -12,28 +12,21 @@
+ # Manual Run
+ # ##########
+ #
+-# path/to/xpp_fxloader xppdetect
++# path/to/xpp_fxloader load
+ #
+ # Make sure the firmware files are in $FIRMWARE_DIR
+ #
++# UDEV Installation
++# #################
+ #
+-# Hotplg Run
+-# ##########
++# Copy xpp.rules to /etc/udev/udev.d and xpp_fxloader to /etc/hotplug/usb/ .
+ #
+-# 1. Copy this file and the file xpp_fxloader.usermap to /etc/hotplug/usb/
+-# 2. tail -f /var/log/messages...
++# Hotplug Installation
++# ####################
+ #
+-#
+-# Suggested udev configuration: I used the following file as
+-# /etc/udev/rules.d/z60_zaptel.rules :
++# Copy this file and the file xpp_fxloader.usermap to /etc/hotplug/usb/ .
+ #
+-# BUS!="usb", ACTION!="add", GOTO="zaptel_usb_add_end"
+-#
+-# SYSFS{idVendor}=="e4e4", SYSFS{idProduct}=="11[345][01]", \
+-# RUN+="/etc/hotplug/usb/xpp_fxloader udev $sysfs{idVendor}/$sysfs{idProduct}/$sysfs{bcdDevice}"
+ #
+-# LABEL="zaptel_usb_add_end"
+-#
+ # Written by Tzafrir Cohen <tzafrir.cohen at xorcom.com>
+ # Copyright (C) 2006, Xorcom
+ #
Property changes on: zaptel/trunk/debian/patches/xpp_udev.dpatch
___________________________________________________________________
Name: svn:executable
+ *
Modified: zaptel/trunk/debian/rules
===================================================================
--- zaptel/trunk/debian/rules 2007-01-08 21:44:18 UTC (rev 2983)
+++ zaptel/trunk/debian/rules 2007-01-09 08:15:19 UTC (rev 2984)
@@ -201,22 +201,23 @@
@@echo "Debian version: $(DEBVERSION)"
@@echo "Upstream version: $(UPVERSION)"
+TARBALL_DIR=../tarballs/zaptel-$(UPVERSION).tmp
get-orig-source:
@@dh_testdir
@@[ -d ../tarballs/. ]||mkdir -p ../tarballs
@@echo Downloading $(UPFILENAME) from $(URL) ...
@@wget -N -nv -T10 -t3 -O ../tarballs/$(UPFILENAME) $(URL)
@@echo Repacking as DFSG-free...
- @@mkdir -p ../tarballs/zaptel-$(UPVERSION).tmp/
- @@cd ../tarballs/zaptel-$(UPVERSION).tmp ; \
+ @@mkdir -p $(TARBALL_DIR)/
+ @@cd $(TARBALL_DIR) ; \
tar xfz ../$(UPFILENAME)
- @@rm -rf ../tarballs/zaptel-$(UPVERSION).tmp/zaptel-$(UPVERSION)/OCT6114-128D.ima
- @@rm -rf ../tarballs/zaptel-$(UPVERSION).tmp/zaptel-$(UPVERSION)/wct4xxp/OCT6114-128D.ima
- @@rm -rf ../tarballs/zaptel-$(UPVERSION).tmp/zaptel-$(UPVERSION)/xpp/utils/*.hex
- @@cd ../tarballs/zaptel-$(UPVERSION).tmp ; \
+ @@rm -rf $(TARBALL_DIR)/zaptel-$(UPVERSION)/wct4xxp/OCT*.ima
+ @@rm -rf $(TARBALL_DIR)/zaptel-$(UPVERSION)/xpp/firmware/*.hex
+ @@rm -rf $(TARBALL_DIR)/zaptel-$(UPVERSION)/xpp/utils/*.hex
+ @@cd $(TARBALL_DIR) ; \
tar cfz ../$(FILENAME) *
@@echo Cleaning up...
- @@$(RM) -rf ../tarballs/zaptel-$(UPVERSION).tmp/
+ @@$(RM) -rf $(TARBALL_DIR)/
@@$(RM) -f ../tarballs/$(UPFILENAME)
binary: binary-indep binary-arch
More information about the Pkg-voip-commits
mailing list