[Pkg-voip-commits] r8351 - in /dahdi-tools/trunk/debian: changelog patches/series patches/xpp_udev_background patches/xpp_udev_nosleep

tzafrir at alioth.debian.org tzafrir at alioth.debian.org
Thu Apr 29 17:24:09 UTC 2010


Author: tzafrir
Date: Thu Apr 29 17:24:09 2010
New Revision: 8351

URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=8351
Log:
* Patch xpp_udev_background: move xpp firmware loading to background.
* Patch xpp_udev_nosleep: Remove a sleep from previous patch that is not
  needed in Debian.

Added:
    dahdi-tools/trunk/debian/patches/xpp_udev_background
    dahdi-tools/trunk/debian/patches/xpp_udev_nosleep
Modified:
    dahdi-tools/trunk/debian/changelog
    dahdi-tools/trunk/debian/patches/series

Modified: dahdi-tools/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-voip/dahdi-tools/trunk/debian/changelog?rev=8351&op=diff
==============================================================================
--- dahdi-tools/trunk/debian/changelog (original)
+++ dahdi-tools/trunk/debian/changelog Thu Apr 29 17:24:09 2010
@@ -6,8 +6,11 @@
     dropped: merged upstream.
   * dahdi-linux 2.3.0 is required (extra config options for dahdi_cfg).
   * Patch init_stop: Also declare dependencies for 'stop'.
-
- -- Tzafrir Cohen <tzafrir at debian.org>  Tue, 20 Apr 2010 00:27:09 +0300
+  * Patch xpp_udev_background: move xpp firmware loading to background.
+  * Patch xpp_udev_nosleep: Remove a sleep from previous patch that is not
+    needed in Debian.
+
+ -- Tzafrir Cohen <tzafrir at debian.org>  Thu, 29 Apr 2010 19:19:26 +0300
 
 dahdi-tools (1:2.2.1.1-1) unstable; urgency=low
 

Modified: dahdi-tools/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-voip/dahdi-tools/trunk/debian/patches/series?rev=8351&op=diff
==============================================================================
--- dahdi-tools/trunk/debian/patches/series (original)
+++ dahdi-tools/trunk/debian/patches/series Thu Apr 29 17:24:09 2010
@@ -2,3 +2,5 @@
 echocan_oslec
 init_unload_oslec
 init_stop
+xpp_udev_background
+xpp_udev_nosleep

Added: dahdi-tools/trunk/debian/patches/xpp_udev_background
URL: http://svn.debian.org/wsvn/pkg-voip/dahdi-tools/trunk/debian/patches/xpp_udev_background?rev=8351&op=file
==============================================================================
--- dahdi-tools/trunk/debian/patches/xpp_udev_background (added)
+++ dahdi-tools/trunk/debian/patches/xpp_udev_background Thu Apr 29 17:24:09 2010
@@ -1,0 +1,69 @@
+From: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
+Date: Thu, 29 Apr 2010 15:06:38 +0000
+Subject: Load xpp firmware in the background (udev)
+Origin: http://svnview.digium.com/svn/dahdi?view=revision&revision=8580
+
+Move loading the the xpp firmwares (when called from udev) to a background
+sub-process. This helps with:
+* Don't block udev
+* It seems that with older systems (e.g. CentOS 5) we need to wait a bit
+  for the device file to appear (in one of the upcoming udev events). If we
+  keep blocking udev, we won't have the device file.
+
+The 'sleep' does not seem to be required for newer systems (e.g. Debian Lenny).
+
+Patch not yet in upstream branch 2.3 but should hopefully be merged there soon.
+---
+ xpp/xpp_fxloader |   25 ++++++++++++++++++++++---
+ 1 files changed, 22 insertions(+), 3 deletions(-)
+
+diff --git a/xpp/xpp_fxloader b/xpp/xpp_fxloader
+index ca70823..ef13cf4 100644
+--- a/xpp/xpp_fxloader
++++ b/xpp/xpp_fxloader
+@@ -67,6 +67,7 @@ USB_PREFIX=
+ FIRMWARE_DIR="${FIRMWARE_DIR:-/usr/share/dahdi}"
+ ASTRIBANK_HEXLOAD=${ASTRIBANK_HEXLOAD:-/usr/sbin/astribank_hexload}
+ ASTRIBANK_TOOL=${ASTRIBANK_TOOL:-/usr/sbin/astribank_tool}
++XPP_UDEV_SLEEP_TIME="${XPP_UDEV_SLEEP_TIME:-1}"
+ 
+ USB_FW="${USB_FW:-USB_FW.hex}"
+ 
+@@ -313,8 +314,23 @@ if [ "$XPP_HOTPLUG_DISABLED" != '' ]; then
+ 	exit 0
+ fi
+ 
+-if [ "$ACTION" = "add" ] && [ -w "$DEVICE" ]
+-then
++if [ "$ACTION" != add ]; then
++	exit 0;
++fi
++
++# This procedure is run in the background to do the actual work of loading the
++# firmware. Running it in the background allows udev to continue doing other tasks
++# and thus provide a faster startup.
++#
++# On some systems (e.g. CentOS 5) we get the relevant udev event before the device
++# file is ready. Which is why we want the background process to wait a bit first.
++udev_delayed_load() {
++	# Make sure the new device is writable:
++	sleep "$XPP_UDEV_SLEEP_TIME"
++	if [ ! -w "$DEVICE" ]; then
++		return;
++	fi
++
+ 	$LOGGER "Trying to find what to do for product $PRODUCT, device $DEVICE"
+ 	prod_id=`echo "$PRODUCT" | cut -d/ -f2`
+ 	case "$PRODUCT" in
+@@ -333,4 +349,7 @@ then
+ 		load_fw_device "$DEVICE" "$FIRM_FPGA"
+ 		;;
+ 	esac	
+-fi
++}
++
++udev_delayed_load &
++
+-- 
+1.7.0
+

Added: dahdi-tools/trunk/debian/patches/xpp_udev_nosleep
URL: http://svn.debian.org/wsvn/pkg-voip/dahdi-tools/trunk/debian/patches/xpp_udev_nosleep?rev=8351&op=file
==============================================================================
--- dahdi-tools/trunk/debian/patches/xpp_udev_nosleep (added)
+++ dahdi-tools/trunk/debian/patches/xpp_udev_nosleep Thu Apr 29 17:24:09 2010
@@ -1,0 +1,23 @@
+Subject: Remove a sleep on xpp firmware loading
+Author: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
+Forwarded: no
+
+Newer xpp udev rules are simpler and work well for newer kernels. Sadly they
+leave a problem with some older systems (e.g. CentOS 5, using 2.6.18).
+
+As a workaround, the firmware loading was moved to the a background
+sub-process (which is generally a good idea) and a 'sleep 1' was added to
+allow the device file to be created. This sleep is not needed in Lenny and
+Squeeze systems. Hence this patch converts it to a 'sleep 0'.
+
+--- a/xpp/xpp_fxloader
++++ b/xpp/xpp_fxloader
+@@ -67,7 +67,7 @@ USB_PREFIX=
+ FIRMWARE_DIR="${FIRMWARE_DIR:-/usr/share/dahdi}"
+ ASTRIBANK_HEXLOAD=${ASTRIBANK_HEXLOAD:-/usr/sbin/astribank_hexload}
+ ASTRIBANK_TOOL=${ASTRIBANK_TOOL:-/usr/sbin/astribank_tool}
+-XPP_UDEV_SLEEP_TIME="${XPP_UDEV_SLEEP_TIME:-1}"
++XPP_UDEV_SLEEP_TIME="${XPP_UDEV_SLEEP_TIME:-0}"
+ 
+ USB_FW="${USB_FW:-USB_FW.hex}"
+ 




More information about the Pkg-voip-commits mailing list